Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Segmentation fault: 11 when importing math into Python [duplicate]

It crashes everytime I try to import from math. Is there a way to reinstall the math library? I'm on Python 3.3.2.

sidwyn$ python3
>>> from math import pi
Segmentation fault: 11
like image 416
Sidwyn Koh Avatar asked Oct 22 '22 01:10

Sidwyn Koh


2 Answers

Please try this:

$ env -i python3.3
>>> import faulthandler
>>> faulthandler.enable()
>>> import math
>>> math
<module 'math' (built-in)>
>>> from math import pi
# should segfault

and try to run python inside the GNU debugger. You have to type "run" into the gdb shell to start Python and "backtrace" to get the C call stack.

$ gdb python3.3
(gdb) run
>>> from math import pi
# should segfault
(gdb) backtrace

and post the output here.

like image 179
Christian Heimes Avatar answered Nov 03 '22 21:11

Christian Heimes


Turns out it is a Mavericks issue. Should have searched more thoroughly before asking. Sorry.

Duplicate Question: Python crashing when running two commands (Segmentation Fault: 11)

like image 41
Sidwyn Koh Avatar answered Nov 03 '22 20:11

Sidwyn Koh