unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Rob Browning <rlb@defaultvalue.org>
Cc: 21424@debbugs.gnu.org,
	Panu Kalliokoski <panu.kalliokoski@gmail.com>,
	685919@bugs.debian.org, 685919-forwarded@bugs.debian.org
Subject: bug#21424: Bug#685919: guile-1.6: SIGALRM signal handler does not get called when guile blocks on I/O
Date: Fri, 24 Jun 2016 11:17:33 +0200	[thread overview]
Message-ID: <87y45veyj6.fsf@pobox.com> (raw)
In-Reply-To: <87vbbnv53g.fsf@trouble.defaultvalue.org> (Rob Browning's message of "Sun, 06 Sep 2015 12:18:43 -0500")

It does seem clear that we have a bug here; evidently signals do not
wake up the reader, neither with readline nor without.

Andy

On Sun 06 Sep 2015 19:18, Rob Browning <rlb@defaultvalue.org> writes:

> [If possible, please preserve the -forwarded address in any replies.]
>
> Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=765497
>
> Panu Kalliokoski <panu.kalliokoski@gmail.com> writes:
>
>> While playing with guile on my system, I discovered a weird anomaly
>> which I could not reproduce on other systems running guile.  If I
>> install a signal handler for SIGALRM, it won't get called while guile is
>> making an I/O system call.  To demonstrate:
>>
>> [atehwa@karaihin ~/proj/psyk]$ guile
>> guile> (alarm 2)
>> 0
>> guile> Herätyskello
>> [atehwa@karaihin ~/proj/psyk]$ guile
>> guile> (sigaction SIGALRM (lambda (x) (display "now!") (newline)))
>> (0 . 335544320)
>> guile> (alarm 2)
>> 0
>> guile> now a lot more than two seconds has passed, while I wrote this
>> now!
>> <unnamed port>: In expression now:
>> <unnamed port>: Unbound variable: now
>> ABORT: (unbound-variable)
>> [...]
>>
>> As you can see, the signal handler gets called as soon as guile returns
>> from read(2), already before calling (eval).
>>
>> I can't get to understand what causes this on my system, because another
>> Debian system with exact same versions of guile-1.6, libc6 and
>> libguile-ltdl-1 seems to work fine, and interrupts the read(2) call with
>> the signal handler.
>
> This appears to still be the case with at least Debian's 2.0.11+1-10
> package, and setting the handler to something that doesn't perform IO
> has the same effect (i.e. no alarm until you hit return):
>
>   (sigaction SIGALRM (lambda (x) (exit 1)))
>
> Thanks





      parent reply	other threads:[~2016-06-24  9:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120826131404.6959.57720.reportbug@localhost.localdomain>
2015-09-06 17:18 ` bug#21424: Bug#685919: guile-1.6: SIGALRM signal handler does not get called when guile blocks on I/O Rob Browning
     [not found]   ` <handler.21424.B.14415599333771.ack@debbugs.gnu.org>
2015-09-06 17:49     ` bug#21424: Acknowledgement (Bug#685919: guile-1.6: SIGALRM signal handler does not get called when guile blocks on I/O) Rob Browning
2016-06-24  9:17   ` Andy Wingo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y45veyj6.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=21424@debbugs.gnu.org \
    --cc=685919-forwarded@bugs.debian.org \
    --cc=685919@bugs.debian.org \
    --cc=panu.kalliokoski@gmail.com \
    --cc=rlb@defaultvalue.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).