Local Experiment crashing around 23-24 minutes

I have an experiment that its supposed to keep running trials for 25 minutes. Unfortunately, the experiment stops just around 24 minutes.
There’s no new variable introduced just before it stops, and making the experiment shorter keeps it from crashing, but I really need it running for 25 minutes.

Traceback (most recent call last):
15.0970 WARNING User requested fullscreen with size [1280 720], but screen is actually [1920, 1080]. Using actual size
2.2605 WARNING Monitor specification not found. Creating a temporary one…
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\graphics_init_.py”, line 452, in _get_domain
domain = domain_map[key]
KeyError: ((‘v2f/dynamic’, ‘t3f/dynamic’, ‘c4B/dynamic’), 7, False)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\gabri\psychopy\PSAP_FINAL_lastrun.py”, line 714, in
textContadorAPSAP.setText(ContadorA, log=False)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\text.py”, line 383, in setText
setAttribute(self, ‘text’, text, log)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\tools\attributetools.py”, line 134, in setAttribute
setattr(self, attrib, value)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\tools\attributetools.py”, line 27, in set
newValue = self.func(obj, value)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\text.py”, line 374, in text
self._setTextShaders(text)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\visual\text.py”, line 392, in _setTextShaders
self.pygletTextObj = pyglet.text.Label(
File "C:\Program Files\PsychoPy\lib\site-packages\pyglet\text_init
.py", line 456, in init
self.document.set_style(0, len(self.document.text), {
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\text\document.py”, line 603, in set_style
return super(UnformattedDocument, self).set_style(
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\text\document.py”, line 512, in set_style
self.dispatch_event(‘on_style_text’, start, end, attributes)
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\event.py”, line 418, in dispatch_event
if handler(*args):
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\text\layout.py”, line 1073, in on_style_text
self._init_document()
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\text\layout.py”, line 1043, in _init_document
self._update()
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\text\layout.py”, line 980, in _update
self._create_vertex_lists(left + line.x, top + line.y,
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\text\layout.py”, line 1476, in create_vertex_lists
box.place(self, i, x, y, context)
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\text\layout.py”, line 370, in place
vertex_list = layout.batch.add(n_glyphs * 4, GL_QUADS, group,
File "C:\Program Files\PsychoPy\lib\site-packages\pyglet\graphics_init
.py", line 368, in add
domain = self.get_domain(False, mode, group, formats)
File "C:\Program Files\PsychoPy\lib\site-packages\pyglet\graphics_init
.py", line 458, in _get_domain
domain = vertexdomain.create_domain(*formats)
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\graphics\vertexdomain.py”, line 140, in create_domain
return VertexDomain(attribute_usages)
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\graphics\vertexdomain.py”, line 189, in init
attribute.buffer = vertexbuffer.create_mappable_buffer(
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\graphics\vertexbuffer.py”, line 115, in create_mappable_buffer
return MappableVertexBufferObject(size, target, usage)
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\graphics\vertexbuffer.py”, line 389, in init
super(MappableVertexBufferObject, self).init(size, target, usage)
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\graphics\vertexbuffer.py”, line 308, in init
glBufferData(target, self.size, None, self.usage)
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\gl\lib.py”, line 106, in errcheck
raise GLException(msg)
pyglet.gl.lib.GLException: b’sem mem\xf3ria’
Exception ignored in: <function VertexDomain.del at 0x0000013DF94300D0>
Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\pyglet\graphics\vertexdomain.py”, line 238, in del
for attribute in self.attributes:
AttributeError: ‘VertexDomain’ object has no attribute ‘attributes’
################ Experiment ended with exit code 1 [pid:12084] #################

I really have no idea how I could fix this.
Anyone could please tell me what may be wrong?

That looks like a memory leak that we’ve previously fixed. What version of PsychoPy are you using? (It’s always good in a forum post to state the exact version of PsychoPy you’re using)

Sorry jon, forgot to post that I am using v2022.1.4.

The issue seemed to be with my “Use Psychopy version: latest”, that runned experiments in an older version.

By manually selecting 2022.1.4 in use version, I avoided this and some other issues I faced since I installed this new version.

Thank you very much

if thats a memory leak, then perhaps you should do del var_name more often in your code, manually
python’s garbage collector can be sloppy, especially when calling external graphical libraries, such as matplotlib

I’m afraid del almost certainly won’t help. The memory leak wasn’t caused by that sort of error - it isn’t an accumulation of ever-more variables that haven’t been deleted. What caused the problem in the past, specifically with TextStim, was with graphics card memory: the OpenGL (ie. graphics card) resources used TextStim objects are not tracked by Python garbage collection and need explicitly destroying. That’s now handled by our TextStim destructor but at one point that wasn’t working correctly (if I remember correctly there was a circular reference that meant the reference count never reached 0) which meant the graphics card memory eventually ran out with the GLException as above.

@Gabriel_Terhoch For useVersion I’d recommend leaving it blank to start with, while creating/debugging. That’s faster to compile experiments apart from anything else. And then fix it to the version you’re on once you start running the study “for real”. But your issue has made me realise one way that useVersion will not always be using the truly ‘latest’ and has accidentally loaded a version /older/ than your installed version (2022.1.4). I’ll fix that for the next release. cheers

1 Like