Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segmentation faults with Events #170

Open
timpauli opened this issue Jan 22, 2020 · 8 comments
Open

segmentation faults with Events #170

timpauli opened this issue Jan 22, 2020 · 8 comments

Comments

@timpauli
Copy link

Hi,

first of all thanks for creating pyo it is of great use.
I get a segmentation fault when i run the following piece of code:

import pyo


class TestInstr(pyo.EventInstrument):
    def __init__(self, **args):
        pyo.EventInstrument.__init__(self, **args)
        self.output = pyo.Phasor()


server = pyo.Server(audio="offline")
server.boot()
server.recordOptions(dur=30)
ls = [
    0.03125,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
    0.0625,
]
e = pyo.Events(instr=TestInstr, beat=ls, signal="output",).play()
e.sig().out()
server.start()
server.shutdown()

This is a minimal made up example.
What am I doing wrong?
I am on Ubuntu 19.10.

Thanks a lot.
Best
Tim

@timpauli
Copy link
Author

By the way:

When you remove signal="output" and add self.output.out() to TestInstr it works..

@belangeo
Copy link
Owner

Hi, it does not segfault here on Debian (either ways). Which python do you use?

@timpauli
Copy link
Author

I am using Python 3.7.5 right now.

@belangeo
Copy link
Owner

Strange, I'm using 3.7.3 (from apt). Can you run your script from the terminal with -X dev and paste the output here ?
python3 -X dev your_script.py

@timpauli
Copy link
Author

timpauli commented Jan 23, 2020

Pyo message: Offline Server rendering file /home/user/pyo_rec.wav dur=30.000000
Fatal Python error: Segmentation fault

Current thread 0x00007ff48eaea740 (most recent call first):
  File "/home/user/.local/lib/python3.7/site-packages/pyo/lib/server.py", line 828 in start
  File "test.py", line 96 in <module>
[1]    21798 segmentation fault (core dumped)  python3 -X dev test.py

@belangeo
Copy link
Owner

Which version of pyo?

@timpauli
Copy link
Author

1.0.1 installed via pip3

@belangeo
Copy link
Owner

To really find what is happening, pyo should be compiled with --debug flag and then run under gdb. I'll see if I can find an Ubuntu computer around...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants