snare / voltron

A hacky debugger UI for hackers
MIT License
6.18k stars 414 forks source link

Gdb hang #232

Open skirge opened 6 years ago

skirge commented 6 years ago

Gdb hangs after a file is loaded and run. OS is Kali Linux with Gdb linked with Python3.6 (Ubuntu with Gdb and Python 3.5 is fine). Voltron installed from GIT.

py-bt shows:

0x00007f653b6ebd76 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x555661a625f0) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
205 ../sysdeps/unix/sysv/linux/futex-internal.h: No such file or directory.
(gdb) py-bt
Traceback (most recent call first):
  <built-in method acquire of _thread.lock object at remote 0x7f6533d180a8>
  File "/usr/lib/python3.6/threading.py", line 295, in wait
    waiter.acquire()
  File "/usr/lib/python3.6/queue.py", line 164, in get
    self.not_empty.wait()
  File "/home/xxxx/.local/lib/python3.6/site-packages/voltron/plugins/debugger/dbg_gdb.py", line 49, in inner
    res = q.get()
  File "/home/xxxx/.local/lib/python3.6/site-packages/voltron/dbg.py", line 40, in inner
    return func(self, *args, **kwargs)
  File "/home/xxxx/.local/lib/python3.6/site-packages/voltron/dbg.py", line 66, in inner
    return func(self, *args, **kwargs)
  File "/home/xxxx/.local/lib/python3.6/site-packages/voltron/plugins/api/registers.py", line 38, in dispatch
    regs = voltron.debugger.registers(target_id=self.target_id, thread_id=self.thread_id, registers=self.registers)
  File "/home/xxxx/.local/lib/python3.6/site-packages/voltron/api.py", line 135, in inner
    return func(*args, **kwargs)
  File "/home/xxxx/.local/lib/python3.6/site-packages/voltron/core.py", line 295, in dispatch_request
    res = req.dispatch()
  File "/home/xxxx/.local/lib/python3.6/site-packages/voltron/core.py", line 275, in dispatch_queue
    req.response = self.dispatch_request(req)
  File "/home/xxxx/.local/lib/python3.6/site-packages/voltron/plugins/debugger/dbg_gdb.py", line 693, in stop_handler
    voltron.server.dispatch_queue()
(gdb) py-list 
 290            self._waiters.append(waiter)
 291            saved_state = self._release_save()
 292            gotit = False
 293            try:    # restore state no matter what (e.g., KeyboardInterrupt)
 294                if timeout is None:
>295                    waiter.acquire()
 296                    gotit = True
 297                else:
 298                    if timeout > 0:
 299                        gotit = waiter.acquire(True, timeout)
 300                    else:
(gdb) py-up
#10 Frame 0x55566185cbb8, for file /usr/lib/python3.6/threading.py, line 295, in wait (self=<Condition(_lock=<_thread.lock at remote 0x7f6533d3cf30>, acquire=<built-in method acquire of _thread.lock object at remote 0x7f6533d3cf30>, release=<built-in method release of _thread.lock object at remote 0x7f6533d3cf30>, _waiters=<collections.deque at remote 0x7f6533d368d0>) at remote 0x7f6533d59128>, timeout=None, waiter=<_thread.lock at remote 0x7f6533d180a8>, saved_state=None, gotit=False)
    waiter.acquire()
(gdb) py-up
#14 Frame 0x7f6528009318, for file /usr/lib/python3.6/queue.py, line 164, in get (self=<Queue(maxsize=0, queue=<collections.deque at remote 0x7f6533d36868>, mutex=<_thread.lock at remote 0x7f6533d3cf30>, not_empty=<Condition(_lock=<_thread.lock at remote 0x7f6533d3cf30>, acquire=<built-in method acquire of _thread.lock object at remote 0x7f6533d3cf30>, release=<built-in method release of _thread.lock object at remote 0x7f6533d3cf30>, _waiters=<collections.deque at remote 0x7f6533d368d0>) at remote 0x7f6533d59128>, not_full=<Condition(_lock=<_thread.lock at remote 0x7f6533d3cf30>, acquire=<built-in method acquire of _thread.lock object at remote 0x7f6533d3cf30>, release=<built-in method release of _thread.lock object at remote 0x7f6533d3cf30>, _waiters=<collections.deque at remote 0x7f6533d36938>) at remote 0x7f6533d027f0>, all_tasks_done=<Condition(_lock=<_thread.lock at remote 0x7f6533d3cf30>, acquire=<built-in method acquire of _thread.lock object at remote 0x7f6533d3cf30>, release=<built-in method release of _...(truncated)
    self.not_empty.wait()
(gdb) py-up
#18 Frame 0x7f65280088d8, for file /home/xxxx/.local/lib/python3.6/site-packages/voltron/plugins/debugger/dbg_gdb.py, line 49, in inner (Invocation=<type at remote 0x555661e9d5d8>)
    res = q.get()
(gdb) py-list 
  44                    # post this invocation to be called on the main thread at the next opportunity
  45                    gdb.post_event(Invocation())
  46    
  47                    # now we wait until there's something in the queue, which indicates that the invocation has run and return
  48                    # the result that was pushed onto the queue by the invocation
 >49                    res = q.get()
  50    
  51                    # if we got an exception back from the posted event, raise it
  52                    if isinstance(res, Exception):
  53                        raise res
  54    
igormorgado commented 4 years ago

no answer, probably project was abandoned.

zcutlip commented 4 years ago

Patches accepted