bug-ncurses
[Top][All Lists]
Advanced

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

Re: Why getch blocked when I did type something?


From: Thomas Dickey
Subject: Re: Why getch blocked when I did type something?
Date: Wed, 17 Dec 2008 05:57:21 -0500 (EST)

On Wed, 17 Dec 2008, John Daker wrote:

Can gdb tell more info ?

it might, depending on what libraries you're using.

none of them have been compiled with debug-information.

such as where did it hang?
what is the address "0x420cdb44" stand for?

"read()" is in the C runtime library, for which you have no debug information. So gdb just tells you the address.




On Wed, Dec 17, 2008 at 7:48 AM, Thomas Dickey <address@hidden> wrote:
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-----




--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]