On 1/20/17 1:07 PM, Frédéric Brière wrote:
> [ I don't have much experience with either readline or signals, so ]
> [ please forgive any ignorance (or stupidity) on my part.  :)      ]
> 
> 
> readline 7.0 is causing a bug[*] in Twinkle, where we are normally
> blocking SIGALRM in all threads, with one thread dedicated to calling
> sigwait().  Upon calling readline(), SIGALRM now apparently becomes
> unblocked (or caught and rethrown, I guess), resulting in the program
> aborting.  This was not the case with 6.3.

It's readline-7.0 using pselect to allow read() to be interrupted by
signals that don't usually interrupt it (e.g., SIGWINCH).  Since
readline only modifies the signal mask temporarily while installing
signal handlers, here's a one-line patch that will allow this to work.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://cnswww.cns.cwru.edu/~chet/
*** ../readline-7.0-patched/input.c	2016-08-30 10:21:47.000000000 -0400
--- input.c	2017-01-23 10:21:56.000000000 -0500
***************
*** 514,517 ****
--- 514,518 ----
  #if defined (HAVE_PSELECT)
        sigemptyset (&empty_set);
+       sigprocmask (SIG_BLOCK, (sigset_t *)NULL, &empty_set);
        FD_ZERO (&readfds);
        FD_SET (fileno (stream), &readfds);
_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to