[C++-sig] boost.python program crash Python interpreter at exiton Fedora 8

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Thu Dec 6 21:55:53 CET 2007


I know for sure Boost.Python works under Fedora 8. Most likely the problem
is in the way you build the extension. It could be any number of things,
e.g. mix of .o files compiled with different compilers, or linking against
the wrong libboost_python.so, etc.
If you want to convince yourself:
  wget http://cci.lbl.gov/boostbx_bundles/2007_12_05_0104/boostbx_bundle.selfx
  perl boostbx_bundle.selfx
This is with the boost svn from two days ago. It compiles libboost_python.so
from scratch and runs a unit test at the end. Maybe the compilation/link
commands shown in the build output will give you a clue how to adjust your
build system.
Ralf

----- Original Message ----
From: "Tang, Guang" <gtang at bcm.tmc.edu>
To: c++-sig at python.org
Sent: Thursday, December 6, 2007 9:56:24 AM
Subject: Re: [C++-sig] boost.python program crash Python interpreter at exiton Fedora 8


Thanks for your reply.
My application wraps a bunch of c++ classes to Python, the building
 process is managed by CMake.
To simplify the problem. I replace one of the wrapped class to Hello
 class in the tutorial of boost.python. But I still get this segfault at
 exit.

Grant

"Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com> wrote in message
 news:<87524.14387.qm at web31112.mail.mud.yahoo.com>...
> My guess is there is a general memory access violation, but you're
 getting
> lucky on the other platforms. I'd run valgrind to find out what's
 going
> on. valgrind should come with Fedora 8. If not, installing from
 sources
> is quick and easy.
> You need Python-specific suppressions for valgrind. The suppression
> file comes with the Python sources. I think it is called
 valgrind-python.supp,
> probably in the Misc subdirectory.
> If you compile your extension with -g valgrind will give you source
> code line numbers.
> Ralf
> 
> ----- Original Message ----
> From: Grant Tang <grant.tang at gmail.com>
> To: c++-sig at python.org
> Sent: Wednesday, December 5, 2007 8:52:09 PM
> Subject: [C++-sig] boost.python program crash Python interpreter at
 exit on Fedora 8
> 
> 
> My application uses boost.pyhton to wrap c++ core to Python. It works
 fine on 
> Linux, WinXP and Mac OSX. On the recently released Fedora 8, it
 functions 
> correctly but always causes segmentation fault when exit Python:
> 
> >>>import MyAPP
> >>>exit()
> Segmentaion fault
> 
> put the exit() function in try/catch shows it's a SystemExit
 exception 
> raised in exit() function.
> 
> If I run Python in GDB, it gives this info at exit():
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 46912496267664 (LWP 158127)]
> 0x00002aaab20885cd in rename () from /lib64/libselinux.so.1
> 
> I doubt it's releated to SELinux on Fedora. But the problem exists
 even if I 
> 
> turn off SELinux.
> 
> Can anybody tell me what's the problem here and why it only happens
 in Fedora 8? 
> 
> 
> -- 
> Grant
> 
> 
> 
> 
_______________________________________________
C++-sig mailing list
C++-sig at python.org
http://mail.python.org/mailman/listinfo/c++-sig






More information about the Cplusplus-sig mailing list