ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Memory Error with HSSFCGI

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

  • Memory Error with HSSFCGI

    I am having issues with a program that loops through data, creating multiple workbooks using HSSFCGI tools. I've narrowed the issue down to occurring when using WrtHtmlToStmf for the 7th (and last) workbook (stepping through debug and watching the joblog of my interactive job).

    In addition to the error, the output of WrtHtmlToStmf contains invalid character data followed by a "repeat" of data from the beginning of the file.

    I'm using HSSFCGI downloaded/installed Jan 8, 2019.

    The joblog shows:

    MCH0601
    Message . . . . : Space offset X'00000000' or X'0000800121265098' is outside
    current limit for object GREGWA GWILBURN 346885.
    Cause . . . . . : A program tried to set a space pointer, tried to use
    storage outside a space, or tried to use an unallocated page in teraspace.
    The space class is X'07'. The space class designates the type of space:
    00-primary associated space (includes space objects).
    01-secondary associated space 0.
    02-implicit process space for automatic storage.
    03-implicit process space for static storage in activation group mark
    X'0000000000000000'.
    04-implicit process space for heap identifier X'00000000' in activation
    group mark X'0000000000000000'.
    05-constant space.
    06-space for handle-based heap identifier X'00000000'.
    07-teraspace offset X'0000800121265098'.
    08-teraspace for System i5 PASE memory address X'0000800121265098'.
    Offset X'00000000' only applies to storage outside teraspace.
    X'80000000000000000000800121265098' is a pointer to the teraspace page or
    the start of the implicit process space for the allocation.

    Followed by:

    C2M1211
    Message . . . . : The ILE C heap control structure has been corrupted.
    Cause . . . . . : This can be caused by many things. The most common causes
    include freeing a space twice, writing outside the bounds of allocated
    storage, or writing to storage that has been freed.
    Recovery . . . : Find the code that is corrupting the ILE C heap control
    structure and make changes to avoid the corruption. The address of the
    corrupted storage is X'80000000000000000000000000000000'. The internal
    statement number of the code which detected the corruption is 2253.
    * * * * * E N D O F L I S T I N G * * * * *

    My code checks for the size before writing the HTML buffer... this particular file is only 1.64 Mb (1647810 bytes)

    Code:
           dcl-proc  EndWorkBook;
    
             wrtsection('endsheet');
             wrtsection('endbook');
    
             rc = GetHtmlBytesBuffered();
             if rc > MAX_SIZE;                                        // Write WRTHTML will Fail
               dump(a);
             endif;
    
             rc = WrtHtmlToStmf(%trim(xmlStmf):cp);                   // Write to XML stmf
             ClrHtmlBuffer();
    
           //  callp ClrHtmlBuffer();
    
           //  cmdstring = 'hssfcgi/xlsxgen ' +                         // Create XLSX stmf
           //              'inpstmf(' + q + %trim(xmlStmf) + q + ') ' +
           //              'outstmf(' + q + %trim(xlsStmf) + q + ') ' +
           //              'frozen(' + frzpane + ') ' +
           //              'hdgcolor(' + hdgcolor + ')';
           //  rc = docmd(%trim(cmdstring));
           //
           //  if rc = 0;                                               // Delete XML stmf
           //    cmdstring = 'rmvlnk ' + q + %trim(xmlStmf) + q ;
           //    rc = docmd(%trim(cmdstring));
           //  endif;
    
           end-proc;
    I also tried using
    /copy HSSFCGI/qrpglesrc,hspecsbnd2

    The memory error is not longer in the job log, but the data is still corrupted

    Code:
        <cell >
        <data type="number" >
          4.5000
        </data>
        Ӎ^  ؠ௽ <XML>
     <workbook>
      <worksheet name="RPT412A" print-header="Commission Report" print-orientation="landscape" print-scale="80">
       <row >
        <cell >
        <data type="Column-Header" >
          COM#
        </data>
        </cell>
        <cell >
        <data type="Column-Header" >
    Any suggestions would be greatly appreciated.
    Greg

  • #2
    This sounds like a bug in WrtHtmlToStmf or whatever routine you're calling when it happens.

    I think HSSFCGI is one of Giovanni's tools at Easy400, right? I'd suggest asking him for help.

    Comment


    • #3
      Originally posted by Scott Klement View Post
      This sounds like a bug in WrtHtmlToStmf or whatever routine you're calling when it happens.

      I think HSSFCGI is one of Giovanni's tools at Easy400, right? I'd suggest asking him for help.
      Thanks Scott... This does occur during WrtHtmlToStmf. I've been emailing with Giovanni. At his suggestion, I switched over to WrtSectionToStmf last evening. This doesn't exist in my version of HSSFCGI, so I had to change all /copy from HSSFCGI to CGIDEV2).

      That fixed the problem... Not sure how efficient this is writing to the IFS each section, but it's working.

      Comment

      Working...
      X