View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001287 | ardour | bugs | public | 2006-11-03 04:00 | 2008-11-20 23:47 |
| Reporter | brianahr | Assigned To | taybin | ||
| Priority | normal | Severity | crash | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| OS | Linux | OS Version | Gentoo | ||
| Summary | 0001287: Crash due to bad delete[] | ||||
| Description | after the recent update from r1062 to 1065, ardour now crashes due to a delete on uninitialized memory. | ||||
| Steps To Reproduce | start ardour from a terminal new session exit ardour 'Segmentation fault' appears in the terminal. | ||||
| Additional Information | I compiled with DEBUG=1, and ran it through GDB. it appears that the problem is here: (gdb) frame 3 #3 0xb7ebf191 in ~SndFileSource (this=0x8c2b778) at libs/ardour/sndfilesource.cc:300 300 delete [] xfade_buf; basically, it looks like in non-destructive mode, xfade_buf is deleted but never instantiated and/or initialized. for suggested fix, see patch. | ||||
| Tags | No tags attached. | ||||
|
2006-11-03 04:00
|
ardour-r1065-seg-fix.patch (580 bytes)
Index: libs/ardour/sndfilesource.cc
===================================================================
--- libs/ardour/sndfilesource.cc (revision 1065)
+++ libs/ardour/sndfilesource.cc (working copy)
@@ -213,7 +213,9 @@
if (destructive()) {
xfade_buf = new Sample[xfade_frames];
timeline_position = header_position_offset;
- }
+ } else {
+ xfade_buf = NULL;
+ }
AudioFileSource::HeaderPositionOffsetChanged.connect (mem_fun (*this, &SndFileSource::handle_header_position_change));
}
|
|
|
one other thing i forgot to mention (which I found while looking for this, and seems to be a related memory leak): in libs/ardour/destructive_filesource.cc it looks like DestructiveFileSource::~DestructiveFileSource() { delete xfade_buf; } should be DestructiveFileSource::~DestructiveFileSource() { delete [] xfade_buf; } since xfade_buf is instantiated as Sample *xfade_buf = new Sample[xfade_frames]; |
|
|
Good catch. Thanks. I've slightly reworked it though. Just a style thing. I put the xfade_buf = 0 at the top with the other _buf initialzations. |
|
|
I think the delete [] thing was caught already as of 1065. |
|
|
Thanks for the patches. Keep 'em coming! :) |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2006-11-03 04:00 | brianahr | New Issue | |
| 2006-11-03 04:00 | brianahr | File Added: ardour-r1065-seg-fix.patch | |
| 2006-11-03 04:14 | brianahr | Note Added: 0002612 | |
| 2006-11-03 04:20 | taybin | Note Added: 0002613 | |
| 2006-11-03 04:22 | taybin | Note Edited: 0002613 | |
| 2006-11-03 04:23 | taybin | Note Added: 0002614 | |
| 2006-11-03 04:24 | taybin | Status | new => resolved |
| 2006-11-03 04:24 | taybin | Resolution | open => fixed |
| 2006-11-03 04:24 | taybin | Assigned To | => taybin |
| 2006-11-03 04:24 | taybin | Note Added: 0002615 | |
| 2008-11-20 23:47 | seablade | Status | resolved => closed |