Boost logo

Boost :

From: chris.grayson_at_[hidden]
Date: 2006-05-01 10:44:30


I don't know why my posts aren't coming through - here's my third try at
sending my original message, with the three source files (again).

I'm trying to use the Boost threads library in an application on AIX
5.3, but I'm having serious trouble. I've narrowed it down to the test
code below. When both "main.cpp" and "Class1.cpp" include
<boost/thread/thread.hpp>, the compiled application coredumps whenever
an exception is thrown in Class1. When the thread.hpp include statement
is commented out - in either file - the exception is thrown and caught
fine, with no coredump. Note that neither main.cpp nor Class1.cpp
*uses* any Boost threads code.

This problem occurs with both gcc 3.3.2 (as provided by IBM in their
"AIX Toolbox") and gcc 3.4.6 (as built from source). In both cases, the
AIX linker "ld" is used, per both IBM and GNU's recommendations.

This seems to only happen on AIX 5.3. The same code on Linux, Solaris
and AIX 5.1, compiled the same way, does not crash in this way.

This also occurs with both Boost 1.33.0 and 1.33.1. I'm currently
compiling against the latest Boost source (1.33.1), though it's not
built, since I'm only including headers, and not linking anything.

---- main.cpp ----
#include <iostream>
#include "Class1.h"
#include <boost/thread/thread.hpp>

main () {
        std::cout << "starting main()" << std::endl;

        Class1 c;
        c.noop();

        std::cout << "exiting main() normally" << std::endl;
}

---- Class1.h ----
class Class1 {
public:
    void noop();
};

---- Class1.cpp ----
#include <iostream>
#include "Class1.h"
#include <boost/thread/thread.hpp>

void Class1::noop () {
    std::cout << "entering Class1::noop()" << std::endl;
    try {
        std::cout << "..throwing exception" << std::endl;
        throw (2.1);
    }
    catch (...) {
        std::cout << "..caught exception in Class1.noop()" << std::endl;
    }
    std::cout << "..leaving Class1.noop()" << std::endl;
    return;
}

The previous files are built and run with these commands:
> g++ -o crasher -I$HOME/boost/boost_1_33_1 main.cpp Class1.cpp
> ./crasher

I do get these linker errors:
ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__I_thread_creds_t
ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__D_thread_creds_t
ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__F_thread_creds_t
ld: 0711-224 WARNING: Duplicate symbol: thread_creds_t
ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__I_thread_creds_t
ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__D_thread_creds_t
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.

Any help will be greatly appreciated.

Thanks,
Chris Grayson
Database-Brothers, Inc.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk