[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[ID 20000121.004] [BUG t/lib/English.t 5.005_63] Segfault, probably due to tying.



I appear to have stumbled upon a tie() bug in 5.005_63.  When
attempting to test the patch to English.pm I posted previously (I
attached the patched library.)

The segfault occurs when I try to test English.pm with t/lib/english.t:

perl@athens:/usr/local/src/perl5.005_63/t$ ./perl -w lib/english.t 
1..16
ok 1
ok 2
ok 3
Use of uninitialized value in print at lib/english.t line 26.
Segmentation fault

The segfault occurs on line 26:

        print $PREMATCH, $MATCH, $POSTMATCH;

$PREMATCH, $MATCH and $POSTMATCH at this point are all variables tied
into English::Evil so I presume this is a tying problem and the stack
trace seems to confirm that.

Here is a stack trace from the point of the segfault.

#0  0x400e8c25 in memmove () from /lib/libc.so.6
#1  0x80c18de in Perl_sv_setpvn (sv=0x813f420, 
    ptr=0x5 <Address 0x5 out of bounds>, len=5) at sv.c:2720
#2  0x80a7d2f in Perl_magic_get (sv=0x813f420, mg=0x8193308) at mg.c:547
#3  0x80a703b in Perl_mg_get (sv=0x813f420) at mg.c:96
#4  0x80c084c in Perl_sv_setsv (dstr=0x813f42c, sstr=0x813f420) at sv.c:2452
#5  0x80c598d in Perl_sv_mortalcopy (oldstr=0x813f420) at sv.c:4216
#6  0x80e6e5e in Perl_pp_return () at pp_ctl.c:1819
#7  0x80b223d in Perl_runops_debug () at run.c:56
#8  0x805d67d in S_call_xbody (myop=0xbffff848, is_eval=0) at perl.c:1476
#9  0x805cfa5 in perl_call_sv (sv=0x81532fc, flags=0) at perl.c:1365
#10 0x805cd9d in perl_call_method (methname=0x812118e "FETCH", flags=0)
    at perl.c:1315
#11 0x80a90ae in S_magic_methcall (sv=0x8146588, mg=0x815aa48, 
    meth=0x812118e "FETCH", flags=0, n=2, val=0x0) at mg.c:1062
#12 0x80a923c in S_magic_methpack (sv=0x8146588, mg=0x815aa48, 
    meth=0x812118e "FETCH") at mg.c:1074
#13 0x80a93b3 in Perl_magic_getpack (sv=0x8146588, mg=0x815aa48) at mg.c:1087
#14 0x80a703b in Perl_mg_get (sv=0x8146588) at mg.c:96
#15 0x80bf411 in Perl_sv_2pv (sv=0x8146588, lp=0xbffffa54) at sv.c:2026
#16 0x8104004 in Perl_do_print (sv=0x8146588, fp=0x40169b00) at doio.c:1044
#17 0x80b3fe2 in Perl_pp_print () at pp_hot.c:393
#18 0x80b223d in Perl_runops_debug () at run.c:56
#19 0x805c99f in S_run_body (args=0xbffffb64) at perl.c:1205
#20 0x80dcd42 in Perl_vdefault_protect (pcur_env=0xbffffb84, excpt=0xbffffc34, 
    body=0x805c818 <S_run_body>, args=0xbffffb44) at scope.c:45
#21 0x80dcc51 in Perl_default_protect (pcur_env=0xbffffb84, excpt=0xbffffc34, 
    body=0x805c818 <S_run_body>) at scope.c:26
#22 0x805c576 in perl_run (my_perl=0x8132808) at perl.c:1138
#23 0x8059995 in main (argc=2, argv=0xbffffcd4, env=0xbffffce0)
    at perlmain.c:53


The segfault does not occur if 5.005_03 is used.

----

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.2.10, archname=i686-linux
    uname='linux athens 2.2.10 #3 smp mon aug 2 16:48:09 edt 1999 i686 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-O6', gccversion=2.95.2 19991109 (Debian GNU/Linux)
    cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    stdchar='char', d_stdstdio=undef, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under linux
  Compiled at Dec 20 1999 16:46:02
  @INC:
    /usr/lib/perl5/5.00503/i686-linux
    /usr/lib/perl5/5.00503
    /usr/lib/perl5/site_perl/5.005/i686-linux
    /usr/lib/perl5/site_perl/5.005
    .


-- 

Michael G Schwern                                           schwern@pobox.com
                    http://www.pobox.com/~schwern
     /(?:(?:(1)[.-]?)?\(?(\d{3})\)?[.-]?)?(\d{3})[.-]?(\d{4})(x\d+)?/i

English.pm


Follow-Ups from:
Gurusamy Sarathy <gsar@ActiveState.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]