# New Ticket Created by Thilo Girmann
# Please include the string: [perl #37038]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=37038 >
This is a bug report for perl from [EMAIL PROTECTED],
generated with the help of perlbug 1.35 running under perl v5.8.7.
-----------------------------------------------------------------
[Please enter your report here]
(I'm sending this message again using a mail client as it appears
to me that it wasn't delivered by sendmail)
When:
* doing a global regular match
* using $1 $2 etc. to retrieve extracted substrings
* the original string does not exist any longer
then $1 $2 etc. is pointing to an unallocated piece of memory.
This way it's possible to return Perl's internal data structures
if the piece of memory got re-used and possibly also cause Perl
to crash if that piece of memory has been returned to the
operating system.
Here's a simple example to confirm the bug (tested under Windows
NT / ActivePerl 5.8.7 and Linux 2.4 / Perl 5.8.0):
use strict;
use warnings;
my $s = "abcd";
$s =~ /(..)(..)/g;
$s = $1;
$s = $2;
print "$s\n";
The statement "$s = $1" causes Perl to re-use the string "abcd"
for storing the first half ("ab") and add a terminating zero.
$2 still points to the original second half but the character
"c" got overwritten neanwhile.
So if the bug is present you will get " c" or just "c" printed
out instead of the expected "cd".
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=low
---
Site configuration information for perl v5.8.7:
Configured by builder at Mon Jun 6 13:36:05 2005.
Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
Platform:
osname=MSWin32, osvers=5.0, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
usethreads=define use5005threads=undef useithreads=define usemultiplicity=de
fine
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE
-DNO_STRICT -DHAVE_DES_FCRYPT -DBUILT_BY_ACTIVESTATE -DNO_HASH_SEED
-DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO
-DPERL_MSVCRT_READFIX',
optimize='-MD -Zi -DNDEBUG -O1',
cppflags='-DWIN32'
ccversion='12.00.8804', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf
-libpath:"C:\Perl\lib\CORE" -machine:x86'
libpth=\lib
libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib
uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
msvcrt.lib
perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib
uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
msvcrt.lib
libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib
gnulibc_version='undef'
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf
-libpath:"C:\Perl\lib\CORE" -machine:x86'
Locally applied patches:
ACTIVEPERL_LOCAL_PATCHES_ENTRY
# if !defined(PERL_DARWIN)
Iin_load_module moved for compatibility with build 806
# endif
# if defined(__hpux)
Avoid signal flag SA_RESTART for older versions of HP-UX
# endif
PerlEx hacks for CGI::Carp
Less verbose ExtUtils::Install and Pod::Find
instmodsh upgraded from ExtUtils-MakeMaker-6.25
24699 ICMP_UNREACHABLE handling in Net::Ping
21540 Fix backward-compatibility issues in if.pm
---
@INC for perl v5.8.7:
C:/Perl/lib
C:/Perl/site/lib
.
---
Environment for perl v5.8.7:
HOME (unset)
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=c:\programme\imagemagick-6.2.4-q16;C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\Programme\UltraEdit;C:\Programme\Microsoft
SQL Server\80\Tools\BINN;C:\Tools;C:\Programme\Gemeinsame
Dateien\GTK\2.0\bin;C:\Programme\Mts
PERL_BADLANG (unset)
SHELL (unset)