Hi all,

I am the maintainer and developer of an open source tool called fakeroot-ng. I saw in the archives not long ago that someone asked about fakeroot-net. fakeroot uses LD_PRELOAD to wrap the system calls, while fakeroot-ng uses ptrace. Otherwise, the tools have pretty similar aims.

When I try to run fakeroot-ng through valgrind, I get the following message:
s...@sunlap:~/sources/myfoss/fakeroot-ng/trunk/build_dbg$ /usr/local/bin/valgrind fakeroot-ng
==11750== Memcheck, a memory error detector.
==11750== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al.
==11750== Using LibVEX rev 1884, a library for dynamic binary translation.
==11750== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP.
==11750== Using valgrind-3.4.1, a dynamic binary instrumentation framework.
==11750== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al.
==11750== For more details, rerun with: -v
==11750==
==11750== Mismatched free() / delete / delete []
==11750== at 0x4C2111D: operator delete(void*) (vg_replace_malloc.c:342)
==11750==    by 0x4029F2: (within /usr/local/bin/fakeroot-ng)
==11750==    by 0x55EA1A5: (below main) (in /lib/libc-2.7.so)
==11750==  Address 0x591f2c0 is 0 bytes inside a block of size 24 alloc'd
==11750== at 0x4C21B9C: operator new[](unsigned long) (vg_replace_malloc.c:274)
==11750==    by 0x40294C: (within /usr/local/bin/fakeroot-ng)
==11750==    by 0x55EA1A5: (below main) (in /lib/libc-2.7.so)
==11751==
==11751== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from 1)
==11751== malloc/free: in use at exit: 0 bytes in 0 blocks.
==11751== malloc/free: 6 allocs, 6 frees, 437 bytes allocated.
==11751== For counts of detected errors, rerun with: -v
==11751== All heap blocks were freed -- no leaks are possible.
==11750== Warning: invalid file descriptor -1 in syscall close()
==11750==
==11750== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from 1)
==11750== malloc/free: in use at exit: 384 bytes in 4 blocks.
==11750== malloc/free: 6 allocs, 2 frees, 437 bytes allocated.
==11750== For counts of detected errors, rerun with: -v
==11750== searching for pointers to 4 not-freed blocks.
==11750== checked 192,232 bytes.
==11750==
==11750== LEAK SUMMARY:
==11750==    definitely lost: 0 bytes in 0 blocks.
==11750==      possibly lost: 0 bytes in 0 blocks.
==11750==    still reachable: 384 bytes in 4 blocks.
==11750==         suppressed: 0 bytes in 0 blocks.
==11750== Rerun with --leak-check=full to see details of leaked memory.

valgrind: the 'impossible' happened:
   main(): signal was supposed to be fatal
==11750==    at 0x3802A77C: report_and_quit (m_libcassert.c:140)
==11750== by 0x38187F8E: (within /usr/local/lib/valgrind/amd64-linux/memcheck)
==11750==    by 0x3802BFD0: add_to_myprintf_buf (m_libcprint.c:91)
==11750==    by 0x100000000: ???

sched status:
  running_tid=1


Note: see also the FAQ.txt in the source distribution.
It contains workarounds to several common problems.

If that doesn't help, please report this bug to: www.valgrind.org

In the bug report, send all the above text, the valgrind
version, and what Linux distro you are using.  Thanks.

Otherwise, the program does not appear to run.

I have a theory regarding what the problem is. fakeroot-ng starts the application to debug in the parent process, and the child processes does a fork + exec in order to be the debugger daemon. From reading about valgrind, this should not, in itself, be a problem.

In order to synchronize with the grand-parent process, the debugger sends it a few signals. It then uses its privilege as a debugger in order to prevent some of these signals from actually arriving at the process. I suspect, thought I cannot confirm, that this is what is confusing valgrind.

Other than that, I have not been able to gain any useful information out of the valgrind output.

My system is a Debian Lenny running kernel version 2.6.30 on AMD64, and using the latest released version of fakeroot-ng. I have, however, seen this problem with older versions of just about anything on this list.

Thanks,
Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com


--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to