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

PrevNext  Index
DateTue, 25 Aug 2015 17:43:57 +0200
From Adrian Knoth <[hidden] at drcomp dot erfurt dot thur dot de>
Tojack-devel <[hidden] at lists dot jackaudio dot org>
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 <[hidden]>
Resent-To: [hidden]
Resent-CC: Debian Multimedia Maintainers 
<[hidden]>
Date: Mon, 25 May 2015 04:53:18 +0200
From: Frank Heckenbach <[hidden]>
Reply-To: Frank Heckenbach <[hidden]>, [hidden]
To: [hidden]

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
[hidden]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers
PrevNext  Index

1440517448.13892_0.ltw:2, <55DC8D3D.2000303 at drcomp dot erfurt dot thur dot de>