Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"|" in debugger hangs with less

0 views
Skip to first unread message

Chip Salzenberg

unread,
Mar 3, 2004, 4:35:06 PM3/3/04
to Perl 5 Porters
I want to know if I've done something wrong before I perlbug this.

When I use "|" to look at anything in the debugger through less (my
default pager), when less is done I don't get my debugger prompt back
and there's nothing I can do to get it back.

Is this a PEBKAC or a perlbug?
--
Chip Salzenberg - a.k.a. - <ch...@pobox.com>
"I wanted to play hopscotch with the impenetrable mystery of existence,
but he stepped in a wormhole and had to go in early." // MST3K

Rafael Garcia-Suarez

unread,
Mar 3, 2004, 4:42:03 PM3/3/04
to Chip Salzenberg, Perl 5 Porters
Chip Salzenberg wrote:
>
> I want to know if I've done something wrong before I perlbug this.
>
> When I use "|" to look at anything in the debugger through less (my
> default pager), when less is done I don't get my debugger prompt back
> and there's nothing I can do to get it back.
>
> Is this a PEBKAC or a perlbug?

Obvious question : have you tried with more ? pg ? cat ?
What's your $TERM ? have you tried another one ? etc. etc.

(I had some similar problems with slrn and other slang-based
programs; which mysteriously disappeared when I recompiled my
terminal emulator.)

Chip Salzenberg

unread,
Mar 3, 2004, 5:02:45 PM3/3/04
to Rafael Garcia-Suarez, Perl 5 Porters
I've answered your questions below, Rafael, but strace reveals that
the immediate failure mode is an infinite SIGSEGV with a signal
handler that does nothing. I think the debugger is trying to catch
target program SIGSEGVs, but when the debugger itself suffers from one
it goes south.

Anyone else have problems with Term::Readline::Gnu? Maybe Debian's
copy needs recompilation or something.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1075614368 (LWP 28053)]
0x400c5dae in fflush () from /lib/tls/i686/cmov/libc.so.6
(gdb) where
#0 0x400c5dae in fflush () from /lib/tls/i686/cmov/libc.so.6
#1 0x40241f4d in rl_prep_terminal () from /lib/libreadline.so.4
#2 0x4023d1f5 in readline () from /lib/libreadline.so.4
#3 0x401fac38 in XS_Term__ReadLine__Gnu__XS_rl_readline () from /usr/lib/perl5/auto/Term/ReadLine/Gnu/Gnu.so
#4 0x080cccf6 in Perl_pp_entersub ()
#5 0x080c6679 in Perl_runops_standard ()
#6 0x080634e8 in perl_run ()
#7 0x0815dd54 in ?? ()
#8 0x00000001 in ?? ()


According to Rafael Garcia-Suarez:


> Chip Salzenberg wrote:
> > When I use "|" to look at anything in the debugger through less (my
> > default pager), when less is done I don't get my debugger prompt back
> > and there's nothing I can do to get it back.
>

> Obvious question : have you tried with more ? pg ? cat ?

Fails the same with more and cat.

> What's your $TERM ? have you tried another one ?

$TERM is rxvt under aterm. Fails the same with "xterm" and "dumb".

> (I had some similar problems with slrn and other slang-based
> programs; which mysteriously disappeared when I recompiled my
> terminal emulator.)

Fails the same under xterm (as opposed to aterm).
Fails the same under bash (as opposed to zsh).

Richard Foley

unread,
Mar 4, 2004, 3:26:39 AM3/4/04
to Rafael Garcia-Suarez, Chip Salzenberg, Perl 5 Porters
I'm not going to be so facetious, Chip, as to ask which version you're
using or for the output of 'perl -v', in case I get a slap ;-)

But, I believe this is a known bug in 5.8.1 which was fixed in 5.8.2+ or
so.

Richard

> Chip Salzenberg wrote:
> >
> > I want to know if I've done something wrong before I perlbug this.
> >

> > When I use "|" to look at anything in the debugger through less (my
> > default pager), when less is done I don't get my debugger prompt
back
> > and there's nothing I can do to get it back.
> >

> > Is this a PEBKAC or a perlbug?
>

> Obvious question : have you tried with more ? pg ? cat ?

> What's your $TERM ? have you tried another one ? etc. etc.

Chip Salzenberg

unread,
Mar 4, 2004, 8:18:09 AM3/4/04
to Richar...@t-online.de, Rafael Garcia-Suarez, Perl 5 Porters
According to Richar...@t-online.de:

> I'm not going to be so facetious, Chip, as to ask which version you're
> using or for the output of 'perl -v', in case I get a slap ;-)

No, it's a fair cop; I should have said. It's Debian's 5.8.3-2.
I've put it in the Debian bug system already, we'll see what happens.

PS: A: Becuase reading the answer before the question is disorienting.
Q: Why shouldn't I top-post?

Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration:
Platform:
osname=linux, osvers=2.4.22-xfs+ti1211, archname=i386-linux-thread-multi
uname='linux kosh 2.4.22-xfs+ti1211 #1 sat oct 25 10:11:37 est 2003 i686 gnulinux '
config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.8 -Darchlib=/usr/lib/perl/5.8 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.8.3 -Dsitearch=/usr/local/lib/perl/5.8.3 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Uusenm -Duseshrplib -Dlibperl=libperl.so.5.8.3 -Dd_dosuid -des'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O3',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='3.3.3 20040125 (prerelease) (Debian)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
perllibs=-ldl -lm -lpthread -lc -lcrypt
libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so.5.8.3
gnulibc_version='2.3.2'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Built under linux
Compiled at Feb 15 2004 16:37:30
@INC:
/etc/perl
/usr/local/lib/perl/5.8.3
/usr/local/share/perl/5.8.3
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.8
/usr/share/perl/5.8
/usr/local/lib/site_perl
/usr/local/share/perl/5.8.2
/usr/local/share/perl/5.8.1
/usr/local/share/perl/5.8.0

Richard Foley

unread,
May 11, 2004, 12:33:23 PM5/11/04
to Chip Salzenberg, Rafael Garcia-Suarez, Perl 5 Porters
If I use '| x \%INC' in the debugger, as chip pointed out, it hangs for me
too. I'm not sure it's identical, but the same thing happens to me, and I've
included here an 'strace' output for the offending process (full trace
attached), on the off chance it makes more sense to someone else, than it
does to me.

rt_sigprocmask(SIG_BLOCK, [INT], [RTMIN], 8) = 0
ioctl(4, TIOCGWINSZ, {ws_row=22, ws_col=125, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(4, TIOCSWINSZ, {ws_row=22, ws_col=125, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(4, SNDCTL_TMR_TIMEBASE, {B38400 opost isig icanon echo ...}) = 0
ioctl(4, SNDCTL_TMR_STOP, {B38400 opost isig -icanon -echo ...}) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
Process 2904 detached

BTW, this doesn't happen for me in any of the following installs (of my own):

5.00504, 5.6.2, 5.8.0, 5.8.2, 5.8.4

BUT, it does happen to me on 5.8.1 (which I believe was installed via my SuSe
installation). At first I thought this might be an 'odd-version(devel)'
issue, but closer inspection makes me think it's a compile time option.

In the several installs which fail (including Chips), the following
compile-time options are all set, which may of course be red herrings:

MULTIPLICITY USE_ITHREADS PERL_IMPLICIT_CONTEXT

Of the several things, which may also be red herrings, but which also happen
to be constant across versions which fail and versions which succeed are the
following (from perl -V):

success:
cccdlflags='-fpic'
useshrplib=false
libperl=libperl.a

failure:
cccdlflags='-fPIC'
useshrplib=true
libperl=libperl.so...

I'm disinclined to believe its related to the perl5db.pl file itself, because
I can use a different debugger dynamically via PERL5DB=..., and the effect
remains constant based on the actual perl I'm using, not on the debugger
library version.

I don't know if that helps anyone else look into this. But not being able to
pipe the output of a command through a pager in the debugger is a real pain
in the ****!

Ciao
Richard Foley
---
Ciao - Shorter than Aufwiedersehen

http://www.oreilly.com/catalog/perldebugpr/index.html

On Thursday 04 March 2004 14:18, Chip Salzenberg wrote:
> oct 25 10:11:37 est 2003 i686 gnulinux ' config_args='-Dusethreads
> -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i386-linux

<snip - mostly man dirs>


> -Uafs -Ud_csh -Uusesfio -Uusenm -Duseshrplib -Dlibperl=libperl.so.5.8.3

-Dd_dosuid'
<snip>

bug
0 new messages