Oolite Bulletins
http://www.aegidian.org/bb/

Black magic nasty behaviour...
http://www.aegidian.org/bb/viewtopic.php?f=9&t=6445
Page 1 of 1

Author:  saint [ Tue Aug 04, 2009 6:46 am ]
Post subject:  Black magic nasty behaviour...

I found by change a black magic nasty behaviour.

Background information:

I sometimes need to stop oolite without closing the program (pause still eats CPU), I usually start oolite from the WindowMaker menu so I can't type ^Z and suspend it.

I tried to use STOP and CONT signals: first a grep on ps output to find the oolite pid, then a 'kill -s(STOP|CONT)' to that process to stop/restart the program.

Since I am lazy, I decided to write this small script
Code:
#!/bin/sh

kill -s STOP `ps -fu $LOGNAME | grep oolite | grep -v grep | awk '{ print $2 }'`
with a dual script that sends the CONT signal. Yes, I know, I should have written a single script either checking $0 or accepting an option for start and stop. But that's not the point.

The point is that it seems that there's a lock somewhere that cause oolite and X11 to deadlock. I thought it was due oolite log going to the console, but got the freeze with an oolite instance launched from the terminal.

The black magic is that if I find the pid with a grep
Code:
ps -fu saint | grep oolite
and then I type
Code:
kill -s STOP /the pid I got with the previous command/
everything works fine....

Author:  zevans [ Tue Aug 04, 2009 3:47 pm ]
Post subject: 

Hm, in case there's something strange with using backquotes... have you tried using
Code:
killall -S STOP oolite
instead of the grep and awk?

Author:  saint [ Thu Aug 06, 2009 9:06 am ]
Post subject: 

Quote:
Hm, in case there's something strange with using backquotes... have you tried using
Code:
killall -S STOP oolite
instead of the grep and awk?
Not killall, but pkill yes, and does not freeze. BLACK MAGIC???!!!
Nope. If I substitute 'kill' with /bin/kill and DO NOT attempt to log kill execution, it does not freeze. If I try to log /bin/kill execution with something like >> file 2>>&1 ... freeze

pkill does not suffer of this problem. And that's enought for me, I have no resource to investigate this interesting magic anymore :(. Maybe in the forthcoming holidays...

Author:  zevans [ Thu Aug 06, 2009 1:33 pm ]
Post subject: 

Maybe something wants input and stops because it isn't on an interactive session?

Author:  saint [ Thu Aug 06, 2009 1:42 pm ]
Post subject: 

Sounds more a deadlock. If I send a sigkill or sigcont to oolite (that is: if I kill the program or send it the "continue processing" signal) X11 unfreezes.

When i say that it freezes I mean that It does not listen to event, the mouse fozen on its tracks, and freezes all output, i.e. the little animations in the dock freeze still.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/