Skip to content

"Scope" object causes crash when deleted (or garbage collected?) #314

@snuq

Description

@snuq

My code creates a string of pyo classes, plays them, and when its done it deletes them.
If a Scope is in that chain, after a few instances are set to None (seems to take about 4-10 times), i get a crash with:
Process finished with exit code 139 (interrupted by signal 11:SIGSEGV)
(No python errors)

A basic example of the issue:

from pyo import *
import time
s = Server(sr=48000).boot().start()
loop = 1
scopes = []
while True:
    print('loop: '+str(loop))
    scope = Scope(input=Sine())
    scope.play()
    time.sleep(1)
    scope.stop()
    #scopes.append(scope)
    time.sleep(0.5)
    loop += 1

Crashes in the 4th loop for me.

note that this isnt due to CREATING scopes, uncomment the "scopes.append(scope)" line, and it will continue to run forever (or, at least until the memory is filled up by the list of Scope objects).

Also note that this only seems to happen with the Scope object... replace the Scope with Spectrum, or anything else that ive tried, and no crash.

System info:
OS: Kubuntu 24.04
Python: 3.10
PYO: 1.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions