On Wed, Dec 01, 2004 at 11:59:13PM +0200, Jarkko Hietaniemi wrote:
> Jarkko Hietaniemi wrote:
> > Jarkko Hietaniemi wrote:
> > 
> >>Argh, duh.  Please ignore my earlier analysis, mostly.
> >>I need to go back to the beginning and redo the "cutting
> >>down" exercise.
> > 
> > 
> > Now I know more - useithreads matters.  The breakage happens
> > with the combination of -Duseithreads and the UTF-8 locales.
> > Fun.  Could we get MakeMaker in there somehow? :-)

Aha. I didn't have ithreads. I've recompiled with ithreads.

> Okay, here's a re-cut-down version of the test that still gives
> the two original warnings (with linenumbers changed, though).
> Cutting down seemed to be an awfully unpredictable and not making
> much sense in general, so I don't expect that the same script will
> trigger the bug in any other system or environment.
> 
> The corruption always seems to be in the filenames.  Or, at least,
> the corruption that is detected by the /^File (.*)/.  Namely, there
> seems to be other corruption going on in the xreftest.out.  For example:
> 
> File TUUEUUUUUUUU
>   Subroutine (definitions)
>     Package Test::More
>       &_bogus_sort      s1120
>       &_carp            s15
>       &_deep_check      s945
>       &_export_to_level  s46
>       &_format_stack    s950
>       ...
> 
> Then there is a package called "\x3f" with a single variable "\x3f\x3f".

It's a portable problem:

$ LANG=fa_IR.UTF-8 valgrind ./perl -C63 B8==26752== Memcheck, a memory error 
detector for x86-linux.
==26752== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==26752== Using valgrind-2.2.0, a program supervision framework for x86-linux.
==26752== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==26752== For more details, rerun with: -v
==26752== 
==26752== Invalid read of size 1
==26752==    at 0x1B904788: strlen (mac_replace_strmem.c:189)
==26752==    by 0x8100325: Perl_sv_setpv (sv.c:4839)
==26752==    by 0x1C00C9B4: XS_B__GV_FILE (B.c:3823)
==26752==    by 0x80F3C7C: Perl_pp_entersub (pp_hot.c:2826)
==26752==  Address 0x1BBBFE60 is 0 bytes inside a block of size 20 free'd
==26752==    at 0x1B905460: free (vg_replace_malloc.c:153)
==26752==    by 0x8130A4D: Perl_leave_scope (scope.c:727)
==26752==    by 0x812E701: Perl_pop_scope (scope.c:125)
==26752==    by 0x80F1823: Perl_pp_leavesub (pp_hot.c:2411)
==26752== 
==26752== Invalid read of size 1
==26752==    at 0x1B904791: strlen (mac_replace_strmem.c:189)
==26752==    by 0x8100325: Perl_sv_setpv (sv.c:4839)
==26752==    by 0x1C00C9B4: XS_B__GV_FILE (B.c:3823)
==26752==    by 0x80F3C7C: Perl_pp_entersub (pp_hot.c:2826)
==26752==  Address 0x1BBBFE61 is 1 bytes inside a block of size 20 free'd
==26752==    at 0x1B905460: free (vg_replace_malloc.c:153)
==26752==    by 0x8130A4D: Perl_leave_scope (scope.c:727)
==26752==    by 0x812E701: Perl_pop_scope (scope.c:125)
==26752==    by 0x80F1823: Perl_pp_leavesub (pp_hot.c:2411)
==26752== 
==26752== Invalid read of size 4
==26752==    at 0x1BA2F19B: memmove (in /lib/tls/libc-2.3.2.so)
==26752==  Address 0x1BBBFE60 is 0 bytes inside a block of size 20 free'd
==26752==    at 0x1B905460: free (vg_replace_malloc.c:153)
==26752==    by 0x8130A4D: Perl_leave_scope (scope.c:727)
==26752==    by 0x812E701: Perl_pop_scope (scope.c:125)
==26752==    by 0x80F1823: Perl_pp_leavesub (pp_hot.c:2411)
==26752== 
==26752== Invalid read of size 1
==26752==    at 0x1BA2F1A3: memmove (in /lib/tls/libc-2.3.2.so)
==26752==  Address 0x1BBC4DE4 is 20 bytes inside a block of size 23 free'd
==26752==    at 0x1B905460: free (vg_replace_malloc.c:153)
==26752==    by 0x8130A4D: Perl_leave_scope (scope.c:727)
==26752==    by 0x812E701: Perl_pop_scope (scope.c:125)
==26752==    by 0x80F1823: Perl_pp_leavesub (pp_hot.c:2411)
==26752== 
==26752== Conditional jump or move depends on uninitialised value(s)
==26752==    at 0x8175BA2: S_regrepeat (regexec.c:4041)
==26752==    by 0x8174956: S_regmatch (regexec.c:3737)
==26752==    by 0x817272C: S_regmatch (regexec.c:3294)
==26752==    by 0x8171CCF: S_regmatch (regexec.c:3126)
==26752== 
==26752== Conditional jump or move depends on uninitialised value(s)
==26752==    at 0x816EC86: S_regmatch (regexec.c:2409)
==26752==    by 0x8172944: S_regmatch (regexec.c:3319)
==26752==    by 0x8174FE8: S_regmatch (regexec.c:3789)
==26752==    by 0x817272C: S_regmatch (regexec.c:3294)
==26752== 
==26752== Conditional jump or move depends on uninitialised value(s)
==26752==    at 0x816EC9C: S_regmatch (regexec.c:2409)
==26752==    by 0x8172944: S_regmatch (regexec.c:3319)
==26752==    by 0x8174FE8: S_regmatch (regexec.c:3789)
==26752==    by 0x817272C: S_regmatch (regexec.c:3294)
==26752== warning: Valgrind's siglongjmp is incomplete
==26752==          (it ignores cleanup handlers)
==26752==          your program may misbehave as a result
==26752== 
==26752== ERROR SUMMARY: 2505 errors from 7 contexts (suppressed: 25 from 1)
==26752== malloc/free: in use at exit: 1847229 bytes in 33590 blocks.
==26752== malloc/free: 78042 allocs, 44452 frees, 2744821 bytes allocated.
==26752== For a detailed leak analysis,  rerun with: --leak-check=yes
==26752== For counts of detected errors, rerun with: -v


The regexp bugs showed up without ithreads.

Nicholas Clark

Reply via email to