[Coin-discuss] Problems with segmentation fault in BCP

Carlos Eduardo de Andrade ce.andrade at gmail.com
Wed Jan 4 15:07:04 EST 2006


Hellow,

I'm coding a branch-and-price algo using BCP. But I have a trouble
that can't see solution. The program stop with segmentation fault
signal in BCP_lp_branching.cpp:563:

delete node.user_data;

The line above is in BCP_lp_make_parent_from_node() function. I
verified the user_data pointer and it is valid. The destructor is
correct too (a virtual implementation of BCP_user_data destructor). My
gdb backtrace is:

#0  0x00000029 in ?? ()
#1  0x0813816c in ?? ()
#2  0x00000010 in ?? ()
#3  0x0808cde3 in BCP_lp_branch (p=@0x8134be0) at
/opt/COIN/Bcp/LP/BCP_lp_branching.cpp:623

The line 623 calls the function BCP_lp_make_parent_from_node(p) where
the problem occur.

The valgrind output is

==29507== Invalid read of size 4
==29507==    at 0x808DCDA: BCP_lp_make_parent_from_node(BCP_lp_prob&)
(BCP_lp_branching.cpp:564)
==29507==    by 0x42AB935: __libc_start_main (in /lib/libc-2.3.2.so)
==29507==  Address 0x43EB678 is 0 bytes inside a block of size 36 free'd
==29507==    at 0x401A3D0: operator delete(void*) (vg_replace_malloc.c:246)
==29507==    by 0x80AFFBF: SPP_user_data::~SPP_user_data()
(SPP_user_data.cpp:84)
==29507==    by 0x42AB935: __libc_start_main (in /lib/libc-2.3.2.so)
==29507==
==29507== Invalid write of size 4
==29507==    at 0x80B454B: BCP_user_data::~BCP_user_data() (BCP_USER.hpp:16)
==29507==    by 0x42AB935: __libc_start_main (in /lib/libc-2.3.2.so)
==29507==  Address 0x43EB678 is 0 bytes inside a block of size 36 free'd
==29507==    at 0x401A3D0: operator delete(void*) (vg_replace_malloc.c:246)
==29507==    by 0x80AFFBF: SPP_user_data::~SPP_user_data()
(SPP_user_data.cpp:84)
==29507==    by 0x42AB935: __libc_start_main (in /lib/libc-2.3.2.so)
==29507==
==29507== Invalid free() / delete / delete[]
==29507==    at 0x401A3D0: operator delete(void*) (vg_replace_malloc.c:246)
==29507==    by 0x80B4568: BCP_user_data::~BCP_user_data() (BCP_USER.hpp:16)
==29507==    by 0x42AB935: __libc_start_main (in /lib/libc-2.3.2.so)
==29507==  Address 0x43EB678 is 0 bytes inside a block of size 36 free'd
==29507==    at 0x401A3D0: operator delete(void*) (vg_replace_malloc.c:246)
==29507==    by 0x80AFFBF: SPP_user_data::~SPP_user_data()
(SPP_user_data.cpp:84)
==29507==    by 0x42AB935: __libc_start_main (in /lib/libc-2.3.2.so)

but I have certainty that ~SPP_user_data() destructor is correcty.

Please, can anybody help me??? My promotion agency is in my heel... heheh...

Thank you very much,

Carlos

--
Carlos Eduardo de Andrade
Computing Institute
UNICAMP - Brazil




More information about the Coin-discuss mailing list