openAVproductions / openAV-Luppp

Luppp is a live performance tool, created by OpenAV productions.
http://openavproductions.com/luppp
GNU General Public License v3.0
256 stars 43 forks source link

Segmentation fault (core dumped) #320

Closed WMRamadan closed 1 year ago

WMRamadan commented 3 years ago

Followed build instruction with the new ntk link.

Application builds yet when run it produces the following error: [Luppp] main:78: Git: 9253890 readme: add second link for ntk, fixes #317 [Luppp] main:94: Built with BUILD_TESTS enabled [Luppp] Gui:460: Loaded preferences Segmentation fault (core dumped)

Environment: Linux 5.11.0-7614-generic CPU = AMD Ryzen 7 Pro 4750G

harryhaaren commented 3 years ago

Would you run in gdb and provide the output of backtrace? That would provide debug info that can be used to diagnose the issue, thanks!

harryhaaren commented 3 years ago

I've just tried to reproduce, but it's working fine here, so input required to reproduce this.

WMRamadan commented 3 years ago

I've just tried to reproduce, but it's working fine here, so input required to reproduce this.

I have found the problem using the backtrace, seems that I didn't have jack running.

It is working now!

WMRamadan commented 3 years ago

I've just tried to reproduce, but it's working fine here, so input required to reproduce this.

I guess you can reproduce it by not running jack server, but shouldn't it produce an error message instead of segmentation fault?

harryhaaren commented 3 years ago

Yes - but there are different versions of JACK servers, client libraries, ABIs etc. If you can paste the backtrace (with debug symbols) then we should likely be able to resolve..?

I think the jack_client_open() call in the Jack::Jack() is failing, returning a NULL client, and then the jack_get_sample_rate() call segfaults on the NULL client.

An early return might work, but we cannot return error codes from class constructors (ugh - I'm a C dev these days, and now find some of the Class things like RAII and these types of things a bit annoying..)

WMRamadan commented 3 years ago

Yes - but there are different versions of JACK servers, client libraries, ABIs etc. If you can paste the backtrace (with debug symbols) then we should likely be able to resolve..?

I think the jack_client_open() call in the Jack::Jack() is failing, returning a NULL client, and then the jack_get_sample_rate() call segfaults on the NULL client.

An early return might work, but we cannot return error codes from class constructors (ugh - I'm a C dev these days, and now find some of the Class things like RAII and these types of things a bit annoying..)

I honestly don't know what I did different now, but it is no longer creating a segfault anymore even when jack is not running.

I was going to use something like this:

client = jack_client_open(client_name, options, &status, server_name);
    if (client == NULL) {
        fprintf(stderr, "jack_client_open() failed, "
            "status = 0x%2.0x\n", status);
        if (status & JackServerFailed) {
            fprintf(stderr, "Unable to connect to JACK server\n");
        }
        exit(1);
    }
harryhaaren commented 1 year ago

Sounds like the system config/JACK version or something changed, resulting in the code doing what it was meant to (instead of erroring-out like before. Marking as closed as we cannot reproduce.