[cctbxbb] iotbx::pdb and boost::unit_test::framework

vanv0059 at umn.edu vanv0059 at umn.edu
Tue Dec 13 08:34:05 PST 2011


Hi,

Is it reasonable to assume that the boost unit test framework (boost::test) 
is compatible with cctbx's iotbx::pdb? Or might boost::test's handling of 
memory clash with that of cctbx?

I can get simple examples with iotbx::pdb::input by itself or a print 
statement wrapped by boost test to work fine on Linux (gcc 4.1.2). What I 
am having issues with is replacing the print statement & include file with 
iotbx::pdb::input (even if no file is opened). If the answer to the above 
question is: "it is reasonable", then would it be better to post my 
question to the c++ sig group?

The simple example is:

#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE test_iotbx_pdb_input
#include <boost/test/unit_test.hpp>
#include <iotbx/pdb/input.h>
BOOST_AUTO_TEST_CASE(test_iotbx_pdb_input)
{  iotbx::pdb::input p; }

Both gdb and valgrind complain about the example program trying to access 
addr 0x1

gdb traceback:

#0  0x00002aaaab74be75 in free () from /lib64/libc.so.6
#1  0x00002aaaaad1a768 in boost::checked_array_delete<char> (
    x=0x1 <Address 0x1 out of bounds>)
    at 
/home/msi/vanvoors/code/test_cctbx/cctbx_sources/boost/boost/checked_delete.hpp:41
#2  0x00002aaaaad1a783 in boost::checked_array_deleter<char>::operator() (
    this=0x5103e8, x=0x1 <Address 0x1 out of bounds>)
    at 
/home/msi/vanvoors/code/test_cctbx/cctbx_sources/boost/boost/checked_delete.hpp:63
#3 0x00002aaaaad1a8b1 in boost::detail::sp_counted_impl_pd<char*, 
boost::checked_array_deleter<char> >::dispose (this=0x5103d0)
    at 
/home/msi/vanvoors/code/test_cctbx/cctbx_sources/boost/boost/smart_ptr/detail/sp_counted_impl.hpp:148
#4 0x00002aaaab028d78 in boost::runtime::cla::parser::parse(int&, char**) 
()
   from 
/home/msi/vanvoors/code/test_cctbx/cctbx_sources/boost/stage/lib/libboost_unit_test_framework.so.1.48.0
#5  0x0000000000000000 in ?? ()

valgrind note:

==26968== Invalid free() / delete / delete[] / realloc()
==26968== at 0x4A20E72: operator delete[](void*) (vg_replace_malloc.c:490)
==26968== by 0x4C79767: void boost::checked_array_delete<char>(char*) 
(checked_delete.hpp:41)
==26968== by 0x4C79782: 
boost::checked_array_deleter<char>::operator()(char*)
 const (checked_delete.hpp:63)
==26968== by 0x4C798B0: boost::detail::sp_counted_impl_pd<char*, 
boost::checked_array_deleter<char> >::dispose() (sp_counted_impl.hpp:148)
==26968== by 0x4F86D77: boost::runtime::cla::parser::parse(int&, char**) 
(in
/home/msi/vanvoors/code/test_cctbx/cctbx_sources/boost_1_48_0/stage/lib/libboost_unit_test_framework.so.1.48.0)
==26968== by 0x4F65E6F: boost::unit_test::runtime_config::init(int&, 
char**)
(in 
/home/msi/vanvoors/code/test_cctbx/cctbx_sources/boost_1_48_0/stage/lib/libb
oost_unit_test_framework.so.1.48.0)
==26968== by 0x4F455E0: boost::unit_test::framework::init(bool (*)(), int, 
ch
ar**) (in 
/home/msi/vanvoors/code/test_cctbx/cctbx_sources/boost_1_48_0/stage/li
b/libboost_unit_test_framework.so.1.48.0)
==26968== by 0x4F59D7E: boost::unit_test::unit_test_main(bool (*)(), int, 
cha
r**) (in 
/home/msi/vanvoors/code/test_cctbx/cctbx_sources/boost_1_48_0/stage/lib
/libboost_unit_test_framework.so.1.48.0)
==26968==    by 0x407377: main (unit_test.hpp:59)
==26968==  Address 0x1 is not stack'd, malloc'd or (recently) free'd




More information about the cctbxbb mailing list