Date: Fri, 23 Oct 2009 04:35:07 +0200 (CEST) From: Alexander Best <alexbestms@math.uni-muenster.de> To: <freebsd-hackers@FreeBSD.org> Subject: help needed to fix contrib/ee crash/exit when receiving SIGWINCH Message-ID: <permail-20091023023507f0889e8400001398-a_best01@message-id.uni-muenster.de>
next in thread | raw e-mail | index | archive | help
hi everyone, together with hugh mahon (the author of ee) i've been trying to fix a nasty bug in ee. for some reason ee exits (not crashes) and leaves the console corrupted when receiving SIGWINCH (`killall -SIGWINCH ee` should exit all running ee instances). unfortunately we were unable to find the problem. it seems to be related to ncurses. running the ee linux binary under freebsd causes no problem with SIGWINCH at all. since the linux binary doesn't need to be linked against ncurses (linux has termio.h/sgtty.h) we assume the problem is related to ncurses. right at the beginning of the ee code all signals get set to SIG_IGN: for (counter = 1; counter <= 32; counter++) signal(counter, SIG_IGN); so actually SIGWINCH shouldn't cause any problems since it gets discarded. looking through the src i'm quite sure that SIGWINCH stays set to SIG_IGN the whole time. yet running ee with truss shows this result when doing `grep WINCH`: sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) sigaction(SIGWINCH,{ SIG_IGN SA_RESTART ss_t },{ SIG_DFL 0x0 ss_t }) = 0 (0x0) sigaction(SIGWINCH,0x0,{ SIG_IGN SA_RESTART ss_t }) = 0 (0x0) sigaction(SIGWINCH,{ 0x280bc130 0x0 ss_t },0x0) = 0 (0x0) sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) so SIGWINCH doesn't stay set to SIG_IGN the whole time. it seems the problem is being caused by some ncurses function which gets called in contrib/ee/ee.c. contrib/ee/new_curse* aren't used since ee relies in freebsd's local ncurse implementation. it would be really great if this nasty bug could be fixed. you'll find a problem report here: http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/136223 please don't hesitate to ask for more details. cheers. alex
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?permail-20091023023507f0889e8400001398-a_best01>