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

Re: [Ftpapi] Uisng HTTPAPI and getting MCH4429 - automatic storage overflow



Thanks for your question.  That gave me the smack upside the head I needed.  It was character defined as 16000000 and I now remember that I defined it that big because I had no clue as to what I was doing when I started using HTTPAPI and panicked.  That is the size of the variable used with HTTP_REQ.  Now that I have things working and have a better understanding of HTTPAPI I remember that I can reduce the size of the variable.

I am so glad this resource exists and thankful for the people who participate.

Regards,
Bobby

On 07/17/20 10:20, Jon Paris wrote:
Just out of interest - how big was the variable?

Off the top of my head I can't think of any reason why this would happen, unless HTTPAPI is allocating large amounts of memory for buffers etc. and your procedure storage juts took the job over the top.



On Jul 17, 2020, at 10:01 AM, Bobby Adams <bobby_adams@xxxxxxx> wrote:

Thank you.  I had found the IBM explanation but not the article.

I solved the problem by moving one variable out of a procedure and making it a global variable.  The variable was only defined once in a procedure and now it is defined once as a global variable.  It is only used in one procedure.

I don't understand why the one change solved the problem, but that is probably because of my ignorance of the finer points of service programs.

Regards,
Bobby

On 07/17/20 03:16, Udesen, Peder wrote:
I tried to google for MCH4429 and it found this link with an explanation:
https://www.ibm.com/support/pages/explanation-message-mch4429-rc2

An old article from 2010 describes "Dynamic Program-Storage Management in ILE RPG":
https://www.mcpressonline.com/programming/rpg/exploit-dynamic-program-storage-management-in-ile-rpg


Regards
Peder

-----Oprindelig meddelelse-----
Fra: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> På vegne af Bobby Adams
Sendt: 16. juli 2020 17:49
Til: FTPAPI/HTTPAPI mailing list <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Emne: [Ftpapi] Uisng HTTPAPI and getting MCH4429 - automatic storage overflow

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


Hello,

I recently created a few program related to consuming a couple of REST APIs using HTTPAPI.  The individual programs all work.

I decided to put them together as individual procedures and create a service program.  I am going to add them one at a time.

The first program consumes a REST API to get an OAUTH token, parses the returned JSON and stores the token in a data area.  When I call it as part of a service program it fails with MCH4429 - automatic storage overflow.  I have compared the debug file to the file generated by old program and it is the same except it ends a few statements short.  I will include it below.

Why would converting it to a procedure in a service program cause the storage overflow?  What am I missing?

Thanks for your help.

Regards,
Bobby

HTTPAPI Ver 1.41 released 2020-06-05
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R3M0

New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry  : 2
DNS resolver options: x'00000136'
DNS default domain: FCA
DNS server found: 10.0.0.80
DNS server found: 10.0.0.85
https_init(): entered
QSSLPCL = *TLSV1.2 *TLSV1.1 *TLSV1 *SSLV3 SSL version 2 support disabled SSL version 3 support disabled Old interface to TLS version 1.0 support enabled TLS version 1.0 support enabled TLS version 1.1 support enabled TLS version 1.2 support enabled initializing GSK environment GSK Environment now available
-------------------------------------------------------------------------------------
Dump of local-side certificate information:
-------------------------------------------------------------------------------------
Nagle's algorithm (TCP_NODELAY) disabled.
SNI hostname set to: api-sandbox.pitneybowes.com
-------------------------------------------------------------------------------------
Dump of server-side certificate information:
-------------------------------------------------------------------------------------
Cert Validation Code = 6000
-----BEGIN CERTIFICATE-----
MIIGtjCCBZ6gAwIBAgIQDQIsqf2lm2qZwztTGCVBhjANBgkqhkiG9w0BAQsFADBN
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E
aWdpQ2VydCBTSEEyIFNlY3VyZSBTZXJ2ZXIgQ0EwHhcNMTkwMjIxMDAwMDAwWhcN
MjEwMzEwMTIwMDAwWjB2MQswCQYDVQQGEwJVUzEUMBIGA1UECBMLQ29ubmVjdGlj
dXQxEDAOBgNVBAcTB0RhbmJ1cnkxFTATBgNVBAoTDFBpdG5leSBCb3dlczEMMAoG
A1UECxMDUFNHM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VjdXJlU2VydmVyQ0EuY3J0MAkGA1Ud
EwQCMAAwggF9BgorBgEEAdZ5AgQCBIIBbQSCAWkBZwB1AKS5CZC0GFgUh7sTosxn
cAo8NZgE+RvfuON3zQ7IDdwQAAABaRCuiqMAAAQDAEYwRAIgRXU17U8Fsvc8l7Z7
sjgy0dFWPJ0Rh5DuE27SNsJxM1wCIAEyld27MXG41MUVdzobwUC5iy5ucJEQeiSd
DV/W6KzqAHYARJRlLrDuzq/EQAfYqP4owNrmgr7YyzG1P9MzlrW2gagAAAFpEK6K
vwAABAMARzBFAiBcWKShEylNUKbgeFq1cjyFRyDNgenIUz1gAWXL6PREfQIhAMyI
l9boxqJZ3e4f18aHDBMzLeAqpPSXla6dxrJz22muAHYAu9nfvB+KcbWTlCOXqpJ7
RzhXlQqrUugakJZkNo4e0YUAAAFpEK6KpwAABAMARzBFAiEA0q59oCEPGg+lKU/j
+nbqDdoE9+eyxBdAzSu5R/QRsbACIGLG4Q6HzrikExOdjyZl+6pXDvYLGV0RPM0X
9W8mKtfOMA0GCSqGSIb3DQEBCwUAA4IBAQCbVAbG0X5xXxqP53PiUiLqDhEJ0Whn
bsH2Tcr1wp8aYb+BdSgN47q9awzKlZU0kVe8DxZrRXIyrny/SKTyYlc2AkXt823b
0IDu/wdRQnyJTAemiCli2iiPQF8Alox4LsB0Tk55LNTdlM0ViwzM1DHaVl17ClZs
0C0cZtSAS2wQhuwgiquh8wKDl9v2t1mYXn0PRVec8UGDZeZj6aNcTAHz2uTUOn5K
MkTZpFpSGAtcN1603i07tZPX3eXCxYYthfRrqIlqLXHUPbFIvlErNGBLdMk6TU4+
dXiVkkYVz94q+fCZPqPiH+hkSZ26PJSUweKmwiRnoBpa7zwOMdYAePca
-----END CERTIFICATE-----
Serial Number: 0D:02:2C:A9:FD:A5:9B:6A:99:C3:3B:53:18:25:41:86
Common Name: *.pitneybowes.com
Country: US
State/Province: Connecticut
Locality: Danbury
Org Unit: Pitney Bowes
Org: PSG
Issuer CN: DigiCert SHA2 Secure Server CA Issuer Country: US Issuer Org: DigiCert Inc
Version: 3
not before: 20190220190000
Unknown Field: 19:00:00 20-02-2019
not after: 20210310070000
Unknown Field: 07:00:00 10-03-2021
pub key alg: 1.2.840.113549.1.1.1
signature algorithm: 1.2.840.113549.1.1.11 Unknown Field:
0382010F003082010A0282010100C6B7E05FB13CB216CC6ED110F929D7D0144A89C86D0099CA7AC1824970EE9E087AAB1B0A2096180B81AB1909AA423163EC05DE5ACD989307D57BFD8820CAE85FD9CD6F725224E191B4EA1D3CC7CD97A5ED32EB4ED47D86C69393B677086C5B0A12DC61F02725BC817A7186148BF8E1382A5A0489BD2AE2790C9AAE36D304577591631DE273EE74E188F0C0CC492F16F1B1F4538A7055181901F7C424B669A41129F9846751A83C0D9AE03541BE6BC574047D526C6E8F172EF0713DF8FBA5AC987E1C1DB3453E6ADC62959223A17A96F52DBF7A6BE5C3E84840FB4D81B80F4F08CC0394B165C7CFE4362435D4318CE54AE57C6F579EE9F47A10128819F377DA5D0203010001
Unknown Field: 2048
Unknown Field: DEDC85D0DD796CB6B5A42319ED9F2555 Unknown Field: 1.2.840.113549.2.5 Unknown Field: DA649F83D0409A371A7B34BB1E587B8DAABC9A03
Unknown Field:
96CE1D65559BE880D2AFC6FAF984372D9F815A814A5FEAF43512D80896A1E3EE
Unknown Field: 5
Unknown Field: *.pitneybowes.com
Unknown Field: 0
Unknown Field: 1.3.6.1.5.5.7.3.2
Unknown Field: 1.3.6.1.5.5.7.3.1
Unknown Field: 2.23.140.1.2.2
Unknown Field: 2.16.840.1.114412.1.1
Unknown Field: http://ocsp.digicert.com

Protocol Used: TLS Version 1.2
http_persist_req(POST) entered.
http_long_ParseURL(): entered
http_long_ParseURL(): entered
do_oper(POST): entered
There are 0 cookies in the cache
POST /oauth/token HTTP/1.1
Host: api-sandbox.pitneybowes.com
User-Agent: http-api/1.41
Content-Type: text/xml
Content-Length: 29
Authorization: Basic
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==


senddoc(): entered
grant_type=client_credentials
recvresp(): entered
HTTP/1.1 200 OK
Date: Thu, 16 Jul 2020 14:20:31 GMT
Content-Type: application/json
Content-Length: 186
Connection: keep-alive
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: Accept, Content-Type, Authorization
Access-Control-Allow-Credentials: true


SetError() #13: HTTP/1.1 200 OK
recvresp(): end with 200
recvdoc parms: identity 186
--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi

--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi