| Reference | Downloads | Github

"reliable" Fatal Python error: (pygame parachute) Segmentation Fault


On GNU/Linux Debian (unstable/sid, pygame 1.9.1release+dfsg-10+b2 or 1.9.3+dfsg-2+b1), while trying to run tests. Happens under xvfb or “natively”, here is an example with some traceback for context:

$> USER=nobody TRAVIS=true xvfb-run -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" gdb --args python -m pytest --tb=line -v -s -m "not needs_sound" ../psychopy

GNU gdb (Debian 7.12-6)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...Reading symbols from /usr/lib/debug/.build-id/2e/a27a68b5bddba5a8e23fb91e7f5e464d6d864c.debug...done.
(gdb) r
Starting program: /usr/bin/python -m pytest --tb=line -v -s -m not\ needs_sound ../psychopy
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/".
====================================================================================================== test session starts =======================================================================================================
platform linux2 -- Python 2.7.13, pytest-3.0.6, py-1.4.32, pluggy-0.4.0 -- /usr/bin/python
cachedir: ../.cache
rootdir: /home/yoh/deb/gits/pkg-exppsy/psychopy, inifile: pytest.ini
plugins: xdist-1.15.0, localserver-0.3.6
[New Thread 0x7fffd8c1c700 (LWP 14858)]
[New Thread 0x7fffd641b700 (LWP 14859)]
[New Thread 0x7fffd3c1a700 (LWP 14860)]
[Thread 0x7fffd3c1a700 (LWP 14860) exited]
[Thread 0x7fffd641b700 (LWP 14859) exited]
[Thread 0x7fffd8c1c700 (LWP 14858) exited]
[New Thread 0x7fffd3c1a700 (LWP 14862)]
[New Thread 0x7fffd641b700 (LWP 14863)]
[New Thread 0x7fffd8c1c700 (LWP 14864)]
[New Thread 0x7fffce1fc700 (LWP 14865)]
[New Thread 0x7fffbf711700 (LWP 14866)]
[New Thread 0x7fffbef10700 (LWP 14867)]
[New Thread 0x7fffbe70f700 (LWP 14868)]
[New Thread 0x7fffbdbc2700 (LWP 14869)]
[New Thread 0x7fffbd3c1700 (LWP 14870)]
collecting 2 items[Thread 0x7fffbd3c1700 (LWP 14870) exited]
[New Thread 0x7fffbd3c1700 (LWP 14881)]
[New Thread 0x7fff985c1700 (LWP 14882)]
[New Thread 0x7fff97dc0700 (LWP 14883)]
[New Thread 0x7fff975bf700 (LWP 14884)]
collecting 280 items[New Thread 0x7fff96218700 (LWP 14890)]
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
[Thread 0x7fff96218700 (LWP 14890) exited]
[New Thread 0x7fff96197700 (LWP 14891)]
[New Thread 0x7fff96197700 (LWP 14892)]
[Thread 0x7fff96197700 (LWP 14891) exited]
[New Thread 0x7fff85996700 (LWP 14893)]
collecting 299 items[New Thread 0x7fff73454700 (LWP 14910)]
[Thread 0x7fffbdbc2700 (LWP 14869) exited]
[New Thread 0x7fffbdbc2700 (LWP 14912)]
[Thread 0x7fffbdbc2700 (LWP 14912) exited]
collecting 373 items5.0164 	WARNING 	Monitor specification not found. Creating a temporary one...
5.0168 	WARNING 	Requested an unavailable screen number - using first available.
5.0171 	WARNING 	User requested fullscreen with size [800 600], but screen is actually [1024, 768]. Using actual size
6.2692 	EXP 	Created window1 = Window(allowGUI=True, allowStencil=False, autoLog=True, bitsMode=UNKNOWN, blendMode='avg', color=array([ 0.,  0.,  0.]), colorSpace='rgb', fullscr=UNKNOWN, gamma=None, lms=UNKNOWN, monitor=<psychopy.monitors.calibTools.Monitor object at 0x7fff71cd6610>, multiSample=False, name='window1', numSamples=2, pos=[0, 0], screen=1, size=array([1024,  768]), stereo=False, units=u'norm', useFBO=True, useRetina=False, viewOri=0.0, viewPos=None, viewScale=None, waitBlanking=True, winType='pyglet')
6.2696 	INFO 	Using gamma ramp type: 0
6.2697 	WARNING 	It looks like we're running in the Travis-CI testing environment. Hardware gamma table cannot be set
6.2697 	EXP 	window1: gamma = 1.0
6.2721 	EXP 	window1: mouseVisible = True
Exception AttributeError: "'NoneType' object has no attribute 'close'" in <bound method BitsSharp.__del__ of < object at 0x7fff71cf5ad0>> ignored
collecting 373 items / 1 errorsWe need to run some tests on your graphics card (hopefully just once).
The BitsSharp will go into status mode while this is done.
It can take a minute or two...

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007fffeeb19300 in ?? () from /usr/lib/x86_64-linux-gnu/
(gdb) bt 10
#0  0x00007fffeeb19300 in  () at /usr/lib/x86_64-linux-gnu/
#1  0x00007fffeeb1974c in FcPatternAddDouble () at /usr/lib/x86_64-linux-gnu/
#2  0x00007ffff5122038 in ffi_call_unix64 () at /usr/lib/x86_64-linux-gnu/
#3  0x00007ffff5121a9a in ffi_call () at /usr/lib/x86_64-linux-gnu/
#4  0x00007ffff5392224 in _call_function_pointer (argcount=3, resmem=0x7fffffff3d90, restype=<optimized out>, atypes=0x7fffffff3d30, avalues=0x7fffffff3d60, pProc=0x7fffeeb19710 <FcPatternAddDouble>, flags=4353)
    at ./Modules/_ctypes/callproc.c:841
#5  0x00007ffff5392224 in _ctypes_callproc (pProc=0x7fffeeb19710 <FcPatternAddDouble>, argtuple=
    (1520859024, 'size', <c_double at remote 0x7fff71cf2b00>), flags=4353, argtypes=0x0, restype=<_ctypes.PyCSimpleType at remote 0x5555579995f0>, checker=0x0) at ./Modules/_ctypes/callproc.c:1184
#6  0x00007ffff5391be5 in PyCFuncPtr_call.lto_priv.56 (self=<optimized out>, inargs=<optimized out>, kwds=<optimized out>) at ./Modules/_ctypes/_ctypes.c:3979
#7  0x000055555563b673 in PyObject_Call (func=<_FuncPtr(__name__='FcPatternAddDouble') at remote 0x7fff6fa5b7a0>, arg=<optimized out>, kw=<optimized out>) at ../Objects/abstract.c:2547
#8  0x0000555555654e2f in do_call (nk=<optimized out>, na=3, pp_stack=0x7fffffff4090, func=<_FuncPtr(__name__='FcPatternAddDouble') at remote 0x7fff6fa5b7a0>) at ../Python/ceval.c:4569
#9  0x0000555555654e2f in call_function (oparg=<optimized out>, pp_stack=0x7fffffff4090) at ../Python/ceval.c:4374
#10 0x0000555555654e2f in PyEval_EvalFrameEx (f=Frame 0x7fff71cf6850, for file /usr/lib/python2.7/dist-packages/pyglet/font/, line 323, in get_fontconfig_match (name='', size=38, bold=80, italic=0, pattern=1520859024), throwflag=0) at ../Python/ceval.c:2989


I get this same error on roughly 33% of my runs. It was also an issue earlier, so I can’t be sure, but it seems to happen more frequently having updated.

I’m about to start testing and am a little concerned. Reading back to the various other threads here, it seems like it could be do to some kind of memory overreaching. So if nobody has any idea how to fix it, does anyone know of any hack fixes for the meantime?

E.g., should I break my experiment down into one block of trials per psychopy experiment file? Though I do sometimes get the same error on very short, simple experiments.

Running: /Users/SRT/Tern/Seq1/
pyo version 0.8.6 (uses single precision)
2017-07-09 10:06:11.954 python[42413:5696398] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/3p/9bqlztd97hqbnzgvrkmx3fg00000gn/T/org.psychopy.PsychoPy2.savedState
Fatal Python error: (pygame parachute) Segmentation Fault

And this is the line in the logfile where it reliably crashes (really, every time)

13.4867 EXP Set sound=C