On Tue, Dec 16, 2008 at 02:42:33PM +0800, John Daker wrote:
Hi,all
I recently had a problem that my program hang while I type something.
First I thought it is blocked in read() from the tty, but it happens
after I use select and set O_NONBLOCK .
ncurses might be using select() to do timeouts - but assuming your
application's running all in the same thread, that shouldn't be
a conflict.
And finally I realize that it is blocked in read() from getch() after
I gdb attach the process:
...
(gdb) bt
#0 0x420cdb44 in read () from /lib/i686/libc.so.6
#1 0x4006cb44 in __JCR_LIST__ () from /lib/i686/libpthread.so.0
I do see you're using pthread though.
#2 0x4002db88 in kgetch () from /usr/lib/libncurses.so.5
#3 0x4002d335 in _nc_wgetch () from /usr/lib/libncurses.so.5
#4 0x4002d8b8 in wgetch () from /usr/lib/libncurses.so.5
#5 0x0804ba67 in main (argc=3, argv=0xbffffa54) at sitas.c:754
#6 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6
(gdb) q
I do type something but the program hang there, does anybody know why?
Or maybe a bug of ncurses?
without a sample program, it's hard to guess.
kgetch is trying to fill in the rest of the characters for a match
against the function keys, etc.
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAklIPl8ACgkQcCNT4PfkjtscQgCgu67QLCwNHaRvVGGePt8LMcyx
9asAnjpDkS6NBb47LuLVCPlcF/FOS3Ff
=OTyV
-----END PGP SIGNATURE-----