FAQ

Steve Peters via RT wrote:
On Thu Nov 02 16:46:15 2006, stas wrote:
This is a bug report for perl from stas@stason.org,
generated with the help of perlbug 1.35 running under perl v5.8.8.

-----------------------------------------------------------------
[Please enter your report here]

% limit stacksize
stacksize 8192 kbytes
% perl -le '(qq["Joe\" <email>,\n\t] x 10000) =~
m{[^\n]+(?:[^\n]*\n)*}s;'
Segmentation fault

the backtrace is an endless frames stack:
#0 0x00002af5d143c85d in Perl_regclass_swash ()
from /usr/lib/perl5/5.8.8/x86_64-linux/CORE/libperl.so
#1 0x00002af5d143f815 in Perl_regclass_swash ()
from /usr/lib/perl5/5.8.8/x86_64-linux/CORE/libperl.so
#2 0x00002af5d143e666 in Perl_regclass_swash ()
from /usr/lib/perl5/5.8.8/x86_64-linux/CORE/libperl.so
#3 0x00002af5d143f837 in Perl_regclass_swash ()
...
from /usr/lib/perl5/5.8.8/x86_64-linux/CORE/libperl.so
#2840 0x00002af5d143e666 in Perl_regclass_swash ()
...

the problem happens with a relatively recent blead-perl too.

It sounds like there is a need for some regex recursion sanity check.

Making the stack size bigger helps to raise the limit, but not quite a
robust solution.

(in case you're wondering where the situation is coming from - it's a
really bad directory
harvesting attack: where thousands of dictionary usernames are pasted
into the email headers
http://en.wikipedia.org/wiki/Directory_Harvest_Attack)
I'm not seeing it with bleadperl. What configuration are you using?

[steve@kirk perl-current]$ ./perl -le '(qq["Joe\" <email>,\n\t] x 10000) =~ m{[
^\n]+(?:[^\n]*\n)*}s;'
[steve@kirk perl-current]$ ./perl -v

This is perl, v5.9.5 DEVEL29193 built for i686-linux-thread-multi
You are right Steve, the latest blead doesn't have this problem. But the
latest maint (MAINT28213) still segfaults.

Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=linux, osvers=2.6.17-5mdv, archname=i686-linux-thread-multi
uname='linux localhost 2.6.17-5mdv #1 smp wed sep 13 14:32:31 edt
2006 i686 intel(r) pentium(r) 4 cpu 3.20ghz gnulinux '
config_args='-des -Dprefix=/home/stas/perl/5.8.8-ithread
-Dusethreads -Doptimize=-g -Duseshrplib -Dusedevel
-Accflags=-DDEBUG_LEAKING_SCALARS'
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
-DDEBUG_LEAKING_SCALARS -DDEBUGGING -fno-strict-aliasing -pipe
-Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
optimize='-g',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBUG_LEAKING_SCALARS -DDEBUGGING -fno-strict-aliasing -pipe
-Wdeclaration-after-statement -I/usr/local/include'
ccversion='', gccversion='4.1.1 20060724 (prerelease)
(4.1.1-3mdk)', 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=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.4.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.4'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E
-Wl,-rpath,/home/stas/perl/5.8.8-ithread/lib/5.8.8/i686-linux-thread-multi/CORE'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING DEBUG_LEAKING_SCALARS MULTIPLICITY
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
THREADS_HAVE_PIDS USE_ITHREADS USE_LARGE_FILES
USE_PERLIO USE_REENTRANT_API
Locally applied patches:
MAINT28213
Built under linux
Compiled at Nov 2 2006 20:57:47
%ENV:
PERLDOC_PAGER="less -R"
@INC:
/home/stas/perl/5.8.8-ithread/lib/5.8.8/i686-linux-thread-multi
/home/stas/perl/5.8.8-ithread/lib/5.8.8

/home/stas/perl/5.8.8-ithread/lib/site_perl/5.8.8/i686-linux-thread-multi
/home/stas/perl/5.8.8-ithread/lib/site_perl/5.8.8
/home/stas/perl/5.8.8-ithread/lib/site_perl
.

--
_____________________________________________________________
Stas Bekman mailto:stas@stason.org http://stason.org/
MailChannels: Reliable Email Delivery http://mailchannels.com
The "Practical mod_perl" book http://modperlbook.org/
http://www.linkedin.com/in/stasbekman http://perl.apache.org/
http://stason.org/photos/gallery/ [* best photos here *]

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 7 | next ›
Discussion Overview
groupperl5-porters @
categoriesperl
postedNov 3, '06 at 12:48a
activeNov 10, '06 at 8:29p
posts7
users5
websiteperl.org

People

Translate

site design / logo © 2017 Grokbase