[Python-bugs-list] [Bug #119772] Interactive InterPreter+ Thread -> core dump at exit

noreply@sourceforge.net noreply@sourceforge.net
Thu, 18 Jan 2001 19:38:28 -0800


Bug #119772, was updated on 2000-Oct-30 08:28
Here is a current snapshot of the bug.

Project: Python
Category: Threads
Status: Open
Resolution: None
Bug Group: None
Priority: 4
Submitted by: imbunche
Assigned to : gvanrossum
Summary: Interactive InterPreter+ Thread -> core dump at exit

Details: The following code executes a thread that prints a message every
second while the main thread shows a python shell. 
It will run fine and if one leaves the interpreter with <Ctrl-D> python
will exit cleanly.
However if one press <Ctrl-C> to kill the interactive interpreter and then
exits python or press return a couple of time you get a core dump.

My platform is:
   HP-UX te35 B.11.00 A 9000/785 2015352223 two-user license

I am running Python 2.0
This is the code of the test program:

#!/usr/local/bin/python
import time, threading, whrandom, code, sys

class MyThread(threading.Thread):
    """ reports once per second
    """
    def run(self):
        while 1:
            print "alive ...."
            time.sleep(1)
        print self.getName(), "is DONE"


if __name__ == '__main__':
    threadList = []

    # Create MyThread() threads
    t = MyThread()
    t.setDaemon(1)
    t.start()

    # This is the main thread ... since there is only one other
    # thread and it is a 'daemon', killing the main thread kills
    # the whole thing.
    locals = sys.modules['__main__'].__dict__
    code.interact(locals)

Follow-Ups:

Date: 2000-Oct-30 08:47
By: jhylton

Comment:
I can reproduce this on RH Linux, but not running Python under gdb.

-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=119772&group_id=5470