| Issue 1: | Crashes in Ingen and Ardour | |
| 3 people starred this issue and may be notified of changes. | Back to list |
Hello, When using Ingen as the host, it loads, but crashes Ingen as soon as I connect it to an audio stream. I got it to open in Ardour, but shortly after, it started crashing Ardour. Now Ardour crashes the moment I load the plugin into the effects bay. Any idea what could be wrong? It seemed to compile just fine. Thanks, Ian Lacy ian@polycarbonaterecords.net
Nov 10, 2010
I just tested it in Ardour 2, and there were no problems. I'm trying to install ingen on my computer to test it out, but the drobilla install seems to conflict deeply with debian packages. If you could run ingen under gdb (run gdb ignen), and then give me a backtrace when it crashes that would be great (i.e. when it drops to the gdb command line, type "backtrace" and paste the text it outputs into this bug report).
Owner:
jeremybubs
Nov 10, 2010
Also, a note: I'm sorry it took so long for me to respond. For some reason, google code won't notify you by email or anything when somebody opens an issue. I starred this issue, so now I think I will be notified.
Nov 10, 2010
(No comment was entered for this change.)
Summary:
Crashes in Ingen and Ardour
Dec 10, 2010
I also get a segfault when running through lv2rack. As soon as I connect Jack, the plugin crashes. I'm on 64bit, ubuntu 10.10. Is there a simple way to get stacktrace from the plugin run?
Dec 10, 2010
Here's the trace - got it using gdb and lv2_jack_host.
... snipped initialization info....
[New Thread 0x7ffff7ec4710 (LWP 3324)]
Press enter to quit:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7ec4710 (LWP 3324)]
0x00007fffee0027a6 in get_pitch_period (pdetector=0x6b76c0, autocorr=0x6c6fb0, Nf=<value optimized out>, fs=<value optimized out>) at pitch_detector.c:106
106 while(**bestpeakindex < pdetector->ppickthresh * peak) {
(gdb) bt
#0 0x00007fffee0027a6 in get_pitch_period (pdetector=0x6b76c0, autocorr=0x6c6fb0, Nf=<value optimized out>, fs=<value optimized out>) at pitch_detector.c:106
#1 0x00007fffee00411e in runTalentedHack (instance=0x6b7600, sample_count=<value optimized out>) at talentedhack.c:296
#2 0x00000000004018ca in jack_process_cb ()
#3 0x00007ffff70a0b8a in ?? () from /usr/lib/libjack.so.0
#4 0x00007ffff70b9390 in ?? () from /usr/lib/libjack.so.0
#5 0x00007ffff6e7a971 in start_thread () from /lib/libpthread.so.0
#6 0x00007ffff69ce94d in clone () from /lib/libc.so.6
#7 0x0000000000000000 in ?? ()
Dec 10, 2010
The problem is bestpeakindex being derference to zero value - *bestpeakindex == 0. The next iteration in the while loop then trie to do **bestpeakindex which leads to the segfault.
I don't understand the algorithm, and I'm a little bit lost in this circular buffer implementation, but adding some debugging output like this (pitchdetector.c, line 100):
float peak=-2; //height of highest peak found
int abovezero=1; //boolean
int scount = 0;
while (i<end) {
if(*i<=0) {
if(abovezero) {
scount++;
//recalculate best peak index;
while(**bestpeakindex < pdetector->ppickthresh * peak) {
fprintf(stderr,"--- run #%d\n", scount);
fprintf(stderr,"endpeak is %p * %p ** %f \n", endpeak, *endpeak, **endpeak);
fprintf(stderr,"bestpeak was %p * %p ** %f ; incerementing \n", bestpeakindex, *bestpeakindex, **bestpeakindex);
bestpeakindex++;
fprintf(stderr,"bestpeak is %p * %p \n", bestpeakindex, *bestpeakindex);
if(bestpeakindex>endpeak) {
bestpeakindex=peaks;
}
}
I can see several succesful function calls (which reset the "scount" I set up) and end up with this output:
--- run #4
endpeak is 0x7ffff7ec3be0 * 0x7fffedd5d100 ** 509002.250000
bestpeak was 0x7ffff7ebfd68 * 0x6c9268 ** 0.288633 ; incerementing
bestpeak is 0x7ffff7ebfd70 * 0x6c9270
--- run #42
endpeak is 0x7ffff7ec3be0 * 0x7fffedd5d100 ** 509002.250000
bestpeak was 0x7ffff7ebfd70 * 0x6c9270 ** 0.298191 ; incerementing
bestpeak is 0x7ffff7ebfd78 * 0x6c9278
--- run #1
endpeak is 0x7ffff7ec3be0 * 0x7fffedd5d100 ** 509002.250000
bestpeak was 0x7ffff7ebfd60 * 0x6c9264 ** -15.190291 ; incerementing
bestpeak is 0x7ffff7ebfd68 * (nil)
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7ec4710 (LWP 5452)]
0x00007fffee00293b in get_pitch_period (pdetector=0x6b9740, autocorr=<value optimized out>,
Nf=<value optimized out>, fs=<value optimized out>) at pitch_detector.c:108
108 while(**bestpeakindex < pdetector->ppickthresh * peak) {
So it doesn't happen everytime.
Dec 10, 2010
Hi, I looked at the code, and I think I've fixed it. Try checking out the new svn version. Basically, there was an off-by one error in the circular buffer causing it to behave more like a finite buffer that would segfault when it overflowed. I'm confused as to how it continued to work without a flaw on my system. My best guess is that we are using different sampling rates or you were dealing with higher frequency sound, so you were getting more peaks. My buffer had fewer peaks, so it never had to wrap around, so the code to properly wrap around was never tested. Please let me know if this change fixes it.
Status:
Fixed
Dec 11, 2010
Yes, this fixed it here. I was using 88.2khz sampling rate. It died straight from the incoming noise.
Dec 11, 2010
(No comment was entered for this change.)
Status:
Verified
|
295 KB View Download