Hi. Does anyone use python debugger with tvm? I got a segfault every time I’m trying to enter the trace mode. For example, I see the segfault in the program below. If one comments import tvm out and restarts ipython, segfault goes away.
import pdb
import tvm
def test():
x=1+3
pdb.set_trace()
return x
...
Thread 1 "python3.6" received signal SIGSEGV, Segmentation fault.
0x0000000000579b80 in PyModule_GetState ()
(gdb) bt
#0 0x0000000000579b80 in PyModule_GetState ()
#1 0x00007f43ba9fc67e in ?? () from /usr/lib/python3.6/lib-dynload/readline.cpython-36m-x86_64-linux-gnu.so
#2 0x00007f43c21ec3e1 in rl_initialize () from /usr/lib/x86_64-linux-gnu/libedit.so.2
#3 0x00007f43ba9fc485 in PyInit_readline () from /usr/lib/python3.6/lib-dynload/readline.cpython-36m-x86_64-linux-gnu.so
#4 0x0000000000604ea7 in _PyImport_LoadDynamicModuleWithSpec ()
#5 0x0000000000605f66 in ?? ()
#6 0x00000000005871a0 in PyCFunction_Call ()
#7 0x000000000054840c in _PyEval_EvalFrameDefault ()
#8 0x00000000005414d0 in ?? ()
#9 0x0000000000539912 in ?? ()
Unfortunately, __import__('IPython').core.debugger.Pdb(color_scheme='Linux').set_trace() fails when loading readline as well, even though the documentation says
Modified from the standard pdb.Pdb class to avoid including readline, so that the command line completion of other programs which include this isn’t damaged.
I’ve tried other core.debugger and terminal.debugger classes, all of them have the same problem.
I’d like to bump this. This is a real pain as someone who develops on Ubuntu. I’ll try to dig into it if I ever have time, but if anyone has any ideas, please let me know!
Glad this is getting some activity. I work on a Mac now, and don’t encounter this issue anymore, but I still would love to see it resolved for all of our Linux devs out there.
This is significant. Without this fix, a large part of the Rust bindings won’t work (specifically, actually compiling and running code from Rust won’t work!)
I’m not sure if this is known already, or where it would be good to document this fact. cc @jroesch
Sorry to bump an old thread, but this seems important enough to mention. THANK YOU SO MUCH @junrushao !!! Great sleuthing on this