Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 8928

Summary: getch() dumps core or returns 0 on SIGWINCH
Product: [Retired] Red Hat Linux Reporter: jsamuels
Component: ncursesAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-02-03 18:13:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jsamuels 2000-01-27 19:33:01 UTC
It seems when you have a program that uses curses getch(), then change
the size of your xterm, getch() returns 0 and not ERR (-1).  This only
happens some of the time.  Most of the time, the program will dump core
inside of the getch() call.  getch() is defined as wgetch(stdsrc).

---From gdb---
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libncurses.so.4...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
Reading symbols from /lib/libnss_files.so.2...done.
#0  0x40037067 in resizeterm ()
(gdb) bt
#0  0x40037067 in resizeterm ()
#1  0x4003d085 in _nc_update_screensize ()
#2  0x40033804 in doupdate ()
#3  0x4002f457 in wrefresh ()
#4  0x40032480 in _nc_synchook ()
#5  0x40027eca in wechochar ()
#6  0x4002b044 in wgetch ()
#7  0x804a2e4 in domenu ()
#8  0x804a045 in main ()
#9  0x4006ccb3 in __libc_start_main (main=0x8049e24 <main>, argc=1,
argv=0xbffffcf4, init=0x8048c58 <_init>,
    fini=0x804b0ec <_fini>, rtld_fini=0x4000a350 <_dl_fini>,
stack_end=0xbffffcec)
    at ../sysdeps/generic/libc-start.c:78
(gdb)


The returning of 0 doesn't appear to follow what the man page curs_getch.3x
says should happen when signals are sent.  Regardless, the function call
dumps core most of the time when a SIGWINCH is sent.

standard RedHat 6.0
egcs-1.1.2-12
glibc-2.1.1-6
ncurses-4.2-18

Comment 1 Bernhard Rosenkraenzer 2000-02-03 18:13:59 UTC
Try the current version (5.0-7) - there have been a lot of changes to SIGWINCH