E9.2 File reading error in 9.2.5

JohnDanter2

JohnDanter2

VIP Member
Hi all

I have a weird issue with our upgrade to 9.2. We run 9.2.5 and use a bank file reading UBE which uses a custom BSFN to get the file from a folder.
This custom BSFN works fine in 9.0. Also works in 9.2 but only on the first call.

The issue appears in 9.2 when we call the BSFN a second time to check for more files in the specified folder. It falls over if you pass in idFile. 1st call it is 0 and find the file, 2nd call it uses the file ID pointer in the call and just crashes
INFO: In kernel signal handler, starting alarm handler: iParam: 00000000001654722385
INFO: Done setting IPC Handle State structures to abandoned, process exiting immediately: iParam: 00000000001654722385

I have attached the code and wondering if it is the dir = (DIR*) command

9.0 code (which maybe be issue)

dir = (DIR*)lpDS->idFile;

9.2 code (from a similar base E1 BSFN)

dir = jdeOpendir( lpDS->szSourcePath );


Thanks

John
 

Attachments

  • B5500040.pdf
    946.8 KB · Views: 13
I know this is old, but thought I'd explain the problem.

Assuming you are looking at 64 bit JDE, a DIR * will have 64 bits, while the ID is a 32 bit unsigned int. (This would never have worked on IBMi, because it uses 128 bit teraspace pointers even in 32 bit mode.)

To fix this, your would use jdeStoreDataPtr() to store the pointer into the data store designed for this use case, and get back an integer index for retrieval - which you can then store in your idFile variable.
If that is non-zero, you can get back the data pointer with jdeRetrieveDataPtr(lpDS->idFile) (which keeps the pointer index alive in the data pointer store) or use jdeRemoveDataPtr(lpDS->idFile), which returns your pointer, and removes it from the storage. The id you used is no longer valid after that. (don't want to have leaks!)

I hope this helps someone in the future.
 
Back
Top