Skip Menu |

This queue is for tickets about the Term-ReadLine-Gnu CPAN distribution.

Maintainer(s)' notes

When you report a bug, please provide the following information;

- output of
	perl -V
	perl Makefile.PL verbose
	make test TEST_VERBOSE=1
	perl -Mblib t/00checkver.t
	echo $TERM
- terminal emulator which you are using
- compiler which is used to compile the GNU Readline Library (libreadline.a) if you can know.
Read INSTALL in the distribution for more details.

Report information
The Basics
Id: 16440
Status: resolved
Priority: 0/
Queue: Term-ReadLine-Gnu

People
Owner: HAYASHI [...] cpan.org
Requestors: ntyni [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.15
Fixed in: 1.19

Attachments


Subject: SIGSEGV in Perl debugger after "|" command
Hi, this is a forwarded Debian bug report. The original report is at http://bugs.debian.org/236018 When a command is piped to a pager (at least 'less'), Term::Readline::Gnu suffers a SIGSEGV. The easiest way to reproduce this is as follows: % gdb /usr/bin/perl [...] (gdb) run -de 0 [...] DB<1> |x Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1075592256 (LWP 7677)] 0x400b520a in fflush () from /lib/tls/libc.so.6 (gdb) bt #0 0x400b520a in fflush () from /lib/tls/libc.so.6 #1 0x403d67dc in rl_prep_terminal (meta_flag=1) at /home/packages/bash/readline5-5.1/rltty.c:721 #2 0x403d1ecb in readline (prompt=0x0) at /home/packages/bash/readline5-5.1/readline.c:309 #3 0x403a38e9 in XS_Term__ReadLine__Gnu__XS_rl_readline () from /usr/lib/perl5/auto/Term/ReadLine/Gnu/Gnu.so #4 0x080c0ac0 in Perl_pp_entersub () #5 0x080b95aa in Perl_runops_standard () #6 0x08064e43 in perl_run () #7 0x0805fd4f in main () This is verified on Debian GNU/Linux, perl versions 5.8.4 and 5.8.7, and readline 4.3 and 5.1. It seems to happen because the 'rl_outstream' variable inside the actual readline library somehow gets out of sync when STDOUT is dup(2)'ed inside the Perl debugger. This is done for saving and restoring the file descriptor while using the pager. The attached patch seems to fix the problem by 'reinitializing' rl_outstream every time readline() is called. Cheers, -- Niko Tyni ntyni@iki.fi
From: ntyni [...] iki.fi
Show quoted text
> The attached patch seems to fix the problem by 'reinitializing' > rl_outstream every time readline() is called.
Bah, messed up with the attachment. Here it is for real. -- Niko Tyni ntyni@iki.fi
Download rl-gnu-patch
application/octet-stream 495b

Message body not shown because it is not plain text.

I applied this fix, on Term::ReadLine::Gnu-1.19 which I've just released. Sorry to be late. I've been overlooking this issue.
The patch above was applied in Term-ReadLine-Gnu-1.19, but the fix was not enough. See ticket #83040 https://rt.cpan.org/Ticket/Display.html?id=83040 for the real fix.