vstinner/python-ptrace

Signals not correctly received

Closed this issue · 2 comments

Originally reported by: Anonymous


Hi,

I'm writing a tool that needs to catch when a process segfaults. For this purpose I'm using a code that ends up doing this:

    signal = process.waitSignals(11)
    print signal

However, even when the signal 11 (SIGSEGV) is received an exception is raised. This in an example changing the simple_dbg.py example to instead of wait for an event wait for a signal with the code previously mentioned:

Traceback (most recent call last):
  File "examples/simple_dbg.py", line 65, in <module>
    main()
  File "examples/simple_dbg.py", line 61, in main
    playWithProcess(process)
  File "examples/simple_dbg.py", line 15, in playWithProcess
    signal = process.waitSignals(11)
  File "/usr/local/lib/python2.7/dist-packages/python_ptrace-0.8-py2.7.egg/ptrace/debugger/process.py", line 726, in waitSignals
    return self.debugger.waitSignals(*signals, **{'pid': self.pid})
  File "/usr/local/lib/python2.7/dist-packages/python_ptrace-0.8-py2.7.egg/ptrace/debugger/debugger.py", line 192, in waitSignals
    raise event
ptrace.debugger.process_event.ProcessExit: Process 3691 killed by signal SIGSEGV

Am I missing something or doing something wrong?


Original comment by Victor Stinner (Bitbucket: haypo, GitHub: haypo):


If i cannot reproduce the issue, i cannot fix it. Sorry.

Original comment by Victor Stinner (Bitbucket: haypo, GitHub: haypo):


Sorry, I don't know how to reproduce your issue. Could you please provide a short Python script reproducing the issue?