On Tue, 4 May 2010, Stefan Bischoff wrote:

"Mixer reports a segmentation fault
mixer crashed
something bad happened and IDJC could not continue"

Unfortunately, if /anything/ crashes in idjcmixer... you get this same error message. So, some manner of backtrace is really necc. in order to isolate the cause.

However, I've observed this crash some weeks ago, and the backtrace (going from memory) was something like:

    #0 shutdown()
    #1 JackClientSocket::Close()
    ....
    #x jack_client_open()
    #y main() (in ijcjmixer.c)

At execution time, the symbol `shutdown' is null... which causes the segfault. The symbol should have resolved to the BSD socket shutdown() function.

However, there is a global variable `int shutdown' in idjcmixer.c, and it is initialized to 0. For some reason it is masking shutdown() so that the Jack library is trying to execute a plain integer.

Whatever causes the bug, it appears to be in the binary.
When compiled on Ubuntu/Jaunty and executed in either Jaunty or Karmic -- the bug persisted. When recompiled on Karmic, the bug went away.

I don't know if this is a bug in idjc, gcc, libc, ld, ld.so, or even jack... but the attached patch works around the issue by renaming the global variable. I suspect it's an ld bug, though. I can't create a reproducable test case, though.

Other programs using jack still work great. So I think its not a problem in
jack but in idjc.

This happened for me with Jack2.

FYI, I reported the issue to upstream, but did not receive a response.

-gabriel
--- a/c/idjcmixer.c
+++ b/c/idjcmixer.c
@@ -99,7 +99,7 @@ int left_samples_total, right_samples_total;
 int main_play;
 /* if the main app segfaults or similar this counter will see that the mixer terminates */
 int timeout;
-int shutdown;
+int g_shutdown;
 /* flag set when jack closes the client thread for example when the jackd is closed */
 int jack_closed_f;
 /* flag to indicate whether to use the player reading function which supports speed variance */
@@ -585,10 +585,10 @@ void process_audio(jack_nframes_t nframes)
 
    if (timeout > 8000)
       {
-      if (!shutdown)
+      if (!g_shutdown)
          {
          fprintf(stderr, "timeout exceeded\n");
-         shutdown = TRUE;
+         g_shutdown = TRUE;
          }
       plr_l->command = CMD_COMPLETE;
       plr_r->command = CMD_COMPLETE;
@@ -637,10 +637,10 @@ void process_audio(jack_nframes_t nframes)
    if (!(lp_lc && lp_rc && rp_lc && rp_rc && jp_lc && jp_rc && ip_lc && ip_rc &&
          lp_lcf && lp_rcf && rp_lcf && rp_rcf && jp_lcf && jp_rcf && ip_lcf && ip_rcf))
       {
-      if (!shutdown)
+      if (!g_shutdown)
          {
          printf("Malloc failure in process audio\n");
-         shutdown = TRUE;
+         g_shutdown = TRUE;
          }
       plr_l->command = CMD_COMPLETE;
       plr_r->command = CMD_COMPLETE;
@@ -2025,7 +2025,7 @@ int main(int argc, char **argv)
       
    while (kvp_parse(kvpdict, fp))
       {
-      if (jack_closed_f == TRUE || shutdown == TRUE)
+      if (jack_closed_f == TRUE || g_shutdown == TRUE)
          break;
       if (!strcmp(action, "sync"))
          {
_______________________________________________
pkg-multimedia-maintainers mailing list
pkg-multimedia-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-multimedia-maintainers

Reply via email to