Message info
To:Pascal Daniel Angst From:Samuel Thibault Subject:Bug#660302: ebook-speaker: Segmentation Fault Date:Sun, 19 Feb 2012 20:51:52 +0100

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.
> 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.