Operating System - OpenVMS
1753814 Members
7361 Online
108805 Solutions
New Discussion юеВ

$GETRMI returning SS$_SUSPENDED

 
SOLVED
Go to solution
Mark Finn
New Member

Re: $GETRMI returning SS$_SUSPENDED

Thank you for all the responses! Before I get into trying them out, though, I should ask about a possible explanation.

Mr. Pinkley quoted the SSREF manual for OpenVMS Alpha Version 8.3 as saying "There is no synchronous wait form for this system service". We are running OpenVMS Alpha Version 7.3-2, and that apparently is not the case for that version. I am using $GETRMIW. So, to all of you who asked I must say that I'm not using $SYNCH, nor am I waiting for the event flag or the AST. My call is as follows:

stat := $getrmiw (,,, %REF items, iosb);

Is $GETRMIW possibly no longer available because there were problems with it - like the one I'm having?
Hoff
Honored Contributor

Re: $GETRMI returning SS$_SUSPENDED

Rather than attempting to figure out when you can get away with something, a task which has inherent risk...

IMO, it is safest to assume that the EFN is not an optional argument; either allocate one via pairs of lib$get_ef and lib$free_ef or by use of the V7.1 and later "Do Not Care" EF value EFN$C_ENF from efndef, and to assume that the IOSB is not optional.

Both an allocated EF and the IOSB should be unique over the entire lifetime of the call.

The same risk aversion plays into the condition value processing, as well. Don't assume what's documented are the only possible errors (as new or weird errors can sometimes arise). Rather, catch the specific failure(s) or specific success(es) that you specifically care about, then use the architected low-bit tests for the blanket failure (low bit clear) or blanket success (low bit set) tests.

That list of common coding bugs over in ATW topic (1661) didn't come from anywhere strange; those are all coding bugs I've encountered over the years. (Though what is strange here: I'm delivering a training presentation on this same topic tomorrow...) Those bugs can lead to subtle and hard-to-find errors, too.

Stephen Hoffman
HoffmanLabs LLC


Jon Pinkley
Honored Contributor

Re: $GETRMI returning SS$_SUSPENDED

From the V7.3 SSREF manual. (the oldest online manual, and perhaps the first to document the $GETRMI service.

http://h71000.www7.hp.com/doc/73final/4527/4527pro_053.html#jul_3077

--------------------------------------------------------------------------------

$GETRMI

Returns system performance information about the local system.

--------------------------------------------------------------------------------

Format
SYS$GETRMI [efn] [,nullarg] [,nullarg] ,itmlst [,iosb] [,astadr] [,astprm]


--------------------------------------------------------------------------------

There is no $GETRMIW listed, but no explicit statement that it does not exist.

I can't get a call to sys$getrmiw to link on VMS 7.3-2.

I just edited sys_getrmi_dir_buf.c, changed the sys$getrmi to sys$getrmiw, saved to sys_getrmiw_dir_buf.c, recompiled and relinked.

Here is the original

OT$ sho sys/nopro
OpenVMS V7.3-2 on node OMEGA 11-AUG-2008 16:28:59.42 Uptime 55 05:30:05
OT$ cc sys_getrmi_dir_buf

r0_status = sys$getrmi (EFN$C_ENF,
................^
%CC-I-IMPLICITFUNC, In this statement, the identifier "sys$getrmi" is implicitly declared as a function.
at line number 41 in file ROOT$USERS:[JON.SYS_GETRMI]SYS_GETRMI_DIR_BUF.C;1
OT$ link sys_getrmi_dir_buf

Here is the modified

OT$ cc sys_getrmiw_dir_buf

r0_status = sys$getrmiw (EFN$C_ENF,
................^
%CC-I-IMPLICITFUNC, In this statement, the identifier "sys$getrmiw" is implicitly declared as a function.
at line number 41 in file ROOT$USERS:[JON.SYS_GETRMI]SYS_GETRMIW_DIR_BUF.C;2
OT$ link sys_getrmiw_dir_buf
%LINK-W-NUDFSYMS, 1 undefined symbol:
%LINK-I-UDFSYM, SYS$GETRMIW
%LINK-W-USEUNDEF, undefined symbol SYS$GETRMIW referenced
in psect $LINK$ offset %X00000050
in module SYS_GETRMIW_DIR_BUF file ROOT$USERS:[JON.SYS_GETRMI]SYS_GETRMIW_DIR_BUF.OBJ;4
OT$

Note that the link failed with undefined symbol SYS$GETRMIW

Your example call appears to be using Pascal

stat := $getrmiw (,,, %REF items, iosb);

Did you have to do anything special in the link statement?

Perhaps the STARLET.PEN file is mapping $GETRMIW to $GETRMI (if so I would consider that a bug).

If you want your code to work, and be supported, use $getrmi, followed by $synch. I would use EFN$C_ENF as the event flag instead of the implicit use of EFN 0, and make certain the iosb isn't being shared by anything but the $GETRMI and $SYNCH, and is not an automatic variable allocated on the stack.

Good luck,

Jon
it depends
Mark Finn
New Member

Re: $GETRMI returning SS$_SUSPENDED

I was unable to write a minimal version of the program which reproduced the error, but I did find a machine on which I can run a test version of the software. I think either using $SYNCH or making sure the IOSB was unique to the $GETRMI call (or both) must have helped because I haven't received that error on the test machine for a couple days now. Thanks again.