control-c and threads, signals in 2.3 causing all sorts of issues

S

Srikanth Mandava

Hi!

When a signal handler is registered in the main thread and
"control-c" is entered, the child thread is getting the
KeyboardInterrupt exception(The documentation says the main thread
MUST receive the signal handler function call if handler is
registered).

In python 2.2.1 the main thread was always called with
the sigint signal handler which was registered. In my case the
child thread is waiting on stdin using "raw_input" function. This
seems to be causing all sorts of strange behavior in the program
once the child thread gets the keyboardinterrupt exception and
eventually leading to seg fault on a sys exit .

Any idea why this is happening in 2.3.1? This scenario worked in
2.2.1. Is this fixed in 2.3.2?.


Thanks
Srikanth
 
M

Michael Hudson

Srikanth Mandava said:
Hi!

When a signal handler is registered in the main thread and
"control-c" is entered, the child thread is getting the
KeyboardInterrupt exception(The documentation says the main thread
MUST receive the signal handler function call if handler is
registered).

Hmm. Threads + signals == mwh running off screaming...
In python 2.2.1 the main thread was always called with
the sigint signal handler which was registered. In my case the
child thread is waiting on stdin using "raw_input" function. This
seems to be causing all sorts of strange behavior in the program
once the child thread gets the keyboardinterrupt exception and
eventually leading to seg fault on a sys exit .

Oh oh, if you're using raw_input(), readline might be getting
involved...
Any idea why this is happening in 2.3.1? This scenario worked in
2.2.1. Is this fixed in 2.3.2?.

Is this thread relavent?

http://groups.google.com/[email protected]

OS, libc and versions of same might be useful, too.

Cheers,
mwh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top