I am using Emacs 24.5.1 for writing something in pygame in python 2.7.11. Very often (precisely speaking every second time!) when I try to evaluate the buffer (the whole file) with C-c C-c everything crashes and in the shell I get this message:

Process Python[/path/to/the/file.py] segmentation fault (core dumped)

Why is this happening and what is the way to get rid of it?

I should also mention that this only happens when I try things in Emacs, if I run the program in terminal or other editors like geany every thing works fine. But I would like to work in Emacs on my python projects. I am using Ubuntu 16.04 LTS.

  • What's your python setup? Does your code run at all on evaluation, or are you just trying to load function definitions? – Gastove May 13 '16 at 18:01
  • As said the code runs once, and the next time it crashes! It crashes 50% of the times (every second time)! I evaluate the whole file with C-c C-c. – user12021 May 13 '16 at 20:11
  • 2
    As said, "when I try to evaluate the buffer... everything crashes." Again: what's your Emacs python configuration? Is your code available anyplace? Without more information, my best intuition is you need to change your code such that there's a discrete main method -- no code gets run on file evaluation. You should then be able to evaluate it (that is, load all the function and variable definitions in to the python process) and execute it by calling the main explicitly in that process. – Gastove May 13 '16 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy