Re: [ecasound] bug in RAWFILE::close()

New Message Reply Date view Thread view Subject view Author view Other groups

Subject: Re: [ecasound] bug in RAWFILE::close()
From: Kai Vehmanen (k@eca.cx)
Date: Tue May 08 2001 - 05:28:31 EEST


On Thu, 5 Apr 2001, S. Massy wrote:

> There is a bug in RAWFILE::close() which triggers a segfault if for
> example you try to remove a raw file object with aio-remove. I have
> changed a few lines and it "seems" to have fixed the problem.
[...]
> void RAWFILE::close(void) {
> if (is_open() && fio_repp != 0) {
> fio_repp->close_file();
> delete fio_repp;
> fio_repp = 0;
> }
> toggle_open_state(false);
> }

Ok, I've applied this fix now. There's nothing inherently wrong in the old
RAWFILE::close(), but without the above safety-check, nasty things will
happen if someone decides to call the function multiple times in a row.
It's likely that you will execute 'delete fio_repp' twice, and on the
second time: boom, a seg.fault.

-- 
 http://www.eca.cx
 Audio software for Linux!

-- To unsubscribe send message 'unsubscribe' in the body of the message to <ecasound-list-request@wakkanet.fi>.


New Message Reply Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Tue May 08 2001 - 05:09:20 EEST