Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #11029

Re: Segmentation Fault on exit

From Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com>
Newsgroups comp.lang.python
Subject Re: Segmentation Fault on exit
Followup-To comp.lang.python
Date 2011-08-08 08:56 +0200
Message-ID <1ed4h8-eo4.ln1@satorlaser.homedns.org> (permalink)
References <mailman.1971.1312626956.1164.python-list@python.org>

Followups directed to: comp.lang.python

Show all headers | View raw


Vipul Raheja wrote:
> I have wrapped a library from C++ to Python using SWIG. But when I
> import it in Python, I am able to work fine with it, but it gives a
> segmentation fault while exiting.

1. Use a debugger
Run python with "gdb python", import the module and exit. The debugger 
should then show you where the segmentation fault occurs, even though that 
code isn't necessarily the code that is at fault itself.

2. Reduce the size of your module
Remove code from the module. The most drastic variant is to strip anything 
and only leave an empty init function. If that still causes troubles, I'd 
suspect something in the environment or in the way you build the module.

3. Make sure the environment works
Try compiling and running the SWIG examples or any other SWIG code. Does it 
work? What are the differences to your code?

4. Post your code
If everything fails, you could try to reduce your module to the bare minimum 
and post that here. Make sure you really remove anything that's not 
necessary.


Uli

-- 
Domino Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Segmentation Fault on exit Vipul Raheja <vipul.iiith@gmail.com> - 2011-08-06 16:05 +0530
  Re: Segmentation Fault on exit Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2011-08-08 08:56 +0200
  Re: Segmentation Fault on exit ron <vacorama@gmail.com> - 2011-08-10 07:18 -0700

csiph-web