[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
[perl #59734] Segfault when using (?|) in regexp.
# New Ticket Created by Abigail
# Please include the string: [perl #59734]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=59734 >
This is a bug report for perl from abigail@abigail.be,
generated with the help of perlbug 1.36 running under perl 5.10.0.
-----------------------------------------------------------------
[Please enter your report here]
While developing a set of complex regexes, I changed some occurrances
of (?: ) to (?| ). This lead to segmentation faults. It segfaults in
blead (patch 34471) as well.
I constructed a minimal case:
perl -wE '";" =~ /(?<a>(?|(?<b>;)))/;'
Resulting in:
*** glibc detected *** perl: free(): invalid pointer: 0x086afac8 ***
======= Backtrace: =========
/lib/libc.so.6[0xb81424]
/lib/libc.so.6(__libc_free+0x77)[0xb8195f]
perl(Perl_safesysfree+0x7a)[0x80bdd71]
perl(Perl_sv_clear+0x1741)[0x8137067]
perl(Perl_sv_free2+0x94)[0x81372df]
perl(Perl_hv_free_ent+0x214)[0x80e39b8]
perl[0x80e44d4]
perl(Perl_hv_undef+0xbb)[0x80e46a4]
perl(Perl_sv_clear+0xc7f)[0x81365a5]
perl(Perl_sv_free2+0x94)[0x81372df]
perl(Perl_pregfree+0x261)[0x80aef29]
perl(Perl_op_clear+0x309)[0x805f976]
perl(Perl_op_free+0x147)[0x805f644]
perl(Perl_op_free+0xf5)[0x805f5f2]
perl(perl_destruct+0x293)[0x80ee85a]
perl(main+0xd1)[0x805ef85]
/lib/libc.so.6(__libc_start_main+0xc6)[0xb32de6]
perl[0x805ee31]
======= Memory map: ========
0012b000-0012c000 r-xp 0012b000 00:00 0
00a1a000-00a1c000 r-xp 00000000 fd:00 429855 /lib/libutil-2.3.5.so
00a1c000-00a1d000 r-xp 00001000 fd:00 429855 /lib/libutil-2.3.5.so
00a1d000-00a1e000 rwxp 00002000 fd:00 429855 /lib/libutil-2.3.5.so
00a7e000-00a90000 r-xp 00000000 fd:00 429860 /lib/libnsl-2.3.5.so
00a90000-00a91000 r-xp 00011000 fd:00 429860 /lib/libnsl-2.3.5.so
00a91000-00a92000 rwxp 00012000 fd:00 429860 /lib/libnsl-2.3.5.so
00a92000-00a94000 rwxp 00a92000 00:00 0
00afc000-00b16000 r-xp 00000000 fd:00 427667 /lib/ld-2.3.5.so
00b16000-00b17000 r-xp 00019000 fd:00 427667 /lib/ld-2.3.5.so
00b17000-00b18000 rwxp 0001a000 fd:00 427667 /lib/ld-2.3.5.so
00b1e000-00c42000 r-xp 00000000 fd:00 429849 /lib/libc-2.3.5.so
00c42000-00c44000 r-xp 00124000 fd:00 429849 /lib/libc-2.3.5.so
00c44000-00c46000 rwxp 00126000 fd:00 429849 /lib/libc-2.3.5.so
00c46000-00c48000 rwxp 00c46000 00:00 0
00c4a000-00c6c000 r-xp 00000000 fd:00 429850 /lib/libm-2.3.5.so
00c6c000-00c6d000 r-xp 00021000 fd:00 429850 /lib/libm-2.3.5.so
00c6d000-00c6e000 rwxp 00022000 fd:00 429850 /lib/libm-2.3.5.so
00c70000-00c72000 r-xp 00000000 fd:00 429851 /lib/libdl-2.3.5.so
00c72000-00c73000 r-xp 00001000 fd:00 429851 /lib/libdl-2.3.5.so
00c73000-00c74000 rwxp 00002000 fd:00 429851 /lib/libdl-2.3.5.so
00de3000-00dec000 r-xp 00000000 fd:00 426011 /lib/libgcc_s-4.0.2-20051126.so.1
00dec000-00ded000 rwxp 00009000 fd:00 426011 /lib/libgcc_s-4.0.2-20051126.so.1
067a3000-067a8000 r-xp 00000000 fd:00 429861 /lib/libcrypt-2.3.5.so
067a8000-067a9000 r-xp 00004000 fd:00 429861 /lib/libcrypt-2.3.5.so
067a9000-067aa000 rwxp 00005000 fd:00 429861 /lib/libcrypt-2.3.5.so
067aa000-067d1000 rwxp 067aa000 00:00 0
08048000-08320000 r-xp 00000000 fd:03 131121 /opt/perl/bin/perl
08320000-08322000 rw-p 002d7000 fd:03 131121 /opt/perl/bin/perl
08322000-08323000 rw-p 08322000 00:00 0
08697000-086d9000 rw-p 08697000 00:00 0 [heap]
b7c00000-b7c21000 rw-p b7c00000 00:00 0
b7c21000-b7d00000 ---p b7c21000 00:00 0
b7d6b000-b7f6b000 r--p 00000000 fd:05 1542724 /usr/lib/locale/locale-archive
b7f6b000-b7f6e000 rw-p b7f6b000 00:00 0
bfc59000-bfc6e000 rw-p bfc59000 00:00 0 [stack]
Aborted
And:
$ valgrind perl -wE '";" =~ /(?<a>(?|(?<b>;)))/;'
==6748== Memcheck, a memory error detector for x86-linux.
==6748== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==6748== Using valgrind-2.4.0, a program supervision framework for x86-linux.
==6748== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==6748== For more details, rerun with: -v
==6748==
==6748== Invalid write of size 4
==6748== at 0x820406D: S_regmatch (regexec.c:3841)
==6748== by 0x81FCA1B: S_regtry (regexec.c:2325)
==6748== by 0x81FAE04: Perl_regexec_flags (regexec.c:2034)
==6748== by 0x8105F1B: Perl_pp_match (pp_hot.c:1330)
==6748== by 0x80BD355: Perl_runops_debug (dump.c:1931)
==6748== by 0x80F377B: S_run_body (perl.c:2384)
==6748== by 0x80F2DB7: perl_run (perl.c:2302)
==6748== by 0x805EF73: main (perlmain.c:113)
==6748== Address 0x1B946A08 is 0 bytes after a block of size 16 alloc'd
==6748== at 0x1B909B71: calloc (vg_replace_malloc.c:175)
==6748== by 0x80BDE01: Perl_safesyscalloc (util.c:294)
==6748== by 0x80959AF: Perl_re_compile (regcomp.c:4837)
==6748== by 0x80926D7: Perl_pregcomp (regcomp.c:4150)
==6748== by 0x80675A4: Perl_pmruntime (op.c:3444)
==6748== by 0x82954B5: Perl_yyparse (perly.y:1224)
==6748== by 0x80F2B29: S_parse_body (perl.c:2230)
==6748== by 0x80F1373: perl_parse (perl.c:1650)
==6748== by 0x805EF59: main (perlmain.c:111)
==6748==
==6748== Invalid write of size 4
==6748== at 0x8204092: S_regmatch (regexec.c:3842)
==6748== by 0x81FCA1B: S_regtry (regexec.c:2325)
==6748== by 0x81FAE04: Perl_regexec_flags (regexec.c:2034)
==6748== by 0x8105F1B: Perl_pp_match (pp_hot.c:1330)
==6748== by 0x80BD355: Perl_runops_debug (dump.c:1931)
==6748== by 0x80F377B: S_run_body (perl.c:2384)
==6748== by 0x80F2DB7: perl_run (perl.c:2302)
==6748== by 0x805EF73: main (perlmain.c:113)
==6748== Address 0x1B946A0C is 4 bytes after a block of size 16 alloc'd
==6748== at 0x1B909B71: calloc (vg_replace_malloc.c:175)
==6748== by 0x80BDE01: Perl_safesyscalloc (util.c:294)
==6748== by 0x80959AF: Perl_re_compile (regcomp.c:4837)
==6748== by 0x80926D7: Perl_pregcomp (regcomp.c:4150)
==6748== by 0x80675A4: Perl_pmruntime (op.c:3444)
==6748== by 0x82954B5: Perl_yyparse (perly.y:1224)
==6748== by 0x80F2B29: S_parse_body (perl.c:2230)
==6748== by 0x80F1373: perl_parse (perl.c:1650)
==6748== by 0x805EF59: main (perlmain.c:111)
==6748==
==6748== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 17 from 1)
==6748== malloc/free: in use at exit: 113785 bytes in 1007 blocks.
==6748== malloc/free: 1479 allocs, 472 frees, 151356 bytes allocated.
==6748== For counts of detected errors, rerun with: -v
==6748== searching for pointers to 1007 not-freed blocks.
==6748== checked 359128 bytes.
==6748==
==6748== LEAK SUMMARY:
==6748== definitely lost: 0 bytes in 0 blocks.
==6748== possibly lost: 0 bytes in 0 blocks.
==6748== still reachable: 113785 bytes in 1007 blocks.
==6748== suppressed: 0 bytes in 0 blocks.
==6748== Reachable blocks (those to which a pointer was found) are not shown.
==6748== To see them, rerun with: --show-reachable=yes
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=high
---
Site configuration information for perl 5.10.0:
Configured by abigail at Sat Dec 22 18:46:30 CET 2007.
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
Platform:
osname=linux, osvers=2.6.11-1.1369_fc4smp, archname=i686-linux-64int-ld
uname='linux almanda 2.6.11-1.1369_fc4smp #1 smp thu jun 2 23:08:39 edt 2005 i686 i686 i386 gnulinux '
config_args='-des -Dusemorebits -Uversiononly -Dmydomain=.abigail.be -Dcf_email=abigail@abigail.be -Dperladmin=abigail@abigail.be -Doptimize=-g -Dcc=gcc -Dprefix=/opt/perl -Dusemorebits'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=undef, uselongdouble=define
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-g',
cppflags='-DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='4.0.2 20051125 (Red Hat 4.0.2-8)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.3.5.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.3.5'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -g -L/usr/local/lib'
Locally applied patches:
---
@INC for perl 5.10.0:
/home/abigail/Perl
/opt/perl/lib/5.10.0/i686-linux-64int-ld
/opt/perl/lib/5.10.0
/opt/perl/lib/site_perl/5.10.0/i686-linux-64int-ld
/opt/perl/lib/site_perl/5.10.0
/opt/perl/lib/site_perl/5.8.8
/opt/perl/lib/site_perl
.
---
Environment for perl 5.10.0:
HOME=/home/abigail
LANG=en_US.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH=/home/abigail/Lib:/usr/local/lib:/usr/lib:/lib:/usr/X11R6/lib
LOGDIR (unset)
PATH=/home/abigail/Bin:/opt/perl/bin:/usr/local/bin:/usr/local/X11/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/games:/usr/share/texmf/bin:/opt/Acrobat/bin:/opt/java/blackdown/j2sdk1.3.1/bin:/usr/local/games/bin:/opt/git/bin
PERL5LIB=/home/abigail/Perl
PERLDIR=/opt/perl
PERL_BADLANG (unset)
SHELL=/bin/bash
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]