khamidou / lptrace

Trace any Python program, anywhere!
http://khamidou.com/lptrace/
GNU General Public License v3.0
699 stars 43 forks source link

lptrace hangs with no error if gdb is missing #17

Open jseakle opened 3 years ago

jseakle commented 3 years ago

I figured this out by inspecting the err result of p.communicate() on line 86. It would be nice if that were printed :)

jseakle commented 3 years ago

possibly relatedly, after installing gdb, i got these values for out and err:

b'\nwarning: Mach error at "../../gdb/i386-darwin-nat.c:132" in function "virtual void i386_darwin_nat_target::fetch_registers(struct regcache *, int)": (os/kern) invalid argument (0x4)\n\nwarning: `/private/var/folders/p2/mzyz9fln4bv4c9n1j14cjg6c0000gq/T/python-build.20210310234049.4038/Python-3.7.9/Programs/python.o\': can\'t open to read symbols: No such file or directory.\n\nwarning: Could not open OSO archive file "/private/var/folders/p2/mzyz9fln4bv4c9n1j14cjg6c0000gq/T/python-build.20210310234049.4038/Python-3.7.9/libpython3.7m.a"\n\nwarning: `/private/var/folders/p2/mzyz9fln4bv4c9n1j14cjg6c0000gq/T/python-build.20210310234049.4038/Python-3.7.9/build/temp.macosx-10.12-x86_64-3.7/private/var/folders/p2/mzyz9fln4bv4c9n1j14cjg6c0000gq/T/python-build.20210310234049.4038/Python-3.7.9/Modules/_heapqmodule.o\': can\'t open to read symbols: No such file or directory.\n\'PyGILState_Ensure\' has unknown return type; cast the call to its declared return type\n\'PyRun_SimpleString\' has unknown return type; cast the call to its declared return type\nHistory has not yet reached $1.\n'
(Pdb) out
b'[New Thread 0x1d03 of process 95516]\nError calling thread_get_state for GP registers for thread 0x1d03\n0x000000010ddf6afd in function_code_fastcall ()\n'

however, this is in the version patched to work with python3, and running on macos 10.12.2, so i'm not too optimistic that anyone will be able to help with this :P

khamidou commented 2 years ago

Hey @jseakle sorry for the delay – I don't really maintain this anymore. Re: the gdb issue, could it be related to the fact that system integrity protection prevents GDB from actually running? What does csrutil status say?