GCC version compatibility
Recently people testing Boost.Python with GCC on Linux have reported that the extensions being tested have to be compiled with exactly the same version of GCC as the Python they're being loaded into, or they get mysterious crashes. That doesn't correspond to my past experience; it has always been true that, as long as the compiler used to build Python and the one used to build the extension have compatible 'C' ABIs, we've been okay. Yes, if you were going to pass types like FILE* across the Python/C API, then you additionally need to be sure that the two compilers are using the same 'C' library. That said, none of the Boost.Python tests do that. I'm wondering if there has been a well-known recent change either in Python or GCC that would account for these new reports. Any relevant information would be appreciated. -- Dave Abrahams Boost Consulting www.boost-consulting.com
David Abrahams wrote:
I'm wondering if there has been a well-known recent change either in Python or GCC that would account for these new reports. Any relevant information would be appreciated.
So what about the theory that it may be that different versions of libstdc++ get linked? Python is linked with g++ if configure thinks this is necessary, and the g++ used to link the extension might be different. I'd like to see a backtrace of one such mysterious crash. Regards, Martin
"Martin v. Löwis" <martin@v.loewis.de> writes:
David Abrahams wrote:
I'm wondering if there has been a well-known recent change either in Python or GCC that would account for these new reports. Any relevant information would be appreciated.
So what about the theory that it may be that different versions of libstdc++ get linked?
That's been confirmed.
Python is linked with g++ if configure thinks this is necessary
Right. The question is, when should configure "think it's necessary?"
and the g++ used to link the extension might be different.
I'd like to see a backtrace of one such mysterious crash.
I don't have it, but ldd confirms that the crash happens when the versions of libstdc++ in python and in the extension module are different. A C++ exception thrown from the extension module into the Boost.Python library to which it is linked (both compiled and linked with the same g++) without passing through any of Python's code (of course) will cause a crash unless Python is using the same libstdc++ as everything else, or unless Python isn't linked with libstdc++. -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (2)
-
"Martin v. Löwis"
-
David Abrahams