jack2 icon indicating copy to clipboard operation
jack2 copied to clipboard

Call to jack_deactivate() eventually doesn't return (Windows)

Open 7890 opened this issue 1 year ago • 0 comments

Describe the bug

jack application hangs in jack_deactivate(). This bug could only be observed on Windows OS.

Steps To Reproduce

Using https://github.com/jackaudio/jack2-releases/releases/download/v1.9.22/jack2-win64-v1.9.22.exe on Windows 7

Startup jackd via qjackctl.

Compile test program from https://paste.debian.net/plainh/65817d0d

#include <stdio.h>
#include <unistd.h> //usleep
#include <jack/jack.h>

static int process(jack_nframes_t nframes, void *arg)
{
	fprintf(stderr, "/");
	return 0;
}

int main(int argc, char* argv[])
{
	jack_status_t status=0;
	jack_options_t options=(JackNoStartServer | JackServerName);
	jack_client_t *client=NULL;
	while(1)
	{
		client=jack_client_open("test", options, &status, "default");
		jack_set_process_callback(client, process, NULL);
		jack_activate(client);
fprintf(stderr, ".");
		usleep(100000);
fprintf(stderr, "\na\n");
		jack_deactivate(client);
fprintf(stderr, "\nb\n");
		jack_client_close(client);
		client=NULL;
	}
}

Expected vs. actual behavior

Expected behaviour: The program should continue to run forever and write debug output to the terminal.

Actual behaviour: program stops after a random cycle count, the call to jack_deactivate(client) doesn't seem to return. The program is frozen.

No error messages from the server.

It's not clear under which exact circumstance the error happens. It will in the described case (using test program) however happen certainly, after some time.

7890 avatar Oct 07 '23 21:10 7890