Bug fix: SIGSEGV could happen if a track ended by reaching its fixed size while the track source still was willing to deliver bytes

This commit is contained in:
Thomas Schmitt 2018-08-08 17:27:09 +02:00
parent e35995b85e
commit ff039e8096
3 changed files with 25 additions and 1 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2018.02.05.103650" #define Cdrskin_timestamP "2018.08.08.152622"

View File

@ -331,8 +331,31 @@ static int fifo_set_size(struct burn_source *source, off_t size)
static void fifo_free(struct burn_source *source) static void fifo_free(struct burn_source *source)
{ {
struct burn_source_fifo *fs = source->data; struct burn_source_fifo *fs = source->data;
int wait_count;
static int wait_max = 30, wait_usleep = 100000;
burn_fifo_abort(fs, 0); burn_fifo_abort(fs, 0);
for (wait_count = 0; wait_count <= wait_max; wait_count++) {
if (fs->thread_is_valid <= 0)
break;
if (wait_count < wait_max)
usleep(wait_usleep);
}
if (wait_count > wait_max) {
/* The shoveler thread might still be active. If so, it would
use invalid or inappropriate memory if the fifo would be
disposed now. A memory and resource leak is the better
option here.
*/
libdax_msgs_submit(libdax_messenger, -1,
0x000201ab,
LIBDAX_MSGS_SEV_WARNING,
LIBDAX_MSGS_PRIO_HIGH,
"Leaving burn_source_fifo object undisposed because it is possibly stuck but alive",
0, 0);
return;
}
if (fs->inp != NULL) if (fs->inp != NULL)
burn_source_free(fs->inp); burn_source_free(fs->inp);

View File

@ -613,6 +613,7 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
0x000201a8 (FAILURE,HIGH) = SCSI command yielded driver problem 0x000201a8 (FAILURE,HIGH) = SCSI command yielded driver problem
0x000201a9 (FAILURE,HIGH) = Implausible length from GET CONFIGURATION 0x000201a9 (FAILURE,HIGH) = Implausible length from GET CONFIGURATION
0x000201aa (FAILURE,HIGH) = No CD-TEXT packs in file 0x000201aa (FAILURE,HIGH) = No CD-TEXT packs in file
0x000201ab (WARN,HIGH) = Leaving burn_source_fifo object undisposed
libdax_audioxtr: libdax_audioxtr: