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

5.005_63: close(STDERR) causes crash #938

Closed
p5pRT opened this issue Dec 13, 1999 · 2 comments
Closed

5.005_63: close(STDERR) causes crash #938

p5pRT opened this issue Dec 13, 1999 · 2 comments

Comments

@p5pRT
Copy link

p5pRT commented Dec 13, 1999

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

Searchable as RT1883$

@p5pRT
Copy link
Author

p5pRT commented Dec 13, 1999

From johanv@nl.compuware.com

Closing STDERR causes perl to segfault when something needs to be
written to it (e.g. a warning).

Example​:

  close (STDERR);
  die ("Okay\n");

Perl Info


Site configuration information for perl 5.00563:

Configured by johanv at Mon Dec 13 11:05:45 MET 1999.

Summary of my perl5 (revision 5.0 version 5 subversion 63) configuration:
  Platform:
    osname=linux, osvers=2.2.13, archname=i686-linux
    uname='linux plume.nl.compuware.com 2.2.13 #1 thu oct 21 08:45:24 mest 1999 i686 unknown '
    config_args='-Dprefix=/usr -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
    use64bits=undef usemultiplicity=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
    cppflags='-Dbool=char -DHAS_BOOL -fno-strict-aliasing -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -fno-strict-aliasing -I/usr/local/include'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=/lib/libc-2.1.2.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    


@INC for perl 5.00563:
    /usr/lib/perl5/5.00563/i686-linux
    /usr/lib/perl5/5.00563
    /usr/local/lib/site_perl/5.00563/i686-linux
    /usr/local/lib/site_perl
    .


Environment for perl 5.00563:
    HOME=/home/johanv
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=.:/home/johanv/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
    PERL_BADLANG (unset)
    SHELL=/bin/csh

@p5pRT
Copy link
Author

p5pRT commented Dec 16, 1999

From @gsar

On Mon, 13 Dec 1999 13​:18​:43 +0100, Johan Vromans CPWR wrote​:

Closing STDERR causes perl to segfault when something needs to be
written to it (e.g. a warning).

Example​:

close (STDERR);
die ("Okay\n");

Thanks, try this.

Sarathy
gsar@​ActiveState.com

Inline Patch
-----------------------------------8<-----------------------------------
Change 4680 by gsar@auger on 1999/12/16 08:26:00

	avoid coredump on diagnostics when STDERR is closed

Affected files ...

... //depot/perl/perl.h#210 edit

Differences ...

==== //depot/perl/perl.h#210 (text) ====
Index: perl/perl.h
--- perl/perl.h.~1~	Thu Dec 16 00:26:04 1999
+++ perl/perl.h	Thu Dec 16 00:26:04 1999
@@ -1868,6 +1868,7 @@
 
 #ifndef Perl_error_log
 #  define Perl_error_log	(PL_stderrgv			\
+				 && IoOFP(GvIOp(PL_stderrgv))	\
 				 ? IoOFP(GvIOp(PL_stderrgv))	\
 				 : PerlIO_stderr())
 #endif
End of Patch.

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

No branches or pull requests

1 participant