Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault with PERLIO_DEBUG #8202

Closed
p5pRT opened this issue Nov 10, 2005 · 4 comments
Closed

segfault with PERLIO_DEBUG #8202

p5pRT opened this issue Nov 10, 2005 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 10, 2005

Migrated from rt.perl.org#37648 (status was 'resolved')

Searchable as RT37648$

@p5pRT
Copy link
Author

p5pRT commented Nov 10, 2005

From Peter.Dintelmann@dresdner-bank.com

This is a bug report for perl from Peter.Dintelmann@​dresdner-bank.com,
generated with the help of perlbug 1.35 running under perl v5.8.7.

Setting the environment variable PERLIO_DEBUG as described
in perlapio.pod results in a segmentation fault with a threaded
version of perl on Solaris.

  $ PERLIO_DEBUG=/dev/tty /opt/perl32/bin/perl -e1
  -e​:0 define unix ff33bb54
  -e​:0 define raw ff33bbc4
  -e​:0 define perlio ff33ba74
  -e​:0 define stdio ff33bae4
  -e​:0 define crlf ff33b994
  -e​:0 define mmap ff33b924
  -e​:0 define utf8 ff33bca4
  -e​:0 define pop ff33bd14
  -e​:0 define bytes ff33bc34
  -e​:0 unix => ff33bb54
  -e​:0 Pushing stdio
  -e​:0 stdio => ff33bae4
  -e​:0 Layer 1 is stdio
  Segmentation Fault (core dumped)

The patch below tries to fix this. The output is now

  $ PERLIO_DEBUG=/dev/tty /opt/perl32patch/bin/perl -e1
  -e​:0 define unix ff33b8ec
  -e​:0 define raw ff33b95c
  -e​:0 define perlio ff33b80c
  -e​:0 define stdio ff33b87c
  -e​:0 define crlf ff33b72c
  -e​:0 define mmap ff33b6bc
  -e​:0 define utf8 ff33ba3c
  -e​:0 define pop ff33baac
  -e​:0 define bytes ff33b9cc
  -e​:0 unix => ff33b8ec
  -e​:0 Pushing stdio
  -e​:0 stdio => ff33b87c
  -e​:0 Layer 1 is stdio
  -e​:0 openn(stdio,'(Null)','Ir',0,0,0,0,0,0)
  -e​:0 PerlIO_push f=3844c stdio r 22e84
  -e​:0 fd 0 refcnt=1
  -e​:0 Layer 1 is stdio
  -e​:0 openn(stdio,'(Null)','Iw',1,0,0,0,0,0)
  -e​:0 PerlIO_push f=38450 stdio w 22e84
  -e​:0 fd 1 refcnt=1
  -e​:0 Layer 1 is stdio
  -e​:0 openn(stdio,'(Null)','Iw',2,0,0,0,0,0)
  -e​:0 PerlIO_push f=38454 stdio w 22e84
  -e​:0 fd 2 refcnt=1
  -e​:0 Layer 1 is stdio
  -e​:0 openn(stdio,'(Null)','r',-1,0,0,0,1,ffbffba4)
  -e​:0 PerlIO_push f=38458 stdio r 22e84
  -e​:0 fd 4 refcnt=1
  -e​:1 fd 4 refcnt=0
  -e​:1 PerlIO_pop f=38458 stdio
  -e​:0 Destruct 22788
  -e​:0 Cleanup layers for 22788
  -e​:0 fd 0 refcnt=2
  -e​:0 fd 1 refcnt=2
  -e​:0 fd 2 refcnt=2
  -e​:0 fd 2 refcnt=1
  -e​:0 PerlIO_pop f=38454 stdio
  -e​:0 fd 1 refcnt=1
  -e​:0 PerlIO_pop f=38450 stdio
  -e​:0 fd 0 refcnt=1
  -e​:0 PerlIO_pop f=3844c stdio
  -e​:0 fd 0 refcnt=0
  -e​:0 fd 1 refcnt=0
  -e​:0 fd 2 refcnt=0

Proposed patch​:

$ diff -ur perlio.c perl-5.8.7/perlio.c

Inline Patch
--- perlio.c    Thu Nov 10 10:38:40 2005
+++ perl-5.8.7/perlio.c Thu Nov 10 10:33:20 2005
@@ -1535,8 +1535,8 @@
                Perl_croak(aTHX_ "More than one argument to
open(,':%s')",tab->name);   \}   PerlIO\_debug\("openn\(%s\,'%s'\,'%s'\,%d\,%x\,%o\,%p\,%d\,%p\)\\n"\, \- tab\->name\, layers\, mode\, fd\, imode\, perm\, \- \(void\*\)f\, narg\, \(void\*\)args\); \+ tab\->name\, \(layers\) ? layers : "\(Null\)"\, mode\, \+ fd\, imode\, perm\, \(void\*\)f\, narg\, \(void\*\)args\);   if \(tab\->Open\)   f = \(\*tab\->Open\) \(aTHX\_ tab\, layera\, n\, mode\, fd\, imode\, perm\,   f\, narg\, args\);

Flags​:
  category=core
  severity=low


Site configuration information for perl v5.8.7​:

Configured by p013176 at Wed Jun 1 15​:12​:46 MEST 2005.

Summary of my perl5 (revision 5 version 8 subversion 7) configuration​:
  Platform​:
  osname=solaris, osvers=2.9, archname=sun4-solaris-thread-multi-64int
  uname='sunos oikbm03 5.9 generic_112233-01 sun4u sparc sunw,ultra-5_10 '
  config_args='-Dprefix=/opt/perl32 -Uinstallusrbinperl -Dcc=gcc
-Doptimize=-O2 -Aldflags=-R/usr/local/lib -Duseshrplib -Duseperlio
-Dusethreads -Duselargefiles -Duse64bitint -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=define use64bitall=undef uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='gcc', ccflags ='-D_REENTRANT -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O2',
  cppflags='-D_REENTRANT -fno-strict-aliasing -pipe -I/usr/local/include'
  ccversion='', gccversion='3.4.2', gccosandvers='solaris2.9'
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='gcc', ldflags =' -R/usr/local/lib -L/usr/local/lib '
  libpth=/usr/local/lib /usr/lib /usr/ccs/lib
  libs=-lsocket -lnsl -lgdbm -ldl -lm -lpthread -lc
  perllibs=-lsocket -lnsl -ldl -lm -lpthread -lc
  libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -R
/opt/perl32/lib/5.8.7/sun4-solaris-thread-multi-64int/CORE'
  cccdlflags='-fPIC', lddlflags='-G -R/usr/local/lib -L/usr/local/lib'

Locally applied patches​:


@​INC for perl v5.8.7​:
  /opt/perl32/lib/5.8.7/sun4-solaris-thread-multi-64int
  /opt/perl32/lib/5.8.7
  /opt/perl32/lib/site_perl/5.8.7/sun4-solaris-thread-multi-64int
  /opt/perl32/lib/site_perl/5.8.7
  /opt/perl32/lib/site_perl
  .


Environment for perl v5.8.7​:
  HOME=/export/home/p013176
  LANG (unset)
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/usr/bin​:/bin​:/usr/sbin​:/sbin​:/usr/local/bin/
  PERL_BADLANG (unset)
  SHELL=/usr/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Nov 10, 2005

From @rgs

Peter Dintelmann (via RT) wrote​:

Proposed patch​:

$ diff -ur perlio.c perl-5.8.7/perlio.c
--- perlio.c Thu Nov 10 10​:38​:40 2005
+++ perl-5.8.7/perlio.c Thu Nov 10 10​:33​:20 2005

Thanks, applied to bleadperl as change #26075.

@p5pRT
Copy link
Author

p5pRT commented Nov 10, 2005

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Nov 10, 2005

@rgs - Status changed from 'new' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant