develooper Front page | perl.perl5.porters | Postings from June 2014

[perl #122122] [PATCH] PERL_UNUSED_CONTEXT audit

From:
Tony Cook via RT
Date:
June 25, 2014 01:17
Subject:
[perl #122122] [PATCH] PERL_UNUSED_CONTEXT audit
Message ID:
rt-4.0.18-12763-1403659065-1496.122122-15-0@perl.org
On Tue Jun 17 16:05:37 2014, bulk88 wrote:
> This was very poorly smoked since my unthreaded and no-
> PERL_IMPLICIT_SYS threaded perls were crashing due to another open
> ticket due to a Dynaloder/LoadLibrary bug that is open in another
> ticket.

It fails fairly badly on POSIXish systems:

cc -fstack-protector -L/usr/local/lib -o miniperl \
            perlmini.o opmini.o miniperlmain.o  gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o   -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc 
./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
Segmentation fault
Failed to build miniperl. Please run make minitest

tony@mars:.../git/perl2$ gdb --args ./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>'
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/tony/dev/perl/git/perl2/miniperl...done.
(gdb) r
Starting program: /home/tony/dev/perl/git/perl2/miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e \<\?\>
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
Perl_reentrant_init (my_perl=0x0, my_perl@entry=0x8ba010) at reentr.c:145
145             Newx(PL_reentrant_buffer, 1, REENTR);
(gdb) bt
#0  Perl_reentrant_init (my_perl=0x0, my_perl@entry=0x8ba010) at reentr.c:145
#1  0x000000000040a96b in perl_construct (my_perl=0x8ba010) at perl.c:283
#2  0x0000000000406afe in main (argc=7, argv=0x7fffffffe888, 
    env=0x7fffffffe8c8) at miniperlmain.c:114
(gdb)

This particular crash is fixable with some changes to regen/reentr.pl to move the PERL_UNUSED_CONTEXT into a #else, but it continues to crash elsewhere after that is fixed:

Program received signal SIGSEGV, Segmentation fault.
Perl_opslab_free (my_perl=0x0, slab=0x8e7ec0) at op.c:379
379         DEBUG_S_warn((aTHX_ "freeing slab %p", (void*)slab));

So this patch isn't currently suitable for blead.

Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=122122



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About