Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

library bug in gcc43 port on fbsd7 -- aborts when throwing exception

21 views
Skip to first unread message

Jeff Brown

unread,
Apr 4, 2008, 6:31:01 PM4/4/08
to
I believe I've found a bug in the libgcc or libstdc++ library (not sure
which one) packaged with the gcc43 port in fbsd7 on an Intel x86-64. A
program linked against those libraries aborts when an exception is thrown.
It does not abort if -lpthread is added to the link line, even though the
program does not use threads. I believe the problem is related to the
pthread stubs in libgcc, but I don't know enough to find the exact problem
or fix it. An example is below.

My system:
>uname -a
FreeBSD testlab5 7.0-STABLE FreeBSD 7.0-STABLE #1: Thu Feb 28 10:06:47 EST
2008 root@builder:/usr/obj/usr/sources/FreeBSD.7/src/sys/GENERIC amd64
>which g++43
/usr/local/bin/g++43
>g++43 --version
g++43 (GCC) 4.3.1 20080313 (prerelease)
etc.
>echo $LD_LIBRARY_PATH
/usr/local/lib/gcc-4.3.1

Sample program.
When compiled with "g++43 test.cc" , it aborts upon the throw.
When compiled with "g++43 test.cc -lpthread", it runs correctly.

#include <stdio.h>
int main(int argc, char* argv[])
{
try {
throw 1;
}
catch (...) {
printf("Caught exception\n");
}
}

Again, it only aborts when omitting -lpthread AND using the dynamic libs in
/usr/local/lib/gcc-4.3.1. If I unsetenv LD_LIBRARY_PATH, libraries are
loaded from the base fbsd7 installation in /usr/lib, which works.

Thanks.
_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stabl...@freebsd.org"

0 new messages