[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
newlispfanclub.alh.net • View topic - -http mode exit doesn't exit

-http mode exit doesn't exit

Q&A's, tips, howto's

-http mode exit doesn't exit

Postby ralph.ronnquist » Fri Mar 13, 2015 11:53 pm

ralph.ronnquist
 
Posts: 216
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: -http mode exit doesn't exit

Postby Lutz » Sat Mar 14, 2015 1:37 pm

Lutz
 
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: -http mode exit doesn't exit

Postby ralph.ronnquist » Sun Mar 15, 2015 12:46 am

Fair enough. exit is supposed to mean "exit the session" rather than "exit the program". Maybe I should read the manual sometimes ;-)

Then I suppose something needs to be done about fileno crashing on IOchannel==0, which sometimes exits the program anyhow with core dump or continues after signaling memory corruption error etc.

The destroy option is good. Though it kills via a new signal, so I'll probably go for importing the "raw" exit instead, as it really is far too easy to grumble about.
ralph.ronnquist
 
Posts: 216
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: -http mode exit doesn't exit

Postby ralph.ronnquist » Sun Mar 15, 2015 2:03 am

Actually, crashing only seems to happen without open connection.

Calling exit with a connection open closes the connection and doesn't crash.

But it then also stops invoking the handler (the low level signal_handler is no longer invoked). This would be because signal_handler doesn't return, which leaves the signal in blocked state. Maybe the signal setup should use sigaction rather than signal, and set up the handling with a SA_NODEFER flag, which avoids that blocking?

Thus:
1) signal handling calling exit without open connection leads to crash, and
2) signal handling calling exit with open connection makes the signal subsequently blocked.

Basically, calling exit in a signal handler for a daemon mode script is a bad idea. I suppose calling reset in a signal handler would be a problem regardless of mode.
ralph.ronnquist
 
Posts: 216
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 2 guests

cron