OS/2, eCS & ArcaOS - Technical > Programming

RUX function failure - but on multiple tries only...

<< < (2/3) > >>

Dariusz Piatkowski:
Thanks for all the replies guys!

So a clarification first as I went back through my code to remind myself just what exactly I clubbered together!!!

Well, turns out my initial aim was rather high-enough, meaning:

1) first I check whether I need to use a particular API (that's the rxu_api_required variable)
- this is pre-defined at the start of the REXX script, it's a generic framework I use in all my scripts, so different REXX DLLs may be loaded by different scripts

2) if I need to use a particular REXX DLL API, I then check to see if it's already been loaded into memory (that's the rxu_api variable)

3) at the very end of my code I call the DLL unload procedure where I:
- check to see if all the flagged DLLs have been previously loaded into memory (by examining the rxu_api variable)
- only if one was not previously loaded do I actually un-load it

Sooo...weird, but this was rock-solid, never any problems...then all of a sudden...BAM!!!

I booted to my MAINT partition and did a CHKDSK on my boot drive, found it to be DIRTY, so I ran with a /F parameter. That claimed to correct some things, no messages about lost dirs or files though.

I booted up, re-tested, but still the same failure.

I thought I would re-install the RXU RPM package, but strangely I'm seeing this in ANPM:


--- Quote -------------[ 29 Sep 2022 20:03:25 ]----------
Executing: @python2.7 G:\UTIL\ANPM\scripts\yum_reinstall.py rxu
Enabling temporary repository arcanoae-sub
Enabling temporary repository arcanoae-exp
Enabling temporary repository arcanoae-stage
Running Transaction Check
Non-fatal POSTIN scriptlet failure in rpm package rxu-1.a.0-3.oc00.pentium4
ERROR: wpi4rpm: Please, close WarpIN and reinstall "rxu" again.


ERROR: wpi4rpm: Please, close WarpIN and reinstall "rxu" again.


warning: %post(rxu-1.a.0-3.oc00.pentium4) scriptlet failed, exit status 253

Return code: 0
----------[ 29 Sep 2022 20:03:40 ]----------

--- End quote ---

Not sure if the mirror is down or something like that (as I do get a warning from ANPM itself), but I'll re-try later.

For now I have taken the advice to NOT un-load the DLL, so that's been commented out and things appear to work.

Dariusz Piatkowski:
Hi Remy,


--- Quote from: Remy on September 29, 2022, 11:12:45 pm ---If you would like be sure that all RXU functions you are going to call are loaded, you can check each of them at init and if some are missing, load them then instead of just testing 'rxuinit'

--- End quote ---

...so do you mean for example, instead of calling this RXU.DLL entry-point:


--- Code: ---...
CALL RxFuncAdd 'rxuinit','RXU','rxuinit'
CALL rxuinit
...

--- End code ---

call the RxFuncAdd with a specific function from that REXX DLL that I want to use, such as:


--- Code: ---CALL RxFuncAdd 'RxStartSession','RXU','RxStartSession'
CALL rxuinit

--- End code ---

The way I'm loading the DLL is as per the instructions in the DLL INF flie:


--- Quote ---How to register the functions:

In order to use the functions, you have to register them with Rexx like this:

  call rxfuncadd 'rxuinit','rxu','rxuinit'
  call rxuinit
...

--- End quote ---

For what it's worth, here is the matrix I put together to document the various Load/un-load APIs for specific REXX DLLs:


--- Code: ---LIBRARY NAME DLL LOAD UNLOAD VERSION API NOTES
=============== =============== =============== =============== =============== ===================================================================

RXU RXU RxuInit RxuTerm RxQuery Version API returns a whole bunch of stuff, need to parse first

REXXUTIL REXXUTIL SysLoadFuncs SysDropFuncs SysUtilVersion

RXUTILEX RXUTILEX Sys2LoadFuncs Sys2DropFuncs Sys2Version

RXEXTRAS RXEXTRAS RxExtra(LOAD) RxExtra(DROP) RxExtra(LOAD)

RXLVM RXLVM RxLvmLoadFuncs RxLvmDropFuncs RxLvmVersion Load and Unload seems to have an issue, fails on repeated attempts

--- End code ---

Lars:
One approach is as correct as the other.
Rxinit is just a convenience function that registers all REXX functions. But you can do that function per function by calling rxfuncadd. It is not mandatory to implement an init function but of course, it is convenient for the user.

Remy:

--- Quote from: Dariusz Piatkowski on September 30, 2022, 02:33:59 am ---Hi Remy,


--- Quote from: Remy on September 29, 2022, 11:12:45 pm ---If you would like be sure that all RXU functions you are going to call are loaded, you can check each of them at init and if some are missing, load them then instead of just testing 'rxuinit'

--- End quote ---

...so do you mean for example, instead of calling this RXU.DLL entry-point:


--- Code: ---...
CALL RxFuncAdd 'rxuinit','RXU','rxuinit'
CALL rxuinit
...

--- End code ---

call the RxFuncAdd with a specific function from that REXX DLL that I want to use, such as:


--- Code: ---CALL RxFuncAdd 'RxStartSession','RXU','RxStartSession'
CALL rxuinit

--- End code ---

The way I'm loading the DLL is as per the instructions in the DLL INF flie:


--- Quote ---How to register the functions:

In order to use the functions, you have to register them with Rexx like this:

  call rxfuncadd 'rxuinit','rxu','rxuinit'
  call rxuinit
...

--- End quote ---

For what it's worth, here is the matrix I put together to document the various Load/un-load APIs for specific REXX DLLs:


--- Code: ---LIBRARY NAME DLL LOAD UNLOAD VERSION API NOTES
=============== =============== =============== =============== =============== ===================================================================

RXU RXU RxuInit RxuTerm RxQuery Version API returns a whole bunch of stuff, need to parse first

REXXUTIL REXXUTIL SysLoadFuncs SysDropFuncs SysUtilVersion

RXUTILEX RXUTILEX Sys2LoadFuncs Sys2DropFuncs Sys2Version

RXEXTRAS RXEXTRAS RxExtra(LOAD) RxExtra(DROP) RxExtra(LOAD)

RXLVM RXLVM RxLvmLoadFuncs RxLvmDropFuncs RxLvmVersion Load and Unload seems to have an issue, fails on repeated attempts

--- End code ---

--- End quote ---

I would suggest you to check on your needed functions, something like:
e.g.
rxu_api = RxFuncQuery('rxunit')
IF rxu_api <> 0 THEN DO
         CALL RxFuncAdd 'rxuinit','RXU','rxuinit'
         CALL rxuinit
         msg_text="RXU: loaded into memory, RC="||rxu_api
         END
Else do
        rxu_functions = RxFuncQuery('RxStartSession')
        IF rxu_functions <> 0 THEN DO
                   CALL RxFuncAdd 'RxStartSession','RXU','RxStartSession'
                   CALL rxuinit
                   END
        /* Other used functions check routines */
End

Regards

Lars:
I think that is not how it is meant to be used. "rxuinit" is a registration-only function and will register all the functions at once. There is no point in checking if each individual function is loaded and call "rxuinit" over and over again.

At least that has been true for all other general load functions (of other REXX DLLs).

So it is either:

rc = rxfuncadd('rxuinit','RXU','rxuinit')
rc = rxuinit()


or:

rc = rxfuncadd('RxStartSession','RXU','RxStartSession')
rc = rxfuncadd('secondFunction,'RXU','secondFunction')
rc = rxfuncadd('thirdFunction','RXU','thirdFunction')
rc = ...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version