I doubt anyone will be able to shed light on this, but... OpenBabel is
randomly hanging in the C++ deallocator.  See the stack trace below.

I've run into weird problems like this before, and it was related to the
fact that I'm linking a C++ library (OpenBabel) into a C program (the
Postgres database system).  It's made even more complex because Postgres
loads the OpenBabel libraries dynamically on request.  It's worked well for
a long time, but I'm upgrading to OpenBabel 2.3.1 and am encountering this
problem again.

The function call just gets stuck.  It's just sitting there, not using any
CPU, as though it's waiting for a signal or something.

In the past, I cured this problem by using "g++" to invoke the linking step
to create my .so files.  I'm still doing that.  Here is the linker step:

 g++ -fpic -D_GNU_SOURCE -g -Wall -Wmissing-prototypes -Wpointer-arith \
         -Wdeclaration-after-statement -Wold-style-definition
-Wendif-labels \
         -fno-strict-aliasing -shared -Wl,-soname,libchmoogle_2.3.so.0  \
         openbabel2.3/mk_branch.o openbabel2.3/mk_linear.o
openbabel2.3/mk_molform.o openbabel2.3/mk_ringgroups.o \
openbabel2.3/mk_util.o openbabel2.3/mg_normalize.o
openbabel2.3/postgres_mol_openbabel.o tchash.o fingerprint.o postgres_mol.o
\
         -L /home/cjames/openbabel-2.3.x/lib -lopenbabel \
         -o libchmoogle_2.3.so.0.0


(gdb) bt
#0  0x00007fdfd755816e in ?? () from /lib/libc.so.6
#1  0x00007fdfd74e13dc in ?? () from /lib/libc.so.6
#2  0x00007fdfd74dfe78 in free () from /lib/libc.so.6
#3  0x00007fdfd7c7e722 in ?? () from /lib64/ld-linux-x86-64.so.2
#4  0x00007fdfd7c795e5 in ?? () from /lib64/ld-linux-x86-64.so.2
#5  0x00007fdfd7c7f5f5 in ?? () from /lib64/ld-linux-x86-64.so.2
#6  0x00007fdfd7c7a986 in ?? () from /lib64/ld-linux-x86-64.so.2
#7  0x00007fdfd7c7efba in ?? () from /lib64/ld-linux-x86-64.so.2
#8  0x00007fdfd7586be0 in ?? () from /lib/libc.so.6
#9  0x00007fdfd7c7a986 in ?? () from /lib64/ld-linux-x86-64.so.2
#10 0x00007fdfd7586d37 in __libc_dlopen_mode () from /lib/libc.so.6
#11 0x00007fdfd75613f1 in backtrace () from /lib/libc.so.6
#12 0x00007fdfd74cf50f in ?? () from /lib/libc.so.6
#13 0x00007fdfd74d95b6 in ?? () from /lib/libc.so.6
#14 0x00007fdfd74dfe83 in free () from /lib/libc.so.6
#15 0x00007fdf95de56ac in
__gnu_cxx::new_allocator<OpenBabel::OBRing*>::deallocate (this=0xfc2b88,
__p=0xff8ab0)
   at /usr/include/c++/4.4/ext/new_allocator.h:95
#16 0x00007fdf95de413c in std::_Vector_base<OpenBabel::OBRing*,
std::allocator<OpenBabel::OBRing*> >::_M_deallocate (
   this=0xfc2b88, __p=0xff8ab0, __n=2) at
/usr/include/c++/4.4/bits/stl_vector.h:146
#17 0x00007fdf95de3e37 in ~_Vector_base (this=0xfc2b88, __in_chrg=<value
optimized out>)
   at /usr/include/c++/4.4/bits/stl_vector.h:132
#18 0x00007fdf95de2e82 in ~vector (this=0xfc2b88, __in_chrg=<value
optimized out>)
   at /usr/include/c++/4.4/bits/stl_vector.h:313
#19 0x00007fdf959977da in ~OBRingData (this=0xfc2b70, __in_chrg=<value
optimized out>)
   at /home/cjames/openbabel-2.3.x-r4744/source/src/generic.cpp:784
#20 0x00007fdf95907d83 in ~OBBase (this=0xfc1c40, __in_chrg=<value
optimized out>)
   at /home/cjames/openbabel-2.3.x-r4744/source/include/openbabel/base.h:249
#21 0x00007fdf95a13c1b in ~OBMol (this=0xfc1c40, __in_chrg=<value optimized
out>)
   at /home/cjames/openbabel-2.3.x-r4744/source/src/mol.cpp:3225
#22 0x00007fdf95decf5f in chmoogle_ichem_mol_dealloc (mol_ob=0xfc1c40) at
openbabel2.3/postgres_mol_openbabel.cpp:190
#23 0x00007fdf95ded864 in chmoogle_ichem_normalize (length=25,
molecule_text=0xf90bcc "Br.Br.Oc1ccc(cc1)N1CCNCC1",
   intype_len=3, intype=0x7fdf95df2fa9 "SDF", outtype_len=3,
outtype=0x7fdf95df2fa9 "SDF")
   at openbabel2.3/postgres_mol_openbabel.cpp:461
#24 0x00007fdf95df1ef5 in chmoogle_normalize_sdf (fcinfo=0x7fff2369dcc0) at
postgres_mol.c:553
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to