[Libpqxx-general] pqxx::connection crash under libpqxx 2.6.9 and 3.0.0, OSX Leopard

Matthew Fanto mfanto at gmail.com
Mon Jul 14 05:31:11 UTC 2008


I am just starting to play with libpqxx, so I am quite certain the issue is
with me and linking problems. I have tested this under both libpqxx 2.6.9
and 3.0.0 and both crash at the same point. The following code causes a
EXC_BAD_ACCESS violation under Leopard 10.5.4 and Xcode 3.0.

using namespace pqxx;

try {
 connection C;
} catch (exception& e) {
....
}

Even if I pass a connection string to connection C("dbname = foo"); I still
get a crash.

I built libpqxx from source, with ./configure && make && sudo make install

I have tried various linker settings, such as adding -lpqxx -lpq to "Other
Linker Flags" (OTHER_LDFLAGS). Or linking against shared libraries with
(/usr/local/lib/libpqxx.dylib).

The other strange thing I have notices is visibility warnings, which was
fixed by selecting "GCC_SYMBOLS_PRIVATE_EXTERN"

I am able to successfully build and run test001, test002, etc. It makes me
believe that it is a linker issue I am missing. Any help would be greatly
appreciated. I am 100% certain it's a dumb mistake on my part.


The following is the call trace for the violation:
#0 0x93e79955 in __gnu_debug::_Safe_iterator_base::_M_detach
#1 0x93e799ce in __gnu_debug::_Safe_iterator_base::_M_attach
#2 0x93e79ad4 in __gnu_debug::_Safe_sequence_base::_M_detach_all
#3 0x00006f71 in __gnu_debug::_Safe_sequence_base::~_Safe_sequence_base at
safe_base.h:170
#4 0x0000f8ed in
__gnu_debug::_Safe_sequence<__gnu_debug_def::map<std::string,
pqxx::prepare::internal::prepared_def, std::less<std::string>,
std::allocator<std::pair<std::string const,
pqxx::prepare::internal::prepared_def> > > >::~_Safe_sequence at
safe_sequence.h:97
#5 0x000106c5 in __gnu_debug_def::map<std::string,
pqxx::prepare::internal::prepared_def, std::less<std::string>,
std::allocator<std::pair<std::string const,
pqxx::prepare::internal::prepared_def> > >::~map at map.h:90
#6 0x0001071b in __gnu_debug_def::map<std::string,
pqxx::prepare::internal::prepared_def, std::less<std::string>,
std::allocator<std::pair<std::string const,
pqxx::prepare::internal::prepared_def> > >::~map at map.h:90
#7 0x00010739 in pqxx::connection_base::~connection_base at
connection_base.hxx:163
#8 0x0001088d in
pqxx::basic_connection<pqxx::connect_direct>::basic_connection at
basic_connection.hxx:56
#9 0x000108b9 in
pqxx::basic_connection<pqxx::connect_direct>::basic_connection at
basic_connection.hxx:56
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pgfoundry.org/pipermail/libpqxx-general/attachments/20080714/52d30499/attachment.html 


More information about the Libpqxx-general mailing list