On Do, 2010-09-09 at 11:22 +0200, Patrick Ohly wrote: > The invalid memory usage occurs inside the Perl interpreter, not > SyncEvolution. You can invoke the "synccompare" script directly to > reproduce the problem. It takes two parameters, the old and new database > dump.
I've recently updated to Debian Testing and ran into the same problem.
Attached is a test case. Steps to reproduce:
$ cd /tmp
$ tar zxf perl-bug.tar.gz
$ perl ./synccompare ical20.before ical20.current
Expected output: none (ical20.before ical20.current are identical, in
this case the file content is shared via hard links)
Actual output:
*** glibc detected *** perl: realloc(): invalid next size: 0x0000000000c8e5b0
***
======= Backtrace: =========
/lib/libc.so.6(+0x71ad6)[0x7ff4a19cfad6]
/lib/libc.so.6(+0x776ec)[0x7ff4a19d56ec]
/lib/libc.so.6(realloc+0xf0)[0x7ff4a19d5a00]
/usr/lib/libperl.so.5.10(Perl_safesysrealloc+0x3f)[0x7ff4a23f587f]
/usr/lib/libperl.so.5.10(Perl_do_readline+0x981)[0x7ff4a2410981]
/usr/lib/libperl.so.5.10(Perl_runops_standard+0x16)[0x7ff4a240ab06]
/usr/lib/libperl.so.5.10(perl_run+0x33c)[0x7ff4a23af6bc]
perl(main+0xec)[0x400d3c]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7ff4a197cc4d]
perl[0x400b89]
======= Memory map: ========
00400000-00401000 r-xp 00000000 fe:01 315228
/usr/bin/perl
00601000-00602000 rw-p 00001000 fe:01 315228
/usr/bin/perl
00b86000-00e85000 rw-p 00000000 00:00 0 [heap]
7ff49c000000-7ff49c021000 rw-p 00000000 00:00 0
7ff49c021000-7ff4a0000000 ---p 00000000 00:00 0
7ff4a0d44000-7ff4a0d5a000 r-xp 00000000 fe:01 72902
/lib/libgcc_s.so.1
7ff4a0d5a000-7ff4a0f59000 ---p 00016000 fe:01 72902
/lib/libgcc_s.so.1
7ff4a0f59000-7ff4a0f5a000 rw-p 00015000 fe:01 72902
/lib/libgcc_s.so.1
7ff4a0f5a000-7ff4a0f60000 r-xp 00000000 fe:01 332775
/usr/lib/perl/5.10.1/auto/PerlIO/encoding/encoding.so
7ff4a0f60000-7ff4a1160000 ---p 00006000 fe:01 332775
/usr/lib/perl/5.10.1/auto/PerlIO/encoding/encoding.so
7ff4a1160000-7ff4a1161000 rw-p 00006000 fe:01 332775
/usr/lib/perl/5.10.1/auto/PerlIO/encoding/encoding.so
7ff4a1161000-7ff4a116b000 r-xp 00000000 fe:01 336935
/usr/lib/perl/5.10.1/auto/Encode/Encode.so
7ff4a116b000-7ff4a136a000 ---p 0000a000 fe:01 336935
/usr/lib/perl/5.10.1/auto/Encode/Encode.so
7ff4a136a000-7ff4a136b000 rw-p 00009000 fe:01 336935
/usr/lib/perl/5.10.1/auto/Encode/Encode.so
7ff4a136b000-7ff4a1727000 r--p 00000000 fe:01 390144
/usr/lib/locale/locale-archive
7ff4a1727000-7ff4a172f000 r-xp 00000000 fe:01 306645
/lib/libcrypt-2.11.2.so
7ff4a172f000-7ff4a192e000 ---p 00008000 fe:01 306645
/lib/libcrypt-2.11.2.so
7ff4a192e000-7ff4a192f000 r--p 00007000 fe:01 306645
/lib/libcrypt-2.11.2.so
7ff4a192f000-7ff4a1930000 rw-p 00008000 fe:01 306645
/lib/libcrypt-2.11.2.so
7ff4a1930000-7ff4a195e000 rw-p 00000000 00:00 0
7ff4a195e000-7ff4a1ab6000 r-xp 00000000 fe:01 242052
/lib/libc-2.11.2.so
7ff4a1ab6000-7ff4a1cb5000 ---p 00158000 fe:01 242052
/lib/libc-2.11.2.so
7ff4a1cb5000-7ff4a1cb9000 r--p 00157000 fe:01 242052
/lib/libc-2.11.2.so
7ff4a1cb9000-7ff4a1cba000 rw-p 0015b000 fe:01 242052
/lib/libc-2.11.2.so
7ff4a1cba000-7ff4a1cbf000 rw-p 00000000 00:00 0
7ff4a1cbf000-7ff4a1cd6000 r-xp 00000000 fe:01 306635
/lib/libpthread-2.11.2.so
7ff4a1cd6000-7ff4a1ed5000 ---p 00017000 fe:01 306635
/lib/libpthread-2.11.2.so
7ff4a1ed5000-7ff4a1ed6000 r--p 00016000 fe:01 306635
/lib/libpthread-2.11.2.so
7ff4a1ed6000-7ff4a1ed7000 rw-p 00017000 fe:01 306635
/lib/libpthread-2.11.2.so
7ff4a1ed7000-7ff4a1edb000 rw-p 00000000 00:00 0
7ff4a1edb000-7ff4a1f5b000 r-xp 00000000 fe:01 306643
/lib/libm-2.11.2.so
7ff4a1f5b000-7ff4a215b000 ---p 00080000 fe:01 306643
/lib/libm-2.11.2.so
7ff4a215b000-7ff4a215c000 r--p 00080000 fe:01 306643
/lib/libm-2.11.2.so
7ff4a215c000-7ff4a215d000 rw-p 00081000 fe:01 306643
/lib/libm-2.11.2.so
7ff4a215d000-7ff4a215f000 r-xp 00000000 fe:01 242051
/lib/libdl-2.11.2.so
7ff4a215f000-7ff4a235f000 ---p 00002000 fe:01 242051
/lib/libdl-2.11.2.so
7ff4a235f000-7ff4a2360000 r--p 00002000 fe:01 242051
/lib/libdl-2.11.2.so
7ff4a2360000-7ff4a2361000 rw-p 00003000 fe:01 242051
/lib/libdl-2.11.2.so
7ff4a2361000-7ff4a24c5000 r-xp 00000000 fe:01 615988
/usr/lib/libperl.so.5.10.1
7ff4a24c5000-7ff4a26c5000 ---p 00164000 fe:01 615988
/usr/lib/libperl.so.5.10.1
7ff4a26c5000-7ff4a26ce000 rw-p 00164000 fe:01 615988
/usr/lib/libperl.so.5.10.1
7ff4a26ce000-7ff4a26ec000 r-xp 00000000 fe:01 306646
/lib/ld-2.11.2.so
7ff4a28c7000-7ff4a28cc000 rw-p 00000000 00:00 0
7ff4a28e9000-7ff4a28eb000 rw-p 00000000 00:00 0
7ff4a28eb000-7ff4a28ec000 r--p 0001d000 fe:01 306646
/lib/ld-2.11.2.so
7ff4a28ec000-7ff4a28ed000 rw-p 0001e000 fe:01 306646
/lib/ld-2.11.2.so
7ff4a28ed000-7ff4a28ee000 rw-p 00000000 00:00 0
7fffec861000-7fffec876000 rw-p 00000000 00:00 0 [stack]
7fffec8aa000-7fffec8ab000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0
[vsyscall]
Aborted
Under valgrind:
$ valgrind perl ./synccompare ical20.before ical20.current
==17895== Memcheck, a memory error detector
==17895== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==17895== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for
copyright info
==17895== Command: perl ./synccompare ical20.before ical20.current
==17895==
==17895== Conditional jump or move depends on uninitialised value(s)
==17895== at 0x4EB3C26: Perl_re_compile (in /usr/lib/libperl.so.5.10.1)
==17895== by 0x4E6C955: Perl_pmruntime (in /usr/lib/libperl.so.5.10.1)
==17895== by 0x4E9DE29: Perl_yyparse (in /usr/lib/libperl.so.5.10.1)
==17895== by 0x4E795E0: ??? (in /usr/lib/libperl.so.5.10.1)
==17895== by 0x4E7A732: perl_parse (in /usr/lib/libperl.so.5.10.1)
==17895== by 0x400CCB: main (in /usr/bin/perl)
==17895==
==17895== Invalid write of size 8
==17895== at 0x4EDBC1A: Perl_pp_concat (in /usr/lib/libperl.so.5.10.1)
==17895== by 0x4ED2B05: Perl_runops_standard (in /usr/lib/libperl.so.5.10.1)
==17895== by 0x4E776BB: perl_run (in /usr/lib/libperl.so.5.10.1)
==17895== by 0x400D3B: main (in /usr/bin/perl)
==17895== Address 0x60652f0 is 4,048 bytes inside a block of size 4,080 free'd
==17895== at 0x4C240FD: free (vg_replace_malloc.c:366)
==17895== by 0x4ED0E25: Perl_av_extend (in /usr/lib/libperl.so.5.10.1)
==17895== by 0x4F05861: Perl_stack_grow (in /usr/lib/libperl.so.5.10.1)
==17895== by 0x4EEA0B2: Perl_sv_recode_to_utf8 (in
/usr/lib/libperl.so.5.10.1)
[...]
before sync | after sync
removed during sync <
> added during sync
-------------------------------------------------------------------------------
[...]
Note that the print statements inside "if (-d $file1 && -d $file2)"
affect the output. Currently they are commented out, enabling them makes
the script work as expected. Valgrind still reports the first warning,
though.
Simplifying the problem size by removing files inside
ical20.after/current avoids the problem.
David, can you reassign this to the Perl interpreter?
--
Best Regards, Patrick Ohly
The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
perl-bug.tar.gz
Description: application/compressed-tar

