Open lotheac opened 1 year ago
same on openSUSE Tumbleweed
notcurses 3.0.9 on XTerm 377 (Linux 6.1.7-1-default) 36 rows (21px) 127 cols (10px) 756x1270 rgb+256 colors gcc-12.2.1 20221020 [revision 0aaef83351473e8f4eb774f8f999bbe87a4866d7] (LE) terminfo 6.4.20230114 libdeflate 1.14 GPM n/a
(gdb) bt
0 __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0,
futex_word=0x556cd998c628) at futex-internal.c:57
1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x556cd998c628, expected=expected@entry=0,
clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87
2 0x00007f0b1694c08f in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x556cd998c628,
expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139
3 0x00007f0b1694ecd0 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x556cd998c5d8,
cond=0x556cd998c600) at pthread_cond_wait.c:503
4 ___pthread_cond_wait (cond=cond@entry=0x556cd998c600, mutex=mutex@entry=0x556cd998c5d8)
at pthread_cond_wait.c:618
5 0x00007f0b16b0f803 in inputlayer_get_responses (ictx=0x556cd9988550)
at /usr/src/debug/notcurses-3.0.9/src/lib/in.c:2800
6 handle_responses (kitty_graphics=
, draininput=0, cursor_x=0x7fff06329ef4, cursor_y=0x7fff06329ef8, tableused=0x7fff06329c50, tablelen=0x7fff06329c58, ti=0x556cd995e4a0) at /usr/src/debug/notcurses-3.0.9/src/lib/termdesc.c:1156
7 interrogate_terminfo (ti=
, out= , utf8=1, noaltscreen= , nocbreak=0, nonewfonts=0, cursor_y=0x7fff06329ef8, cursor_x=0x7fff06329ef4, stats=0x556cd995e230, lmargin=0, tmargin=0, rmargin=0, bmargin=0, draininput=0) at /usr/src/debug/notcurses-3.0.9/src/lib/termdesc.c:1431
8 0x00007f0b16aedcb2 in notcurses_core_init (opts=opts@entry=0x7fff0632a060, outfp=
, outfp@entry=0x0) at /usr/src/debug/notcurses-3.0.9/src/lib/notcurses.c:1257
9 0x00007f0b16b349e6 in notcurses_init (opts=opts@entry=0x7fff0632a060, outfp=outfp@entry=0x0)
at /usr/src/debug/notcurses-3.0.9/src/media/shim.c:13
10 0x0000556cd7aaa16b in main (argc=
, argv=0x7fff0632a518) at /usr/src/debug/notcurses-3.0.9/src/demo/demo.c:541
Can confirm, same experience here using Windows Terminal with WSL2. The hanging is spotty, but if I run the same executable in xterm, it does not happen. With gdb and backtrace, got the same output as @lnussel.
Hi, thanks for notcurses;
I'm seeing some hangs in notcurses initialization in terminfo interrogation phase. This doesn't happen every time, and using TRACE logging I'm unable to reproduce it, so I suspect it's a race condition.
Environment:
notcurses_init()
sometimes hangs, including eg. justnotcurses-info
. I was unable to reproduce withnotcurses-info -v
because apparently TRACE logging slows things down enough to avoid the problem: below logs are fromnotcurses-info -v
which has been modified to useNCLOGLEVEL_VERBOSE
(while still rare at this log level, I can hit it eventually). stderr redirected to file, so only stdout refers to the tty.thread backtraces:
NCLOGLEVEL_VERBOSE
output when the problem occurs:The input thread is working fine at this point: if I type something on stdin, I can see 1 byte reads in the log. But the other thread seems to be waiting for a condition that never happens.