List Info

Thread: a" + /$.../ = panic: sv_len_utf8 cache




a" + /$.../ = panic: sv_len_utf8 cache
user name
2007-09-10 15:04:59
# New Ticket Created by  webmastersctosonline.org 
# Please include the string:  [perl #45337]
# in the subject line of all future correspondence about
this issue. 
# <URL: h
ttp://rt.perl.org/rt3/Ticket/Display.html?id=45337 >


The following snippet works in 5.9.4 and earlier but fails
in 5.10.0  
patchlevel 31832:

$ perl -e'$s="[a]a"; utf8::upgrade $s; /$s/;
print "okn"'
ok
$ perl5.10.0 -e'$s="[a]a"; utf8::upgrade $s;
/$s/; print "okn"'
panic: sv_len_utf8 cache 3 real 2 for aa at -e line 1.

Apparently this error occurs when a string to be
interpolated in a  
regexp has the utf8 flag on and contains a character class
followed  
by literal text with a fixed quantifier > 1.

A binary search points to change #31246 as being the
culprit.

I hope this helps.


Father Chrysostomos

perl5.10.0 -Mconstant=Just,0 -le'sub
IO::Handle::a_japh{print*{$_[0]}
=~/([^:]+)$/," another Perl
hacker,"}"Just"->a_japh'

---
Flags:
     category=core
     severity=high
---
Site configuration information for perl 5.10.0:

Configured by neo at Sun Sep  9 11:55:38 PDT 2007.

Summary of my perl5 (revision 5 version 10 subversion 0
patch 31832)  
configuration:
   Platform:
     osname=darwin, osvers=8.8.0, archname=darwin-2level
     uname='darwin treebeard.local 8.8.0 darwin kernel
version 8.8.0:  
fri sep 8 17:18:57 pdt 2006; rootnu-79
2.12.6.obj~1release_ppc power  
macintosh powerpc '
     config_args='-de'
     hint=previous, useposix=true, d_sigaction=define
     useithreads=undef, usemultiplicity=undef
     useperlio=define, d_sfio=undef, uselargefiles=define, 

usesocks=undef
     use64bitint=undef, use64bitall=undef,
uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-fno-common -DPERL_DARWIN
-no-cpp-precomp - 
fno-strict-aliasing -pipe -I/usr/local/include',
     optimize='-O3',
     cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN
-no-cpp- 
precomp -fno-strict-aliasing -pipe -I/usr/local/include
-fno-common - 
DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe
-I/usr/local/ 
include -fno-common -DPERL_DARWIN -no-cpp-precomp
-fno-strict- 
aliasing -pipe -I/usr/local/include -fno-common
-DPERL_DARWIN -no-cpp- 
precomp -fno-strict-aliasing -pipe -I/usr/local/include
-fno-common - 
DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe
-I/usr/local/ 
include'
     ccversion='', gccversion='4.0.0 20041026 (Apple
Computer, Inc.  
build 4061)', gccosandvers='darwin8'
     intsize=4, longsize=4, ptrsize=4, doublesize=8,
byteorder=4321
     d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=16
     ivtype='long', ivsize=4, nvtype='double', nvsize=8,  
Off_t='off_t', lseeksize=8
     alignbytes=8, prototype=define
   Linker and Libraries:
     ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='
-L/usr/ 
local/lib'
     libpth=/usr/local/lib /usr/lib
     libs=-ldbm -ldl -lm -lc
     perllibs=-ldl -lm -lc
     libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, 

libperl=libperl.a
     gnulibc_version=''
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef,
ccdlflags=' '
     cccdlflags=' ', lddlflags=' -bundle -undefined
dynamic_lookup -L/ 
usr/local/lib'

Locally applied patches:
     DEVEL

---
INC
for perl 5.10.0:
     /usr/local/lib/perl5/5.9.5/darwin-2level
     /usr/local/lib/perl5/5.9.5
     /usr/local/lib/perl5/site_perl/5.9.5/darwin-2level
     /usr/local/lib/perl5/site_perl/5.9.5
     .

---
Environment for perl 5.10.0:
     DYLD_LIBRARY_PATH (unset)
     HOME=/Users/neo
     LANG (unset)
     LANGUAGE (unset)
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
    
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/TeX/bin/powerpc- 
darwin6.8:/usr/local/bin
     PERL_BADLANG (unset)
     SHELL=/bin/bash


Re: a" + /$.../ = panic: sv_len_utf8 cache
user name
2007-09-10 16:55:38
On Mon, Sep 10, 2007 at 01:04:59PM -0700, webmasters 
ctosonline. org wrote:
> The following snippet works in 5.9.4 and earlier but
fails in 5.10.0  
> patchlevel 31832:
> 
> $ perl -e'$s="[a]a"; utf8::upgrade $s;
/$s/; print "okn"'
> ok
> $ perl5.10.0 -e'$s="[a]a"; utf8::upgrade
$s; /$s/; print "okn"'
> panic: sv_len_utf8 cache 3 real 2 for aa at -e line 1.
> 
> Apparently this error occurs when a string to be
interpolated in a  
> regexp has the utf8 flag on and contains a character
class followed  
> by literal text with a fixed quantifier > 1.
> 
> A binary search points to change #31246 as being the
culprit.

A closer look reveals that that change (one of mine)
accidentally
unconditionally enabled the utf8 cache debugging code, which
then flagged
up the error. That's now fixed (#31842).

The regex/utf8 bug itself is older. I'll try to have a look
at it sometime
if someone else doesn't beat me to it (hint hint).

-- 
Lady Nancy Astor: If you were my husband, I would flavour
your coffee
with poison.
Churchill: Madam - if I were your husband, I would drink
it.

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )