Red Hat Bugzilla – Bug 127658
xcdroast segfaults parsing cdda2wav output
Last modified: 2007-11-30 17:10:46 EST
Description of problem:
Due to the way that xcdroast parses output from cdda2wav, it may
segfault while reading the table of contents of a CD.
Version-Release number of selected component (if applicable):
From time to time in normal usage. Can be forced.
The problem is that xcdroast expects to read() entire lines from
cdda2wav's output file descriptor, but that isn't how it write()s:
write(2, "T22:", 4) = 4
write(2, " 340375", 8) = 8
write(2, " 3:01.32", 9) = 9
write(2, " audio pre-emphasized copydenied stereo", 39) = 39
So there is a race condition where cdda2wav may have started writing a
line but not finished, and xcdroast has begun to parse it.
#0 0x08089d36 in parse_toc_line (line=0xfee5ab00 "T22: 340375 3:01.32")
#1 0x0808a880 in parse_toc (line=0xfee5ab00 "T22: 340375 3:01.32")
#2 0x0808aa0f in getcdtoc_out (data=0x0, source=135150288,
cond=GDK_INPUT_READ) at io.c:2979
#3 0x0013bb3b in gdk_get_show_events () from /usr/lib/libgdk-x11-2.0.so.0
#4 0x00000000 in ?? ()
Here, xcdroast requires 'data' or 'audio' following the track length,
but cdda2wav didn't write that out before xcdroast read the line.
Created attachment 101806 [details]
This patch works around the problem for me.