Fatal Python error: (pygame parachute) Segmentation Fault Abort trap: 6

4,299 views
Skip to first unread message

citt...@gmail.com

unread,
Feb 2, 2014, 7:02:46 AM2/2/14
to kivy-...@googlegroups.com
Hi,

I've been working on packaging kivy for android for awhile.
Just when I got it working for android.
I went back to look at the desktop version by typing 'kivy main.py' and I get this error:

[INFO   ] Kivy v1.7.2

[INFO   ] [Logger      ] Record log in /Users/bliss/.kivy/logs/kivy_14-02-02_93.txt

[INFO   ] [Factory     ] 144 symbols loaded

[DEBUG  ] [Cache       ] register <kv.lang> with limit=None, timeout=Nones

[DEBUG  ] [Cache       ] register <kv.image> with limit=None, timeout=60s

[DEBUG  ] [Cache       ] register <kv.atlas> with limit=None, timeout=Nones

[INFO   ] [Image       ] Providers: img_imageio, img_tex, img_dds, img_pygame, img_gif (img_pil ignored)

[DEBUG  ] [Cache       ] register <kv.texture> with limit=1000, timeout=60s

[DEBUG  ] [Cache       ] register <kv.shader> with limit=1000, timeout=3600s

[INFO   ] [Text        ] Provider: pygame

[DEBUG  ] [App         ] Loading kv <./tutorial.kv>

[DEBUG  ] [App         ] kv <./tutorial.kv> not found

[DEBUG  ] [Window      ] Ignored <egl_rpi> (import error)

[INFO   ] [Window      ] Provider: pygame(['window_egl_rpi'] ignored)

Fatal Python error: (pygame parachute) Segmentation Fault

Abort trap: 6



I am using a MAC so according to the forums, the driver update comes with the OS update.  

As far as I can tell my MAC OS X is updated since I've pressed software update a few times and it does not prompt me to update, but it just shows me the history of updates.


Should I reinstall kivy????


How do I solve this?


Message has been deleted

Ben Rousch

unread,
Feb 2, 2014, 10:16:52 AM2/2/14
to kivy-...@googlegroups.com

That error typically means that pygame is not installed correctly.

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Doug Linder

unread,
Feb 2, 2014, 10:19:35 AM2/2/14
to kivy-...@googlegroups.com
Complain bitterly to anyone you know who uses pygame about how fragile it is and encourage them to use something else in future.

Seriously though, this is almost certainly because you have a broken pygame installation somewhere, somehow.

The easiest way to check is:

    kivy
    import pygame
    pygame.__file__

If you see a weird path that isn't /Applications/Kivy.app/... that's the problem.
eg. >>> pygame.__file__
'/Library/Python/2.7/site-packages/pygame/__init__.pyc'

Fixing it is more tricky.

You can try looking in /Library/Python/2.7/site-packages/pygame or /Developer/Python/pygame, or maybe /Library/Frameworks/Python.framework/, or maybe in /Library/Python depending on what version of pygame it was and how your system was setup before, and deleting it, but the easiest way is to repeat the steps above and delete the pygame instances you find until the only pygame that imports is the only in the kivy folder.

Alternatively you can build kivy from source;

   virtualenv .
   ./bin/pip install cython
   ./bin/pip install kivy

Good luck~

Pygame crashes are extremely troublesome to debug.

~
Doug.

Preston

unread,
Feb 3, 2014, 7:52:36 PM2/3/14
to kivy-...@googlegroups.com
Hi

Ok, I did the tests and I think my kivy's pygame is broken.

Here's the results:

$ kivy

Python 2.7.5 (default, Aug 25 2013, 00:04:04) 

[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import pygame

>>> pygame.__file__

'/Applications/Kivy.app/Contents/Resources/lib/sitepackages/pygame/__init__.pyc'

>>> exit()



$ kivy

Python 2.7.5 (default, Aug 25 2013, 00:04:04) 

[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import pygame

>>> pygame.init()

(6, 0)

>>> pygame.display.set_mode((640,480), pygame.OPENGL)

Fatal Python error: (pygame parachute) Segmentation Fault

Abort trap: 6




So I believe my kivy's pygame is broken.
How do I 'reset' the kivy's pygame???


Thank you




--
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/QdSkaIcP9d0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.

Doug

unread,
Feb 3, 2014, 8:04:37 PM2/3/14
to kivy-...@googlegroups.com
You're in one of those unfortunate situations where you're trying to
figure out which .so python is importing. Terribly frustrating I
realize.

Try this:

find / -name "*pygame*"

Delete all the pygame references you find (don't use -delete; you'll
probably regret doing that on a top level search... :P).

Delete /Applications/Kivy

Redownload and install a new copy of Kivy (1.8 ideally)

That work?

The only other thing I can suggest is consider installing brew python;
kivy uses system python by default if you edit the kivy file (which
kivy -> edit file) you can change to use a different version. More on
brew here: http://brew.sh/ (once it's installed you can do various
things like brew install python, brew install
homebrew/python/pygame)... but this is a pretty extreme step.

It should work.

This is exactly the problem with pygame I was talking about before. It
would be a lot less frustrating if pygame had a well defined means of
going: this folder here at /blah/blah is the *only* folder I want you
to look for DLLs or .so files in, because then you'd at least be able
to debug the issue by looking at the link symbols on the libraries
using libtool and lipo, but ... sadly that's something the pygame
developers have no interest in apparently.

~
Doug.

citt...@gmail.com

unread,
Feb 3, 2014, 11:18:24 PM2/3/14
to kivy-...@googlegroups.com
Hi

I'm trying to delete all pygame folders....
but I discovered something.

when I type:

>>> help('modules')


pygame is not listed.

But when I do the sudo find / -name "*pygame*" 



pygame is in the python 2.7 site packages.


Does this mean anything?

I thought what's in site packages are the modules and therefore it should show on the list when called by help('modules')

Am I missing something here?



What's the best way to uninstall pygame?

Just plainly delete the folders one by one?




citt...@gmail.com

unread,
Feb 3, 2014, 11:30:26 PM2/3/14
to kivy-...@googlegroups.com
Hi

Ok...I just checked...in 

['/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/Library/Python/2.7/site-packages']


and pygame is not in any of the directories....

Preston

unread,
Feb 4, 2014, 12:03:54 AM2/4/14
to kivy-...@googlegroups.com
Hi,

This is the last few lines I get when I run kivy -v main.py

 dlopen("/Applications/Kivy.app/Contents/Resources/lib/sitepackages/pygame/sdlmain_osx.so", 2);
 import pygame.sdlmain_osx # dynamically loaded from /Applications/Kivy.app/Contents/Resources/lib/sitepackages/pygame/sdlmain_osx.so
Fatal Python error: (pygame parachute) Segmentation Fault


I just checked my python and I don't have pygame.
So the only pygame running is the one that came with the kivy package....


Doug

unread,
Feb 4, 2014, 12:34:19 AM2/4/14
to kivy-...@googlegroups.com
Unforunately as you can see here
https://bitbucket.org/pygame/pygame/src/18eefb9bd5a2f503e61c965d7790441e3616aacd/src/sdlmain_osx.m,
the first thing import sdlmain_osx does is:

import_pygame_base ();

ie. Import the other pygame libraries. Its possible that importing one
of the *other* modules is causing the segmentation fault, but you
can't see which module it is because the import is happening inside a
cython module.

Sorry though, I don't really have any other bright ideas. On my system:

doug:~ doug$ otool -L
/Applications/Kivy.app/Contents/Resources/lib/sitepackages/pygame/sdlmain_osx.so
/Applications/Kivy.app/Contents/Resources/lib/sitepackages/pygame/sdlmain_osx.so:
@loader_path/../../libSDL-1.2.0.dylib (compatibility version
12.0.0, current version 12.4.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
(compatibility version 1.0.0, current version 17.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 159.1.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current
version 228.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
(compatibility version 150.0.0, current version 635.21.0)
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
(compatibility version 1.0.0, current version 41.0.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
(compatibility version 300.0.0, current version 833.25.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
(compatibility version 45.0.0, current version 1138.51.0)

... all those dependencies exist and it works fine.

~
Doug.

Preston

unread,
Feb 4, 2014, 12:39:00 AM2/4/14
to kivy-...@googlegroups.com
Hi

Would installing pygame on my python make a difference?


I wanna try using the python brew is going to install, but I can't find the kivy -> edit file you are referring to.
How do I look for it?

How about I reformat my Mac and start from scratch?
I'll save my source codes of course...

What do you think?  Bad idea?

Thank you for the help


Preston

unread,
Feb 4, 2014, 12:42:16 AM2/4/14
to kivy-...@googlegroups.com
Hi
Btw, some more extra info...
from time to time...it works...but it's like less than 1%.....
I can't reproduce the situation though....sometimes I just type kivy main.py and it works........

So frustrating....

Doug

unread,
Feb 4, 2014, 12:41:43 AM2/4/14
to kivy-...@googlegroups.com
If you've installed kivy according the the docs you should have:

/usr/local/bin/kivy

? No?

Hm... I do. Maybe I set that up manually. I can't remember, but it's a
shell script:

#!/bin/bash
SCRIPT_PATH="${BASH_SOURCE[0]}";
if([ -h "${SCRIPT_PATH}" ]) then
while([ -h "${SCRIPT_PATH}" ]) do SCRIPT_PATH=`readlink
"${SCRIPT_PATH}"`; done
fi
SCRIPT_PATH=`dirname ${SCRIPT_PATH}`

export PYTHONPATH=${SCRIPT_PATH}/kivy:${SCRIPT_PATH}/lib/sitepackages:$PYTHONPATH
export DYLD_FALLBACK_LIBRARY_PATH=${SCRIPT_PATH}/lib:$DYLD_FALLBACK_LIBRARY_PATH
export LD_PRELOAD_PATH=${SCRIPT_PATH}/lib:$LD_PRELOAD_PATH
export GST_PLUGIN_PATH=${SCRIPT_PATH}/lib/gst-plugins:$GST_PLUGIN_PATH
export GST_PLUGIN_SCANNER=${SCRIPT_PATH}/lib/bin/gst-plugin-scanner
export GST_REGISTRY_FORK="no"

# It has to be -S or pygame's egg will do some funny site magic and
break eventually
# That'd mean however that other libraries can't be found anymore. So
if the user has
# a broken pygame installation, it's not our fault...
#
# Also, hardcode the link to python 2.7 for now. If you don't want
that, just adjust it.
# We're doing that because the situation of Python on OSX is less than
ideal and users
# tend to install Python from arbitrary resources. To ensure smooth
execution, we're
# enforcing the usage of the Python version that we actually built against.
# If you know what you're doing you can easily change this.
exec python "$@" <----- Replace here with /usr/local/bin/python to use brew

Ha... I'd love to say I've never blown away my entire mac and
installed it from scratch because some stupid #@$@#$ing easy_install
package dumped shared libraries all over my system.

...but I can't say that. It's probably easier to try brew first though.

~
Doug.

On Tue, Feb 4, 2014 at 1:39 PM, Preston <citt...@gmail.com> wrote:

Preston

unread,
Feb 4, 2014, 12:47:11 AM2/4/14
to kivy-...@googlegroups.com
Hi
We might be on to something now...

$ cd /usr/local/bin/kivy

-bash: cd: /usr/local/bin/kivy: Not a directory





So the installation is not right.

I started with Kivy 1.7

That's when I programmed the whole thing.

That time it was working.

Then I tried to package it for android...I was having difficulties...

Somewhere around that time I decided to install Kivy 1.8.

So I downloaded the .dmg file.

Dragged the Kivy package to the applications folder.

Then I clicked on the script.  It says symlink is already done...

So I don't know why /usr/loca/bin/kivy does not exist....


anyway...


now that we know that doesn't exist...

how should I proceed to fix this???


Thank you....


Preston

unread,
Feb 4, 2014, 12:50:50 AM2/4/14
to kivy-...@googlegroups.com
Hi
Sorry....
/usr/local/bin/kivy does exist.  It's just not a folder....


citt...@gmail.com

unread,
Feb 6, 2014, 11:22:28 AM2/6/14
to kivy-...@googlegroups.com
Thank you...

I just reformatted my MAC and now it's back to normal....

Roger Erens

unread,
Feb 10, 2014, 6:17:51 PM2/10/14
to kivy-...@googlegroups.com
Hi,

for me, Doug Linder's posts from 20131110 (https://groups.google.com/forum/#!topic/kivy-users/meQ4QDKg9jg) helped:
I had mvim running, and chrome with quite a few tabs open. I don't know whether they actually use openGL, but upon quitting mvim I apparently freed up graphics memory and I could start playing kivy's memory again :-)

So maybe you have to consider carefully which other apps are running already?

Nicolò Paternoster

unread,
May 14, 2014, 6:59:10 PM5/14/14
to kivy-...@googlegroups.com
I just encountered the same error today.

Nicolò Paternoster

unread,
May 14, 2014, 7:02:37 PM5/14/14
to kivy-...@googlegroups.com
Thank you for the help. In my case running
 pygame.__file__

simply doesn't output anything :\ 
Reply all
Reply to author
Forward
0 new messages