I am tracking down this bug. It appears to occur only if outputPos or inputPos is not NULL. John On Thu, Sep 06, 2012 at 10:30:51AM +0200, Christian Egli wrote: > Hi all > > James Teh <jamie@xxxxxxxxxxxx> writes: > > > I guess I'd have to write this test in C, but am not sure about the > > harness for C tests now. > > It's pretty much the same as it was before. > > >> Do you have a recipe to reproduce it? > > See my original post: > > //www.freelists.org/post/liblouis-liblouisxml/lou-translate-causes-access-violation-with-pass1Only-mode > > I spent a bit of time to create a test case for this and run it through > valgrind. See tests/pass1Only.c for the test case. Then I ran the test > through valgrind as described in HACKING, i.e. as follows: > > $ libtool --mode=execute valgrind -v --tool=memcheck \ > > --leak-check=full --show-reachable=yes \ > > --leak-resolution=high --track-origins=yes \ > > --log-file=valgrind.log ./tests/pass1Only > > The resulting log file says that there are no problems (see attachment). > James can you look at my test case and tell me if I did a correct > translation from the Python code? > > Thanks > Christian > Content-Description: Valgrind log file > ==22193== Memcheck, a memory error detector > ==22193== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al. > ==22193== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info > ==22193== Command: /home/eglic/src/liblouis.clean/tests/.libs/lt-pass1Only > ==22193== Parent PID: 32343 > ==22193== > --22193-- > --22193-- Valgrind options: > --22193-- --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp > --22193-- -v > --22193-- --tool=memcheck > --22193-- --leak-check=full > --22193-- --show-reachable=yes > --22193-- --leak-resolution=high > --22193-- --track-origins=yes > --22193-- --log-file=valgrind.log > --22193-- Contents of /proc/version: > --22193-- Linux version 3.2.0-29-generic (buildd@allspice) (gcc version > 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC > 2012 > --22193-- Arch and hwcaps: AMD64, amd64-sse3-cx16 > --22193-- Page sizes: currently 4096, max supported 4096 > --22193-- Valgrind library directory: /usr/lib/valgrind > --22193-- Reading syms from > /home/eglic/src/liblouis.clean/tests/.libs/lt-pass1Only (0x400000) > --22193-- Reading syms from /lib/x86_64-linux-gnu/ld-2.15.so (0x4000000) > --22193-- Considering /lib/x86_64-linux-gnu/ld-2.15.so .. > --22193-- .. CRC mismatch (computed c5d70380 wanted 7d4a76d0) > --22193-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.15.so .. > --22193-- .. CRC is valid > --22193-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux > (0x38000000) > --22193-- Considering /usr/lib/valgrind/memcheck-amd64-linux .. > --22193-- .. CRC mismatch (computed b9a585cc wanted 749d1a67) > --22193-- object doesn't have a symbol table > --22193-- object doesn't have a dynamic symbol table > --22193-- Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp > --22193-- Reading suppressions file: /usr/lib/valgrind/default.supp > ==22193== embedded gdbserver: reading from > /tmp/vgdb-pipe-from-vgdb-to-22193-by-eglic-on-??? > ==22193== embedded gdbserver: writing to > /tmp/vgdb-pipe-to-vgdb-from-22193-by-eglic-on-??? > ==22193== embedded gdbserver: shared mem > /tmp/vgdb-pipe-shared-mem-vgdb-22193-by-eglic-on-??? > ==22193== > ==22193== TO CONTROL THIS PROCESS USING vgdb (which you probably > ==22193== don't want to do, unless you know exactly what you're doing, > ==22193== or are doing some strange experiment): > ==22193== /usr/lib/valgrind/../../bin/vgdb --pid=22193 ...command... > ==22193== > ==22193== TO DEBUG THIS PROCESS USING GDB: start GDB like this > ==22193== /path/to/gdb > /home/eglic/src/liblouis.clean/tests/.libs/lt-pass1Only > ==22193== and then give GDB the following command > ==22193== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=22193 > ==22193== --pid is optional if only one valgrind process is running > ==22193== > --22193-- REDIR: 0x40189e0 (strlen) redirected to 0x380625c7 (???) > --22193-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so > (0x4a25000) > --22193-- Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so .. > --22193-- .. CRC mismatch (computed c82927cb wanted 1861273b) > --22193-- object doesn't have a symbol table > --22193-- Reading syms from > /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so (0x4c27000) > --22193-- Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so .. > --22193-- .. CRC mismatch (computed 72e29ec9 wanted f3ad49da) > --22193-- object doesn't have a symbol table > --22193-- REDIR: 0x4018850 (index) redirected to 0x4c2bc60 (index) > --22193-- REDIR: 0x40188d0 (strcmp) redirected to 0x4c2cc20 (strcmp) > --22193-- Reading syms from > /home/eglic/src/liblouis.clean/liblouis/.libs/liblouis.so.2.3.0 (0x4e32000) > --22193-- Reading syms from /lib/x86_64-linux-gnu/libc-2.15.so (0x5056000) > --22193-- Considering /lib/x86_64-linux-gnu/libc-2.15.so .. > --22193-- .. CRC mismatch (computed 0dfc7f92 wanted 306696b6) > --22193-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.15.so .. > --22193-- .. CRC is valid > --22193-- REDIR: 0x50e28c0 (strcasecmp) redirected to 0x4a25610 > (_vgnU_ifunc_wrapper) > --22193-- REDIR: 0x50dec60 (strnlen) redirected to 0x4a25610 > (_vgnU_ifunc_wrapper) > --22193-- REDIR: 0x50e4b90 (strncasecmp) redirected to 0x4a25610 > (_vgnU_ifunc_wrapper) > --22193-- REDIR: 0x50e0650 (__GI_strrchr) redirected to 0x4c2ba80 > (__GI_strrchr) > --22193-- REDIR: 0x50d89d0 (malloc) redirected to 0x4c2b660 (malloc) > --22193-- REDIR: 0x50deb80 (__GI_strlen) redirected to 0x4c2bfc0 (__GI_strlen) > --22193-- REDIR: 0x50ded80 (__GI_strncmp) redirected to 0x4c2c480 > (__GI_strncmp) > --22193-- REDIR: 0x50de4d0 (strcpy) redirected to 0x4a25610 > (_vgnU_ifunc_wrapper) > --22193-- REDIR: 0x50ec5f0 (__strcpy_sse2_unaligned) redirected to 0x4c2bfe0 > (strcpy) > --22193-- REDIR: 0x50e16a0 (memset) redirected to 0x4a25610 > (_vgnU_ifunc_wrapper) > --22193-- REDIR: 0x50e16e0 (__GI_memset) redirected to 0x4c2e080 (memset) > --22193-- REDIR: 0x50e7270 (memcpy@@GLIBC_2.14) redirected to 0x4a25610 > (_vgnU_ifunc_wrapper) > --22193-- REDIR: 0x519c790 (__memcpy_ssse3_back) redirected to 0x4c2cf30 > (memcpy@@GLIBC_2.14) > --22193-- REDIR: 0x50dcd80 (strcat) redirected to 0x4a25610 > (_vgnU_ifunc_wrapper) > --22193-- REDIR: 0x50ef410 (__strcat_sse2_unaligned) redirected to 0x4c2bca0 > (strcat) > --22193-- REDIR: 0x50d9010 (free) redirected to 0x4c2a7c0 (free) > ==22193== > ==22193== HEAP SUMMARY: > ==22193== in use at exit: 0 bytes in 0 blocks > ==22193== total heap usage: 17 allocs, 17 frees, 75,895 bytes allocated > ==22193== > ==22193== All heap blocks were freed -- no leaks are possible > ==22193== > ==22193== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2) > --22193-- > --22193-- used_suppression: 2 dl-hack3-cond-1 > ==22193== > ==22193== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2) > > -- > Christian Egli > Swiss Library for the Blind, Visually Impaired and Print Disabled > Grubenstrasse 12, CH-8045 Zürich, Switzerland -- John J. Boyer; President, Chief Software Developer Abilitiessoft, Inc. http://www.abilitiessoft.com Madison, Wisconsin USA Developing software for people with disabilities For a description of the software, to download it and links to project pages go to http://www.abilitiessoft.com