bug-ncurses
[Top][All Lists]
Advanced

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

Re: core dump in torture test


From: Lucas Gonze
Subject: Re: core dump in torture test
Date: Sun, 20 Oct 2002 12:50:05 -0400 (EDT)

To resolve this issue, I'm going to plant a note for future devs in the
bug-ncurses archives via this email.

CDK is known to fail if invoked through a signal handler; specifically,
through a SIGCHLD handler.  So rather than handling window resizes 
asynchronously, as in this example:

void winchange_handler(int signo){

  signal(SIGCHLD, SIG_IGN);
  if( victim == NULL )
    // not initialized yet, so there's no window to change
    return;

  victim->recalc_window();
  signal(SIGWINCH, winchange_handler);
}

You should handle window resizes synchronously, as in this example:

  void wait_for_any_key(){

    while(true){
      switch( wgetch (cursesWin) ){
      case KEY_RESIZE:
        recalc_window();
        break;
      default:
        return;
      }
    }
  }


- Lucas






reply via email to

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