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)
I also tried using
/copy HSSFCGI/qrpglesrc,hspecsbnd2
The memory error is not longer in the job log, but the data is still corrupted
Any suggestions would be greatly appreciated.
Greg
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;
/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" >
Greg
Comment