tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Workaround for Suspended (tty output) in python?



Can you:

1. put `INSTALL_UNSTRIPPED= yes' and `CFLAGS+= -g -O2' in mk.conf,
2. make sure to rebuild python and check for debug data with readelf/gdb,
3. attach gdb to the python process when it happens next, and
4. get a stack trace?


#0  0x000070df4cd7f0da in ioctl () from /usr/lib/libc.so.12
#1  0x000070df3721e3c8 in rltty_set_default_bindings () from /usr/local/lib/libreadline.so.8
#2  0x000070df37218912 in rl_initialize () from /usr/local/lib/libreadline.so.8
#3  0x000070df37604cab in setup_readline (mod_state=0x70df4c0d9430)
    at ./Modules/readline.c:1306
#4  PyInit_readline () at ./Modules/readline.c:1519
#5  0x000070df4e865317 in _PyImport_LoadDynamicModuleWithSpec (spec=spec@entry=0x70df4c0d9090,
    fp=fp@entry=0x0) at ./Python/importdl.c:169
#6  0x000070df4e862484 in _imp_create_dynamic_impl (module=<optimized out>, file=0x0,
    spec=0x70df4c0d9090) at Python/import.c:3775
#7  _imp_create_dynamic (module=<optimized out>, args=<optimized out>, nargs=<optimized out>)
    at Python/clinic/import.c.h:506
#8  0x000070df4e798d32 in cfunction_vectorcall_FASTCALL (func=0x70df4e529110,
    args=0x70df4d905ec8, nargsf=1, kwnames=0x0) at Objects/methodobject.c:422
#9  0x000070df4e90f621 in _PyEval_EvalFrameDefault (tstate=<optimized out>,
    frame=<optimized out>, throwflag=<optimized out>) at Python/bytecodes.c:3254
#10 0x000070df4e832e80 in PyEval_EvalCode (co=co@entry=0x70df4e47b400,
    globals=globals@entry=0x70df4e45d790, locals=locals@entry=0x70df4e45d790)
    at Python/ceval.c:578
#11 0x000070df4e882916 in run_eval_code_obj (
    tstate=tstate@entry=0x70df4ed67680 <_PyRuntime+459584>, co=co@entry=0x70df4e47b400,
    globals=globals@entry=0x70df4e45d790, locals=locals@entry=0x70df4e45d790)
    at Python/pythonrun.c:1691
#12 0x000070df4e882a19 in run_mod (mod=mod@entry=0x70df4e175cd8,
    filename=filename@entry=0x70df4e5f1f00, globals=globals@entry=0x70df4e45d790,
    locals=locals@entry=0x70df4e45d790, flags=flags@entry=0x7f7fff8d3a30,
    arena=arena@entry=0x70df4ee66020) at Python/pythonrun.c:1712
#13 0x000070df4e882b0c in pyrun_file (fp=fp@entry=0x70df4d1e8dc0,
    filename=filename@entry=0x70df4e5f1f00, start=start@entry=257,
    globals=globals@entry=0x70df4e45d790, locals=locals@entry=0x70df4e45d790, closeit=closeit@entry=1, flags=flags@entry=0x7f7fff8d3a30) at Python/pythonrun.c:1612
#14 0x000070df4e8856c6 in _PyRun_SimpleFileObject (fp=fp@entry=0x70df4d1e8dc0, filename=filename@entry=0x70df4e5f1f00, closeit=closeit@entry=1, flags=flags@entry=0x7f7fff8d3a30) at Python/pythonrun.c:433
#15 0x000070df4e885cc6 in _PyRun_AnyFileObject (fp=fp@entry=0x70df4d1e8dc0, filename=filename@entry=0x70df4e5f1f00, closeit=closeit@entry=1, flags=flags@entry=0x7f7fff8d3a30) at Python/pythonrun.c:78
#16 0x000070df4e8a7320 in pymain_run_file_obj (skip_source_first_line=0, filename=0x70df4e5f1f00, program_name=0x70df4e45d8c0) at Modules/main.c:360
#17 pymain_run_file (config=0x70df4ed0a260 <_PyRuntime+77600>) at Modules/main.c:379
#18 pymain_run_python (exitcode=0x7f7fff8d3a00) at Modules/main.c:629
#19 Py_RunMain () at Modules/main.c:709
#20 0x000070df4e8a77b8 in pymain_main (args=args@entry=0x7f7fff8d3b40) at Modules/main.c:739
#21 0x000070df4e8a78a2 in Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:763
#22 0x000000018b200a9d in ___start ()
#23 0x00007f7e9920baf8 in ?? () from /usr/libexec/ld.elf_so
#24 0x0000000000000003 in ?? ()
#25 0x00007f7fff8d4490 in ?? ()
#26 0x00007f7fff8d4499 in ?? ()
#27 0x00007f7fff8d449c in ?? ()
#28 0x0000000000000000 in ?? ()


So it seems this because there's no signal handler. Throwing in a random signal (SIGTTOU, SIG_IGN); after rl_initialize(); in Python-3.12.1/Modules/readline.c seems to have helped, but I have no idea where this properly should go.

Any ideas?

Thanks!
John


Home | Main Index | Thread Index | Old Index