|
From: Ilia B. <ib...@an...> - 2004-10-01 21:47:58
Attachments:
testBDB.cpp
|
Hi all, Has anyone run into a problem w/ valgrind memory checker tool and Berkeley DB's C++ library wrapper? I have a trivial piece of code that uses libdb_cxx which runs fine on its own, but throws an exception under valgrind (see attached, its meant to have memory holes). Similar piece of code that only uses libdb seems to work fine. I get the following output ==25738== Memcheck, a memory error detector for x86-linux. ==25738== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al. ==25738== Using valgrind-2.2.0, a program supervision framework for x86-linux. ==25738== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al. ==25738== For more details, rerun with: -v ==25738== Opening environment in ./dbdir/ Exception: DbEnv::open: Function not implemented ==25738== ==25738== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 25 from 1) ==25738== malloc/free: in use at exit: 224 bytes in 3 blocks. ==25738== malloc/free: 40 allocs, 37 frees, 7730 bytes allocated. ==25738== For a detailed leak analysis, rerun with: --leak-check=yes ==25738== For counts of detected errors, rerun with: -v That exception above does not occur when running on its own. I can't quite figure out why. I tried a statically linked version and a dynamically linked one w/ similar results. I was attempting to run valgrind simply with --tool=memcheck. Am I missing something? -ilia |
|
From: Dimitri Papadopoulos-O. <pap...@sh...> - 2004-10-04 08:18:37
|
Hi, > Has anyone run into a problem w/ valgrind memory checker tool > and Berkeley DB's C++ library wrapper? I have a trivial piece of > code that uses libdb_cxx which runs fine on its own, but > throws an exception under valgrind (see attached, its meant > to have memory holes). Similar piece of code that only uses > libdb seems to work fine. > [...] > Opening environment in ./dbdir/ > Exception: DbEnv::open: Function not implemented Which Linux distribution is this? This could be related to bug 86381 of Red Hat Linux 9: http://bugzilla.redhat.com/bugzilla/long_list.cgi?buglist=86381 Dimitri |
|
From: Ilia B. <ib...@an...> - 2004-10-04 16:44:47
|
Yep, that fixed it. Thanks a lot. I suspect there's no harm in testing your application w/ valgrind against db compiled w/ gcc mutexes, while running it for real against db compiled w/ pthread mutexes. We do run nptl kernels here (fc1). -ilia On Mon, 2004-10-04 at 06:48, Bruce Stephens wrote: > Ilia Baldine <ib...@an...> writes: > [...] > > > Has anyone run into a problem w/ valgrind memory checker tool and > > Berkeley DB's C++ library wrapper? I have a trivial piece of code > > that uses libdb_cxx which runs fine on its own, but throws an > > exception under valgrind (see attached, its meant to have memory > > holes). Similar piece of code that only uses libdb seems to work > > fine. > > I haven't seen that, but I've seen some problems with libdb on NPTL > kernels. It appears that sometimes the db build decides to enable > pthreads mutexes rather than x86/gcc-assembly ones (you can see which > it's chosen by looking in db_config.h). valgrind works again for us > when we configure with --with-mutex=x86/gcc-assembly to force the > choice. > > [...] -- ----------------------------------------+---------------------- Ilia Baldine, PhD | ib...@an... Principal Engineer, | ph#:(919)248-1847 Advanced Networking Research, MCNC-RDI | FAX:(919)248-1455 http://people.anr.mcnc.org/~ibaldin | ----------------------------------------+---------------------- "Whenever you find yourself on the side of the majority, it is time to reform." - Mark Twain --------------------------------------------------------------- |