[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#660302: ebook-speaker: Segmentation Fault

clone 660302 -1
retitle -1 sox_format_quit does not unregister format functions
found -1 14.3.2-3
tags -1 + patch


Pascal Daniel Angst, le Fri 17 Feb 2012 23:47:39 -0200, a écrit :
> Starting ebook-speaker with different epub files (e.g.
> http://www.lasindias.org/epubs/elpoderdelasredes.epub) from Gnome Terminal
> displays inicial screen. Help function works, but on hitting "Enter", the
> computer plays a pitchy sound and the program exits with "Segmentation Fault"
> statement.

While there is probably a bug in ebook-speaker that leads to this
situation, the Segmentation Fault is due to sox: src/formats.c's
init_format adds a function pointer coming from loaded modules into
the sox_format_fns array, during the call to sox_format_init(), but
sox_format_quit() does not removes these function pointers before
calling lt_dlexit(). The array thus remains with dangling pointers,
which crash as soon as browsing the sox_format_fns again. The attached
patch avoids the issue by not unloading the modules, which spends
memory but works not too bad. However, a loop repeatedly calling
sox_format_init()/sox_format_quit() would eventually overrun the
sox_format_fns array.

--- src/formats.c.orig	2012-02-19 20:41:44.491791226 +0100
+++ src/formats.c	2012-02-19 20:41:46.639744868 +0100
@@ -1218,7 +1218,7 @@
 void sox_format_quit(void) /* Cleanup things.  */
+#if 0 //def HAVE_LIBLTDL
   int ret;
   if (plugins_initted && (ret = lt_dlexit()) != 0)
     lsx_fail("lt_dlexit failed with %d error(s): %s", ret, lt_dlerror());

Reply to: