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

Jeroen Vermeulen jtv at xs4all.nl
Mon Jul 14 06:51:53 UTC 2008


Matthew Fanto wrote:
> 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) {
> ....
> }

This code should work, of course.  And it does for me, even if I cause 
the connection to fail.  What I don't understand is why the code seems 
to be cleaning up an iterator on the connection's map of prepared 
statements.  That map is empty, and I have no idea where an iterator 
could have come from!

When errors get this weird, my first guess is that there may be another 
version of libpqxx installed somewhere where the compiler, the linker, 
or the loader can find it.  Or the library may be compiled with a 
different compiler version than the program.


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

That's interesting: I've just heard from the new Debian maintainer that 
a symbol doesn't seem to be exported from the shared library in gcc 4.3, 
so this could be the same problem.  Does Xcode 3.0 use gcc 4.3?


Jeroen



More information about the Libpqxx-general mailing list