cancel
Showing results for 
Search instead for 
Did you mean: 

Delpen macro

Jthoma01
Occasional Contributor

Delpen macro

Anybody out there have a location or example of the delpen macro? This macro used to be on the DSN site. You have a process that is suspended. You pull a value out of SDA with an examine pcb command and insert into the macro. you run it and it resets the delpen bit and the subsequent stop/id kills the process and frees up all its resources. I've seen this work on dtr user processes hung on a database and tape drives hung.
12 REPLIES
Robert Brooks_1
Honored Contributor

Re: Delpen macro

What problem are you attempting to solve?

Simply clearing pcb$v_delpen is NOT sufficient to solve the problem I'm guessing you're faced with.


-- Rob (VMS Engineering)
John Gillings
Honored Contributor

Re: Delpen macro

News to me!

Interesting concept, I suppose the theory is the $DELPRC code path sees the DELPEN bit set and exits. By clearing the bit, you give $DELPRC a second chance to delete the process and hope it manages to work the second time.

Somewhat Microsoftian logic - keep repeating the same behaviour and hope for a different outcome (I think that's someone's definition of insanity ;-).

I've searched archives which should include all of what used to be in DSN and not found anything that looks like a match.

If you really want to try it (WARNING, one false step will crash your system), you want bit PCB$V_DELPEN in field PCB$L_STS. If you want to bypass all the proper operating system to find and synchronize access to the PCB, you can use SDA to determine the address of PCB$L_STS:

SDA> SET PROCESS/INDEX=process-index
SDA> READ SYSDEF
SDA> EVAL PDB+PCB$L_STS

Check if DELPEN is set (mask value is %X20), then write some MACRO code to dive into CMKRNL and clear it.

I'm deliberately NOT giving you actual code, because if you don't understand how to do it from that description, you really shouldn't be attempting it! Sorry.

Just a reminder - there are an infinite number of ways to crash your system while trying to do this kind of thing, and very small number of ways to get it right.

I agree with Bob that it's extremely unlikely that this method will succeed - if it worked, every support engineer on the planet would know about it, and there would be a SET PROCESS/NODELPEN command in DCL.
A crucible of informative mistakes
Volker Halle
Honored Contributor

Re: Delpen macro

Jthoma1,

welcome to the OpenVMS ITRC forum.

The process might not actually be in SUSP state (check with $ SHOW SYSTEM), but might be in process deletion/rundown, preventing certain utilities to obtain information from that process.

The process is most likely hung due to some un-finished IO-operation or resource problem. The 'OpenVMS way' would be to try to diagnose the situation to find what's preventing the process from being deleted. SDA is your friend. There is also the PWAIT$SDA SDA extension (see OpenVMS Freeware), which can help diagnose hung processes.

Once the situation is understood, it may be possible to clean up the process by satisfying the condition, it may be waiting for.

Volker.
Jthoma01
Occasional Contributor

Re: Delpen macro

Oh yes I'm aware of this kind of moving around between OpenVMS design intentions. Yes it seems like insanity that you try something and hope and keep doing the same thing. This macro came from mission critical support John Fischer. We used to get DTR users who would control/y out of their session because they would be walking the database and thought their process hung or whatever. After that I would get a lock on the db. I would attempt to stop/id the process and it would rwast. Now I've got a production system with a hung database and the only way to clear it is reboot. Sounds like Windows response. But the mission critical folks supplied us with this macro and the instructions and it worked every time without crashing. So somebody somewhere knew what in OpenVMS was hanging and knew what to provide to attempt to clear without a reboot. I have also used it with hung tape drives also. If a processes is hung due to a unfinished I/O then who wrote that code and did not use a timeout in the qiow call. At any rate since the sda commands you all have listed doesn't have the set proc/id= command followed by the examine pcb;100 then I will try and see if I can find John Fischer's new e-mail address and ask him. I may also have this on a tape. If so I will post it back so you can see. Thanks for the input
Ian Miller.
Honored Contributor

Re: Delpen macro

Very much depends on the state of the process as to if clearing the delete pending bit and trying again works.

It would be interesting to see this program.

It is best to investigate the current state of the process before doing STOP/ID. Parhaps you can post the result of
SDA> SHOW PROCESS/ID=x
____________________
Purely Personal Opinion
Volker Halle
Honored Contributor

Re: Delpen macro

If the intention is JUST the clearing of the DELPEN bit in PCB$L_STS of the offending process, this can 'easily' be done with DELTA:

You need the IPID (Internal PID) of the process:
SDA> SET PROC/IND=
SDA> SHOW PROC

and the S0 address of PCB+PCB$L_STS
SDA> READ SYSDEF
SDA> EVAL PCB+PCB$L_STS

and - of course - CMKRNL privilege

and good nerves, if you want to try this on a running system ;-)

WARNING: THIS CAN CRASH YOUR SYSTEM, if you make any mistakes while in DELTA in kernel mode. Try it on a test system first, to get used to the way DELTA behaves. DELTA is documented in the OpenVMS Delta/XDelta Debugger Manual.

$ RUN SYS$SHARE:DELTA
ipid;1M
pcb_sts_va/nnnnnnnn nnnnnnnx
exit
$

ipid is the 8-digit HEX IPID of the process
pcb_sts_va is the S0 address obtained with the above EVAL
nnnnnnnx is nnnnnnnn minus 2 (= PCB$L_STS with PCB$M_DELPEN = 2 cleared). Do NOT try this, if the DELPEN bit (=bit 1) is NOT set.

Volker.
David B Sneddon
Honored Contributor

Re: Delpen macro

A Google search of delpen +macro reveals the
following...

http://vmsone.com/~decuslib/vmssig/vms94a/dsj/mnowat.dsj

which seems to do what you describe.
You don't mention platform...

Dave
Ian Miller.
Honored Contributor

Re: Delpen macro

I understand what the referenced program does and it will work for some conditions but not all. It does say in the program that it can causes crashes.
____________________
Purely Personal Opinion
Richard J Maher
Trusted Contributor

Re: Delpen macro

Hi Ian,

>It does say in the program that it can >causes crashes.

and you feel the need to repeat that because?

I'm sure your sheriff's badge has already been shown, just wondering where the added value is?

Regards Richard Maher
Jthoma01
Occasional Contributor

Re: Delpen macro

The link Dean sent is an example of a macro that prompts for the pid and then does it for you. The one mission critical gave us looks very similar. I'm a little rusty on macro. But I think this will work. I APPRECIATE EVERYONES RESPONSE TO USE WITH CAUTION CAN CAUSE CRASH. You never know what level of technical ability you will be giving responses to the person requesting. I have seen jr. systems people do these kind of things without thinking of the ramifications. But I know better. I will still post the example from mission critical once I can get some time to get it off one of my tapes.

The one difference is that again the mission critical macro you had to go into SDA and get the pcb;100 value and plug into the macro. But again they probably used this one as a base and tweaked it specifically for DTR users.

thanks
Volker Halle
Honored Contributor

Re: Delpen macro


The one difference is that again the mission critical macro you had to go into SDA and get the pcb;100 value and plug into the macro


SDA> SET PROC/IND=
SDA> EXA pcb;100

will just dump the first 64. longword of the PCB. Maybe this was just used to obtain the PCB address (the last quadword on the first line displayed).

The macro program MNOWAIT referenced above obtains this address with the EXE$NAMPID internal system routine from the PID.

Volker.
Jan van den Ende
Honored Contributor

Re: Delpen macro

I tried to enter this yesterday evening (Europe), but ITRC was fully dead till after bed-time.


Jthoma01, Volker:

THANKS a lot for adding another tool to my box!

Like you, we sometimes have processes that hang on to locks they should no longer hold, and refuse to be deleted bacause they wait for something that we know will never happen.
Reboot was the ultimate solution, but this tool slices another bit from that ugly lump.

And yes, I know the disclaimers about DELTA.
In a former life on ICL DME we also had a memory inspection-and-manipulation program. As a permanent warning, that program was named DYNAMITE and had to be LOADed from the BWAMM library. Talk about descriptive names!

Again:
MANY thanks. I hope to have little need for it, but WHEN, then I 'll remember you!

Proost.

Have one on me (maybe at the Bootcamp in Nashua?)

jpe


Don't rust yours pelled jacker to fine doll missed aches.