[Jack-Devel] Fwd: Bug#786737: jackd1: crashes with -n option specified

Adrian Knoth adi at drcomp.erfurt.thur.de
Tue Aug 25 17:43:57 CEST 2015


Hi!

This just caught my attention. I didn't look into it, yet, but maybe
somebody has some cycles to investigate.


Cheers

-------- Forwarded Message --------
Subject: Bug#786737: jackd1: crashes with -n option specified
Resent-Date: Mon, 25 May 2015 02:57:01 +0000
Resent-From: Frank Heckenbach <f.heckenbach at fh-soft.de>
Resent-To: debian-bugs-dist at lists.debian.org
Resent-CC: Debian Multimedia Maintainers 
<pkg-multimedia-maintainers at lists.alioth.debian.org>
Date: Mon, 25 May 2015 04:53:18 +0200
From: Frank Heckenbach <f.heckenbach at fh-soft.de>
Reply-To: Frank Heckenbach <f.heckenbach at fh-soft.de>, 786737 at bugs.debian.org
To: submit at bugs.debian.org

Package: jackd1
Version: 1:0.124.1+20140122git5013bed0-3
Severity: normal
Tags: upstream patch

When the "-n" option is given, jackd crashes when accessing
properties (which it seems to do implicitly for any client, e.g.
jack_lsp).

To reproduce:

   jackd -nfoo -dalsa
or
   JACK_DEFAULT_SERVER=bar jackd -nfoo -dalsa

While jackd is running, repeat this:

   JACK_DEFAULT_SERVER=foo jack_lsp

After a few tries, jackd crashes:

   /dev/shm/jack-0/default/__db.001: No such file or directory
   cannot open DB environment: No such file or directory
   Segmentation fault

I found several problems in the code:

- jack_property_init():

   Returns early if db_env != NULL. However, on failure later returns
   with db_env != NULL, but db == NULL. Callers assume db != NULL
   after it returns.

   Patch below. This fixes at least the segfault, but the error
   message remains (and whatever consequences it may have, I don't
   know).

- 7 places in metadata.c:

         if (jack_property_init (NULL)) {

   If NULL is passed for server_name, of course it won't use the
   actual server name.

   How is this supposed to work at all? Was it ever tested?

   A fix should consist of passing the actual server name from the
   callers.

--- libjack/metadata.c
+++ libjack/metadata.c
@@ -45,11 +45,11 @@

          /* idempotent */

-        if (db_env) {
+        if (db) {
                  return 0;
          }

-        if ((ret = db_env_create(&db_env, 0)) != 0) {
+        if (!db_env && (ret = db_env_create(&db_env, 0)) != 0) {
                  jack_error ("cannot initialize DB environment: %s\n", 
db_strerror(ret));
                  return -1;
          }

_______________________________________________
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers at lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers





More information about the Jackaudio mailing list