Debian Bug report logs - #160328
libterm-readline-gnu-perl: Term::ReadLine::GNU handles Ctrl+C badly with perl 5.8

version graph

Package: libterm-readline-gnu-perl; Maintainer for libterm-readline-gnu-perl is Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>; Source for libterm-readline-gnu-perl is src:libterm-readline-gnu-perl.

Reported by: "Crispin Flowerday" <crispin@flowerday.cx>

Date: Tue, 10 Sep 2002 10:18:01 UTC

Severity: normal

Tags: wontfix

Found in version 1.13-1.1

Done: Solveig <debian@solveig.org>

Bug is archived. No further changes may be made.

Forwarded to Hiroo Hayashi <hiroo.hayashi@computer.org>

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Joerg Jaspert <joerg@debian.org>, libterm-readline-gnu-perl@packages.qa.debian.org:
Bug#160328; Package libterm-readline-gnu-perl. Full text and rfc822 format available.

Acknowledgement sent to "Crispin Flowerday" <crispin@flowerday.cx>:
New Bug report received and forwarded. Copy sent to Joerg Jaspert <joerg@debian.org>, libterm-readline-gnu-perl@packages.qa.debian.org. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "Crispin Flowerday" <crispin@flowerday.cx>
To: "Debian Bug Tracking System" <submit@bugs.debian.org>
Subject: libterm-readline-gnu-perl: Term::ReadLine::GNU handles Ctrl+C badly with perl 5.8
Date: Tue, 10 Sep 2002 11:12:22 +0100
Package: libterm-readline-gnu-perl
Version: 1.13-1.1
Severity: normal
Tags: sid

When using Term::ReadLine::Gnu, if you specify a signal handler for
$SIG{INT} then the signal is not handled until 'return' is pressed as
well.

The following program shows the behaviour:

===== START ====
#!/usr/bin/perl

use Term::ReadLine;

$SIG{INT}  = sub { die "Ctrl+C hit\n" };

my $term = new Term::ReadLine 'Test';
my $type = $term->ReadLine();
die "This test is for Term::ReadLine::Gnu\n" unless $type =~ /::Gnu$/i;

print STDERR "Hit Ctrl+C\n";
while ( my $input = $term->readline( "test >" ) ) {}
=== END ===

If you try pressing Ctrl+C, the program should exit straight away, but
in fact you need to press return before the signal handler is executed.
This is different behaviour from Term::ReadLine::Perl which handles it
straight away.

The behaviour changed in perl 5.8, so probably the signal changes,
however perldelta(1) says (under 'Safe Signals' ):

   Note that breaking out from potentially blocking operations should
   still work, though.

Unfortunatly I dont know perl well enough to have a go at patching
this :(

Cheers

Crispin


-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux pallas 2.4.16 #1 Thu Dec 20 17:16:50 GMT 2001 i686
Locale: LANG=C, LC_CTYPE=

Versions of packages libterm-readline-gnu-perl depends on:
ii  libc6                    2.2.5-14        GNU C Library: Shared libraries an
ii  libncurses5              5.2.20020112a-8 Shared libraries for terminal hand
ii  libreadline4             4.3-4           GNU readline and history libraries
ii  perl                     5.8.0-12        Larry Wall's Practical Extraction 
ii  perl-base [perlapi-5.8.0 5.8.0-12        The Pathologically Eclectic Rubbis

-- no debconf information





Reply sent to joerg@debian.org, 160328-forwarded@bugs.debian.org:
You have marked Bug as forwarded. Full text and rfc822 format available.

Message #8 received at 160328-forwarded@bugs.debian.org (full text, mbox):

From: Joerg Jaspert <joerg@debian.org>
To: Hiroo Hayashi <hiroo.hayashi@computer.org>
Cc: 160328-forwarded@bugs.debian.org
Subject: Fwd: Bug#160328: libterm-readline-gnu-perl: Term::ReadLine::GNU handles Ctrl+C badly with perl 5.8
Date: Tue, 10 Sep 2002 16:03:46 +0200
[Message part 1 (text/plain, inline)]
HI

I got the following bugreport for your Term::Readline::Gnu Modul.

Please use values from Reply-To Header for Reply, thx.

[Message part 2 (message/rfc822, inline)]
From: "Crispin Flowerday" <crispin@flowerday.cx>
To: "Debian Bug Tracking System" <submit@bugs.debian.org>
Subject: Bug#160328: libterm-readline-gnu-perl: Term::ReadLine::GNU handles Ctrl+C badly with perl 5.8
Date: Tue, 10 Sep 2002 11:12:22 +0100
Package: libterm-readline-gnu-perl
Version: 1.13-1.1
Severity: normal
Tags: sid

When using Term::ReadLine::Gnu, if you specify a signal handler for
$SIG{INT} then the signal is not handled until 'return' is pressed as
well.

The following program shows the behaviour:

===== START ====
#!/usr/bin/perl

use Term::ReadLine;

$SIG{INT}  = sub { die "Ctrl+C hit\n" };

my $term = new Term::ReadLine 'Test';
my $type = $term->ReadLine();
die "This test is for Term::ReadLine::Gnu\n" unless $type =~ /::Gnu$/i;

print STDERR "Hit Ctrl+C\n";
while ( my $input = $term->readline( "test >" ) ) {}
=== END ===

If you try pressing Ctrl+C, the program should exit straight away, but
in fact you need to press return before the signal handler is executed.
This is different behaviour from Term::ReadLine::Perl which handles it
straight away.

The behaviour changed in perl 5.8, so probably the signal changes,
however perldelta(1) says (under 'Safe Signals' ):

   Note that breaking out from potentially blocking operations should
   still work, though.

Unfortunatly I dont know perl well enough to have a go at patching
this :(

Cheers

Crispin


-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux pallas 2.4.16 #1 Thu Dec 20 17:16:50 GMT 2001 i686
Locale: LANG=C, LC_CTYPE=

Versions of packages libterm-readline-gnu-perl depends on:
ii  libc6                    2.2.5-14        GNU C Library: Shared libraries an
ii  libncurses5              5.2.20020112a-8 Shared libraries for terminal hand
ii  libreadline4             4.3-4           GNU readline and history libraries
ii  perl                     5.8.0-12        Larry Wall's Practical Extraction 
ii  perl-base [perlapi-5.8.0 5.8.0-12        The Pathologically Eclectic Rubbis

-- no debconf information




[Message part 3 (text/plain, inline)]

-- 
begin  OjE-ist-scheisse.txt
bye, Joerg                 Encrypted Mail preferred!
Registered Linux User #97793 @ http://counter.li.org
end
[Message part 4 (application/pgp-signature, inline)]

Message #9 received at 160328-forwarded@bugs.debian.org (full text, mbox):

From: Hiroo Hayashi <hiroo.hayashi@computer.org>
To: joerg@debian.org, 160328-forwarded@bugs.debian.org
Subject: Re: Bug#160328: libterm-readline-gnu-perl: Term::ReadLine::GNU handles Ctrl+C badly with perl 5.8
Date: Tue, 10 Sep 2002 23:47:08 -0500 (CDT)
Joerg> I got the following bugreport for your Term::Readline::Gnu Modul.

Joerg> Please use values from Reply-To Header for Reply, thx.

OK.

Crispin> When using Term::ReadLine::Gnu, if you specify a signal handler for
Crispin> $SIG{INT} then the signal is not handled until 'return' is pressed as
Crispin> well.
....
Crispin> The behaviour changed in perl 5.8, so probably the signal changes,
Crispin> however perldelta(1) says (under 'Safe Signals' ):

Crispin>    Note that breaking out from potentially blocking operations should
Crispin>    still work, though.

I don't have perl 5.8.0... But...

Crispin, why don't you cite whole section which answers to you?

from: http://www.perldoc.com/perl5.8.0/pod/perldelta.html#Safe-Signals
------------------------------------------------------------------------
Safe Signals 

Perl used to be fragile in that signals arriving at inopportune
moments could corrupt Perl's internal state. Now Perl postpones
handling of signals until it's safe (between opcodes).

This change may have surprising side effects because signals no longer
interrupt Perl instantly. Perl will now first finish whatever it was
doing, like finishing an internal operation (like sort()) or an
external operation (like an I/O operation), and only then look at any
arrived signals (and before starting the next operation). No more
corrupt internal state since the current operation is always finished
first, but the signal may take more time to get heard. Note that
breaking out from potentially blocking operations should still work,
though.
------------------------------------------------------------------------

Perl 5.8.0 suspends the signal which occures in XS readline() call
until it finishes.

And here is from GNU Readline Library manual;

------------------------------------------------------------------------
ReadLine Signal Handling

....
   Readline contains an internal signal handler that is installed for
a number of signals (`SIGINT', `SIGQUIT', `SIGTERM', `SIGALRM',
`SIGTSTP', `SIGTTIN', and `SIGTTOU').  When one of these signals is
received, the signal handler will reset the terminal attributes to
those that were in effect before `readline()' was called, reset the
signal handling to what it was before `readline()' was called, and
resend the signal to the calling application.  If and when the calling
application's signal handler returns, Readline will reinitialize the
terminal and continue to accept input. ...
------------------------------------------------------------------------

Before Perl 5.8.0 call XS readline(), it sets SIGIGNORE as signal
hanlder.  When you hit \C-c, the GNU Readline Library resend the
signal to the calling application (Perl 5.8.0).  But the signal is
ignored by Perl 5.8.0 and readline() continues his job.

All XS call must be affected by this new feature.

I cannot see good solution.
---------
Hiroo Hayashi



Tags added: Request was from Joerg Jaspert <joerg@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Information forwarded to libterm-readline-gnu-perl@packages.qa.debian.org:
Bug#160328; Package libterm-readline-gnu-perl. Full text and rfc822 format available.

Acknowledgement sent to Joerg Jaspert <joerg@debian.org>:
Extra info received and filed, but not forwarded. Copy sent to libterm-readline-gnu-perl@packages.qa.debian.org. Full text and rfc822 format available.

Message #16 received at 160328-quiet@bugs.debian.org (full text, mbox):

From: Joerg Jaspert <joerg@debian.org>
To: Crispin Flowerday <crispin@flowerday.cx>, 160328-quiet@bugs.debian.org, control@bugs.debian.org
Subject: Re: Bug#160328: libterm-readline-gnu-perl: Term::ReadLine::GNU handles Ctrl+C badly with perl 5.8
Date: Wed, 11 Sep 2002 13:02:49 +0200
[Message part 1 (text/plain, inline)]
tags 160328 +wontfix
thanks

Talked with Upstream and got the following back.
As he sees no good solution i tag it as wontfix until he or someone
else found a good solution. It looks like a new "feature" of perl5.8.

Hiroo Hayashi <hiroo.hayashi@computer.org> writes:

> Crispin> When using Term::ReadLine::Gnu, if you specify a signal handler for
> Crispin> $SIG{INT} then the signal is not handled until 'return' is pressed as
> Crispin> well.
> ....
> Crispin> The behaviour changed in perl 5.8, so probably the signal changes,
> Crispin> however perldelta(1) says (under 'Safe Signals' ):
> Crispin>    Note that breaking out from potentially blocking operations should
> Crispin>    still work, though.
> I don't have perl 5.8.0... But...
> Crispin, why don't you cite whole section which answers to you?
> from: http://www.perldoc.com/perl5.8.0/pod/perldelta.html#Safe-Signals
> ------------------------------------------------------------------------
> Safe Signals 
> Perl used to be fragile in that signals arriving at inopportune
> moments could corrupt Perl's internal state. Now Perl postpones
> handling of signals until it's safe (between opcodes).

> This change may have surprising side effects because signals no longer
> interrupt Perl instantly. Perl will now first finish whatever it was
> doing, like finishing an internal operation (like sort()) or an
> external operation (like an I/O operation), and only then look at any
> arrived signals (and before starting the next operation). No more
> corrupt internal state since the current operation is always finished
> first, but the signal may take more time to get heard. Note that
> breaking out from potentially blocking operations should still work,
> though.
> ------------------------------------------------------------------------
> Perl 5.8.0 suspends the signal which occures in XS readline() call
> until it finishes.
> And here is from GNU Readline Library manual;
> ------------------------------------------------------------------------
> ReadLine Signal Handling
> ....
>    Readline contains an internal signal handler that is installed for
> a number of signals (`SIGINT', `SIGQUIT', `SIGTERM', `SIGALRM',
> `SIGTSTP', `SIGTTIN', and `SIGTTOU').  When one of these signals is
> received, the signal handler will reset the terminal attributes to
> those that were in effect before `readline()' was called, reset the
> signal handling to what it was before `readline()' was called, and
> resend the signal to the calling application.  If and when the calling
> application's signal handler returns, Readline will reinitialize the
> terminal and continue to accept input. ...
> ------------------------------------------------------------------------

> Before Perl 5.8.0 call XS readline(), it sets SIGIGNORE as signal
> hanlder.  When you hit \C-c, the GNU Readline Library resend the
> signal to the calling application (Perl 5.8.0).  But the signal is
> ignored by Perl 5.8.0 and readline() continues his job.
> All XS call must be affected by this new feature.
> I cannot see good solution.


-- 
begin  OjE-ist-scheisse.txt
bye, Joerg                 Encrypted Mail preferred!
Registered Linux User #97793 @ http://counter.li.org
end
[Message part 2 (application/pgp-signature, inline)]

Tags added: wontfix Request was from Joerg Jaspert <joerg@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Message #19 received at 160328-forwarded@bugs.debian.org (full text, mbox):

From: Joerg Jaspert <joerg@debian.org>
To: Hiroo Hayashi <hiroo.hayashi@computer.org>
Cc: 160328-forwarded@bugs.debian.org
Subject: Re: Bug#160328: libterm-readline-gnu-perl: Term::ReadLine::GNU handles Ctrl+C badly with perl 5.8
Date: Wed, 11 Sep 2002 13:08:33 +0200
[Message part 1 (text/plain, inline)]
Hiroo Hayashi <hiroo.hayashi@computer.org> writes:

> Before Perl 5.8.0 call XS readline(), it sets SIGIGNORE as signal
> hanlder.  When you hit \C-c, the GNU Readline Library resend the
> signal to the calling application (Perl 5.8.0).  But the signal is
> ignored by Perl 5.8.0 and readline() continues his job.
> All XS call must be affected by this new feature.
> I cannot see good solution.

Ok, thx for your time. I hoped you have something available :)
I tag this bug as wontfix, then is this a "feature" of perl5.8 until one
comes with a good patch (or you find something good). :)


-- 
begin  OjE-ist-scheisse.txt
bye, Joerg                 Encrypted Mail preferred!
Registered Linux User #97793 @ http://counter.li.org
end
[Message part 2 (application/pgp-signature, inline)]

Tags removed: sid Request was from Niko Tyni <ntyni@iki.fi> to control@bugs.debian.org. Full text and rfc822 format available.

Reply sent to Solveig <debian@solveig.org>:
You have taken responsibility. (Wed, 07 Aug 2013 22:21:07 GMT) Full text and rfc822 format available.

Notification sent to "Crispin Flowerday" <crispin@flowerday.cx>:
Bug acknowledged by developer. (Wed, 07 Aug 2013 22:21:07 GMT) Full text and rfc822 format available.

Message #26 received at 160328-done@bugs.debian.org (full text, mbox):

From: Solveig <debian@solveig.org>
To: 160328-done@bugs.debian.org
Subject: libterm-readline-gnu-perl: Term::ReadLine::GNU handles Ctrl+C badly with perl 5.8 - closing
Date: Wed, 07 Aug 2013 22:16:13 +0000
Hi! I'm closing this bug, since it was tagged "wontfix" for 10
years, without answer. If you have new reasons to point out this
problem, please feel free to re-open it.



Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Thu, 05 Sep 2013 07:28:33 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 19:52:14 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.