ytrstu / winpdb

Automatically exported from code.google.com/p/winpdb
0 stars 0 forks source link

Error debugging a 'fork' code #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Debug a fork code like this:
            CanFork = hasattr(os, 'fork')
            if CanFork:
                Pid = os.fork()
            else:
                Pid = 1
            if Pid == 0:
                Log("Child process","")
                while 1:
                    Data = ClientSocket.recv(1024)
                    print Data
                    ClientSocket.send(Data)
                    if not Data:
                        break

                Log("Child process completed","")
                time.sleep(20)  # pause to avoid file truncation in closure
                ClientSocket.close()
                os._exit(0)

            else: # We are in the parent
                Log("Parent process","")

            ClientSocket.close()
2. type on command console: fork child 

What is the expected output? What do you see instead?

I expect to set breakpoints in the child process but instead I have the error:
Exception in thread __worker_target:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
    self.run()
  File "/usr/share/pyshared/rpdb2.py", line 4570, in run
    threading.Thread.run(self)
  File "/usr/lib/python2.6/threading.py", line 477, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/share/pyshared/rpdb2.py", line 9357, in __worker_target
    self.m_lock.release()
  File "/usr/lib/python2.6/threading.py", line 136, in release
    raise RuntimeError("cannot release un-aquired lock")
RuntimeError: cannot release un-aquired lock

What version of the product are you using? On what operating system?
Winpdb 1.4.6 Tychod - UBUNTU

Please provide any additional information below.
I cannot insert any breakpoint in the child process.

Original issue reported on code.google.com by marco.cl...@telit.com on 25 Feb 2010 at 1:48