[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XALLOC in program LIBHTTP/HTTPAPIR4



Scott,

Just an idea, but is it possible that the error happened when xalloc() has 
been called from iconvdyn()? The iconvdyn() procedure tries to allocate a 
memory buffer double the size of peSize (= inSize).

It appears as if the server returned 9767093 bytes. That size multiplied by 
2 equals to 19534186 which exceeds the limit of 16776704 bytes.

@Kim: Is it possible for you to compile HTTPAPI with tera space enabled?

Thomas.

Am 07.02.2011 22:08, schrieb Scott Klement:
> Hi Kim,
>
> I'd be happy to help, if you can tell me how to reproduce the problem?
> (AFAIK, it's not related to the open/write/close you posted.)
>
> Are you using the current beta version of HTTPAPI?
>
>
> On 2/7/2011 2:11 PM, Kim Gibson wrote:
>> I'm using HTTPAPI to send a request to a web service and then parse
>> the response. When receiving the response, I create a new stream file
>> in the IFS and write the embedded XML document received in the
>> response to the stream file.
>>
>> To create the stream file, I'm using this code:
>>
>> fd = open( embfile
>>     : O_CREAT + O_WRONLY + O_EXCL +
>>       O_CCSID + O_TEXTDATA + O_TEXT_CREAT
>>     : S_IRUSR + S_IWUSR + S_IROTH
>>     : 819
>>     : 0 );
>> callp write(fd: retval.valptr: retval.len);
>> callp close(fd);
>>
>> It's been working very well, until I received an error message:
>>
>>     From module . . . . . . . . :   QRNXMSG
>>     From procedure  . . . . . . :   SignalException
>>     Statement . . . . . . . . . :   21
>>     To module . . . . . . . . . :   HTTPUTILR4
>>     To procedure  . . . . . . . :   XALLOC
>>     Statement . . . . . . . . . :   3433
>>     Message . . . . :   The length requested for storage allocation is out of
>>       range.
>>     Cause . . . . . :   RPG procedure XALLOC in program LIBHTTP/HTTPAPIR4 tried to
>>       allocate storage with a length that was not a value between 1 and 16776704.
>>       Recovery  . . . :   Contact the person responsible for program maintenance
>>
>> The HTTP header of the response in this case follows:
>>
>> HTTP/1.1 200 OK
>> Cache-Control: private, max-age=0
>> Content-Length: 9767093
>> Content-Type: text/xml; charset=utf-8
>> svr: renwws02
>> X-Powered-By: ASP.NET
>> X-AspNet-Version: 2.0.50727
>> Date: Mon, 07 Feb 2011 19:52:11 GMT
>>
>> I dumped the program, but am not sure how to tell how much memory
>> XALLOC tried to allocate.  I do know that this response is
>> significantly larger than most that I receive, but probably not as
>> large as some that are going to come down the pike.
>>
>> Any ideas on where to start?
>>
>> Thanks so much,
>>
>> Kim Gibson
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------