Operating System - OpenVMS
1752567 Members
5528 Online
108788 Solutions
New Discussion юеВ

Re: LOGOUT puts 2 processes in infinite loops

 
Jess Goodman
Esteemed Contributor

Re: LOGOUT puts 2 processes in infinite loops

Sorry, accidentally posted old version of code. Here's the new version, although both work.
I have one, but it's personal.
Jur van der Burg
Respected Contributor

Re: LOGOUT puts 2 processes in infinite loops

Watch out with this code. It references memory at ipl 8 without locking it, and it never unlocks the spinlock in the error path! In other words, it could crash your system.

Besides that, you really have to know what you're doing when clearing this bit in the pcb. There might be a good reason that it's disabled.

Jur.
Jess Goodman
Esteemed Contributor

Re: LOGOUT puts 2 processes in infinite loops

Ok, thaks for the tip. A new version of my code is attached. I don't normally bother with locking down one page of high IPL code (I like working without a net. What are the odds?) But since I did release this code I have been a good boy and followed the rules in this latest version. I also fixed the problem in my error return path.

The bit I'm clearing is the process delete-pending bit. The reason the bit is set is because the process was supposed to be killed via LOGOUT, STOP/ID, etc. But if you're running this program that obviously didn't happen for some reason. Clearing the DELPEN bit lets you get some control of the process back.

Of course like any kernel mode hack a crash is possible, but since in most cases when you might want to use this program the alternative is a reboot (or as recommended above, forcing a crash dump) that may not really be a downside.
I have one, but it's personal.
Dean McGorrill
Valued Contributor

Re: LOGOUT puts 2 processes in infinite loops

jess,
maybe you need the iolock8 spinlock.
anyway keep the versions coming, I keep
grabbing them, I like tools like that.
at least you have the processes quiet.
actually if you got that process to
crash the system, the footprint might be
useful for the tcpip folks. Dean
Jess Goodman
Esteemed Contributor

Re: LOGOUT puts 2 processes in infinite loops

Since you asked...here comes another version.

Minor fix so the locked-down code doesn't reference an unlocked longword of data.
I have one, but it's personal.
Jur van der Burg
Respected Contributor

Re: LOGOUT puts 2 processes in infinite loops

That's better. You need sched to synchronize, and not iolock8 as mentioned before so your code is correct.

One small nit: the conditionals do '.IF DF ALPHA' meaning that if you ever want to run this on Itanium the VAX path will be chosen. It's better to distinguish between 'VAX' and 'Others', like .IF DF VAX because Alpha and Itanium are (most of the times) the same.

Jur.
Jess Goodman
Esteemed Contributor

Re: LOGOUT puts 2 processes in infinite loops

Yes, I know that that usually works. But since in this case I did not know if any other changes were necessary for Itanium (thought there might be differences in how pages are locked) I decided not to do it so that it didn't look like I was saying that my code was Itanium ready.

Can I just reverse the R31 test to NE to define VAX, use .IF NDF VAX and the code will work on all 3 architectures?
I have one, but it's personal.
Dean McGorrill
Valued Contributor

Re: LOGOUT puts 2 processes in infinite loops

Jess,
is this reproducable, have you
reconnected and logged out again? I tried
reproducing here, aborting powerterm etc. no problems.
Jess Goodman
Esteemed Contributor

Re: LOGOUT puts 2 processes in infinite loops

I've been using PowerTerm for years and I think this problem only happened once before. What was really weird is that it happened to two of my sessions at once. I probably had 8 going when I logged them all out.
I have one, but it's personal.
Dean McGorrill
Valued Contributor

Re: LOGOUT puts 2 processes in infinite loops

interesting, maybe try killing 8
again, I will try it. is your system
a single cpu? It would be nice to
be able to reproduce. I worked with the
guys in tcpip, and know they'd like
to see and fix this..