ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

MSGW in HTTPAPIR4

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MSGW in HTTPAPIR4

    Hello Scott Klement,
    There are couple of MSGW recently started happening in Production in HTTPAPIR4. These programs were running fine in Production for atleast 4 months without any issue.

    Following are the error details:
    1. Pointer not set for location referenced. Function check. MCH3601 unmonitored by HTTPAPIR4 at statement 0000004844, instruction X'0000'.
    Call stack: Program -> HTTP_PERSIST_REQ -> DO_OPER -> SENDREQ -> COMMTCP_BLOCKWRITE

    2. Space offset X'00FFF000' or X'0000000000000000' is outside current limit for object MYJOBNAME JOBUSER JOBNUMBER. Function check. MCH3601 unmonitored by HTTPAPIR4 at statement 0000004880, instruction X'0000'.
    Call stack: Program -> HTTP_URL_POST -> HTTP_URL_POST_RAW -> HTTP_PERSIST_POST -> HTTP_PERSIST_REQ -> DO_OPER -> SENDDOC -> COMMTCP_BLOCKWRITE

    Production has version 1.29. Please suggest.

  • #2
    What are you passing for the data to send and length of data when you call http_url_post()?

    It would appear that either the pointer you're sending is not valid, or the length is too large and so it is exceeding the size of the space.

    Comment


    • #3
      Thanks Scott. The maximum length of the field passed is 65535. Code snippet below.

      D myJSON S 65535A varying

      %len(myJSON) = %len(myJSON:*MAX);
      yajl_copyBuf( CCSID
      : %addr(myJSON:*data)
      : %len(myJSON)
      : length );

      %len(myJSON) = length;

      rc = http_url_post( URL
      : %addr( myJSON : *data )
      : %len( myJSON )
      : %Trim(LogFile)
      : HTTP_TIMEOUT
      : HTTP_USERAGENT
      : 'application/json; charset=UTF-8');

      Also noticed the source HTTPAPIR4, where SENDREQ & SENDDOC calls COMM_BLOCKWRITE and not COMMTCP_BLOCKWRITE (as per call stack). Not sure this has anything to do.

      Comment


      • #4
        For http_persist_req, code snippet is as below:

        D myJSON S 65535a varying
        D pointer S *

        yajl_copyBuf( CCSID
        : %addr(myJSON)
        : %size(myJSON)
        : length );
        myJSON = '{' + %Trim(myJSON) + '}';

        Pointer = http_persist_open( URL);

        rc = http_persist_req( 'PUT'
        : pointer
        : URL
        : 0
        : *null
        : %addr( myJSON : *data )
        : %len( myJSON )
        : 0
        : %pAddr(Proc)
        : HTTP_TIMEOUT
        : HTTP_USERAGENT
        : 'application/json' );

        PProc B
        D Pi 10i 0
        D fd 10i 0 value
        D data * value
        D length 10i 0 value
        C*
        /Free
        return length;
        /End-Free
        P E

        Comment


        • #5
          Nothing in the code you've posted would cause the errors you're reporting. The first error means that a parameter was passed with a *NULL address. The second error means that you've exceeded the amount of memory allocated to a space. The code you've posted doesn't appear to do that.

          Can you post a complete program (rather than these small snippets) that I can run to reproduce the problem?

          Comment


          • #6
            Originally posted by pshanmugam View Post
            1. Pointer not set for location referenced. Function check. MCH3601 unmonitored by HTTPAPIR4 at statement 0000004844, instruction X'0000'.
            Call stack: Program -> HTTP_PERSIST_REQ -> DO_OPER -> SENDREQ -> COMMTCP_BLOCKWRITE

            2. Space offset X'00FFF000' or X'0000000000000000' is outside current limit for object MYJOBNAME JOBUSER JOBNUMBER. Function check. MCH3601 unmonitored by HTTPAPIR4 at statement 0000004880, instruction X'0000'.
            Call stack: Program -> HTTP_URL_POST -> HTTP_URL_POST_RAW -> HTTP_PERSIST_POST -> HTTP_PERSIST_REQ -> DO_OPER -> SENDDOC -> COMMTCP_BLOCKWRITE
            FWIW: I encountered the same problem recently ... the program was communicating with a java server running on Linux.

            As best as I can determine, the Java server crashed in the middle of the data transfer and that caused an invalid length to be returned by the send procedure in the CommTcp_BlockWrite procedure. When the length (wwLen) was added to peBuffer, the pointer space extended outside the job space causing the MCH3601.

            I have no idea what kind of crash in the Java application could cause that though.

            david

            Comment


            • #7
              Hi David,

              Are you able to reproduce this problem? I have an idea that might fix it, but no way to test it since I can't reproduce.

              Comment


              • #8
                Unfortunately, I'm unable to reproduce the error ... it's entirely theoretical. I based my comment on the fact that we crashed at the specific line where we incremented peBuffer by wwLen.

                Comment

                Working...
                X