develooper Front page | perl.perl5.porters | Postings from July 2000

[ID 20000730.003] utf8::length() bad

Thread Next
From:
Jeffrey Friedl
Date:
July 31, 2000 11:14
Subject:
[ID 20000730.003] utf8::length() bad
Message ID:
200007302042.NAA07976@ventrue.yahoo.com

This is a bug report for perl from jfriedl@yahoo-inc.com,
generated with the help of perlbug 1.28 running under perl v5.6.0.

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

Hi,

   % perl -mutf8 -e "print utf8::length('a')"

causes my cpu to peg, and memory to grow until I break out of it.

I tried running it in gdb, got a segfault report immediately, but the
thing kept running (and sucking memory) until I broke out of it:

    (gdb) run -mutf8 -e "print utf8::length('a')"
    Starting program: /usr/src/perl-5.6.0/perl -mutf8 -e "print utf8::length('a')"
    Segmentation fault (core dumped)

--- several seconds pass, then I interrupt it ---

    Program received signal SIGINT, Interrupt.
    0x8091349 in Perl_hv_fetch (hv=0x80f08e0, key=0xbffff0e4 "utf8::", klen=6, 
	lval=1) at hv.c:181
    181         PERL_HASH(hash, key, klen);
    (gdb) where
    #0  0x8091349 in Perl_hv_fetch (hv=0x80f08e0, key=0xbffff0e4 "utf8::", klen=6, 
	lval=1) at hv.c:181
    #1  0x805fe73 in Perl_gv_fetchpv (nambeg=0x80fcb10 "utf8::length", add=1, 
	sv_type=12) at gv.c:550
    #2  0x80a11e3 in Perl_sv_2cv (sv=0x80fb010, st=0xbffff224, gvp=0xbffff228, 
	lref=1) at sv.c:4981
    #3  0x80a3fde in Perl_pp_rv2cv () at pp.c:379
    #4  0x80949ed in Perl_runops_standard () at run.c:27
    #5  0x805bd4e in S_run_body (oldscope=1) at perl.c:1401
    #6  0x805bad8 in perl_run (my_perl=0x80f0858) at perl.c:1325
    #7  0x8059903 in main (argc=4, argv=0xbffff354, env=0xbffff368)
	at perlmain.c:52

Even though I have my coredumplimit set to zero, when running this from
within gdb, it does dump a small (360k) core file. On a whim, I ran

    jfriedl@fummy> gdb /usr/src/perl-5.6.0/perl core
    GNU gdb 4.18
    Copyright 1998 Free Software Foundation, Inc.
    This GDB was configured as "i386-mandrake-linux"...

    warning: core file may not match specified executable file.
    Core was generated by `perl -w test -d /etc/profile.d'.
    Program terminated with signal 11, Segmentation fault.
    Reading symbols from /lib/libnsl.so.1...done.
    Reading symbols from /lib/libdb.so.3...done.
    Reading symbols from /usr/lib/libgdbm.so.2...done.
    Reading symbols from /lib/libdl.so.2...done.
    Reading symbols from /lib/libm.so.6...done.
    Reading symbols from /lib/libc.so.6...done.
    Reading symbols from /lib/libcrypt.so.1...done.
    Reading symbols from /lib/ld-linux.so.2...done.
    #0  0x400fd1f4 in memmove () from /lib/libc.so.6
    (gdb) where
    #0  0x400fd1f4 in memmove () from /lib/libc.so.6
    #1  0x80faf7c in ?? ()
    Cannot access memory at address 0x1.

Which seems odd, to say the least.

	Jeffrey



[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl v5.6.0:

Configured by jfriedl at Sat Jul 29 20:09:33 PDT 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.15, archname=i686-linux
    uname='linux fummy.dsl.yahoo.com 2.2.16 #6 smp sun jul 23 11:26:16 pdt 2000 i686 unknown '
    config_args='-ds -e -A optimize=-g'
    hint=previous, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='cc', optimize='-O2 -g', gccversion=pgcc-2.91.66 19990314 (egcs-1.1.2 release)
    cppflags='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    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, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=/lib/libc-2.1.1.so, 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'

Locally applied patches:
    

---
@INC for perl v5.6.0:
    /home/jfriedl/lib/perl
    /home/jfriedl/lib/perl/yahoo
    /usr/local/lib/perl5/5.6.0/i686-linux
    /usr/local/lib/perl5/5.6.0
    /usr/local/lib/perl5/site_perl/5.6.0/i686-linux
    /usr/local/lib/perl5/site_perl/5.6.0
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl v5.6.0:
    HOME=/home/jfriedl
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/usr/local/pgsql/lib:/home/jfriedl/src/rvplayer5.0
    LOGDIR (unset)
    PATH=/home/jfriedl/bin:/home/jfriedl/common/bin:/usr/local/gcc-2.95.2/bin:.:/usr/local/pgsql/bin:/usr/local/bin:/usr/X11R6/bin:/bin:/usr/bin:/usr/sbin:/sbin:/home/jfriedl/src/rvplayer5.0
    PERLLIB=/home/jfriedl/lib/perl:/home/jfriedl/lib/perl/yahoo
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About