Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python 3 segmentation fault on OS X Mavericks

I have been experiencing segmentation faults when using Python 3 on OS X Mavericks. Any suggestions on how to resolve this?

I have tried to reinstall the package from the Python site, but this is ineffective. How would one recompile Python 3 on the system?

like image 429
Megatron Avatar asked Oct 24 '13 14:10

Megatron


2 Answers

This problem exists because of this bug: http://bugs.python.org/issue18458.

Basically, Python has code in Modules/readline.c that contains a workaround for a bug in libedit, however the bug in libedit was fixed and Mavericks comes with the new version of libedit and the workaround now causes ython to segfault. The quick and dirty fix is to disable deadline processing by running the following command (from the bug document):

curl -O http://bugs.python.org/file32324/patch_readline_issue_18458.sh
openssl sha1 patch_readline_issue_18458.sh
# the digest should be 7cb0ff57820a027dd4ca242eb2418930f8f46b4c
sudo sh ./patch_readline_issue_18458.sh
like image 117
Luke Rixson Avatar answered Oct 04 '22 22:10

Luke Rixson


http://www.python.org/download/releases/3.3.3/

you can follow the instructions on the main python page for a quick and permanent fix. cheers,

like image 37
Cryptoharf84 Avatar answered Oct 04 '22 20:10

Cryptoharf84