openAV-Luppp icon indicating copy to clipboard operation
openAV-Luppp copied to clipboard

Segmentation fault (core dumped)

Open WMRamadan opened this issue 3 years ago • 6 comments

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

WMRamadan avatar Jun 02 '21 17:06 WMRamadan

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 avatar Jun 05 '21 17:06 harryhaaren

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

harryhaaren avatar Jun 05 '21 17:06 harryhaaren

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 avatar Jun 05 '21 17:06 WMRamadan

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?

WMRamadan avatar Jun 05 '21 17:06 WMRamadan

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..)

harryhaaren avatar Jun 08 '21 19:06 harryhaaren

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);
    }

WMRamadan avatar Jun 08 '21 20:06 WMRamadan

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.

harryhaaren avatar Jun 26 '23 21:06 harryhaaren