View Issue Details

IDProjectCategoryView StatusLast Update
0001161ardourbugspublic2008-11-21 00:09
Reporterindigo Assigned Toessej  
PrioritynormalSeveritycrashReproducibilitysometimes
Status closedResolutionfixed 
Summary0001161: segfault when playing with post-fader effects
DescriptionI was working on a song, trying different effects here and there. All while the transport is rolling, right click under the fader in the mixer, select "new effect", pick on, add. Double-click newly added plugin, and bam, segfault about 75% of the time. I know 'tape delay simulation' from swh-plugins does it, as do others. of the 3 times i tried to use tape delay, one time I was able to add it and open the properties window without problems; the other 2 i got the segfault when I double-clicked it.

This is a build from a CVS tarball about 3 days ago. I was having issues with some ladspa plugins making total noise, so I rebuilt them all this morning with the same compiler environment as I use for ardour.
Additional InformationCopyright (C) 1999-2005 Paul Davis
Some portions Copyright (C) Steve Harris, Ari Johnson, Brett Viren, Joel Baker

Ardour comes with ABSOLUTELY NO WARRANTY
not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This is free software, and you are welcome to redistribute it
under certain conditions; see the source for copying conditions.
Loading UI configuration file /usr/local/etc/ardour/ardour_ui.rc
Loading system configuration file /usr/local/etc/ardour/ardour_system.rc
Loading user configuration file /home/indigo/.ardour/ardour.rc
ardour: [INFO]: No H/W specific optimizations in use
ardour: [WARNING]: Your system generates "Mod2" when the NumLock key is pressed.
 This can cause problems when editing so Ardour will use Mod3 to mean Meta rathe
r than Mod2
[New Thread 1090525536 (LWP 25605)]
[New Thread 1098918240 (LWP 25606)]
Loading session /home/indigo/jams/2005-12-06 using snapshot 2005-12-06
[New Thread 1107310944 (LWP 25607)]
[New Thread 1115703648 (LWP 25608)]
[New Thread 1124096352 (LWP 25609)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1098918240 (LWP 25606)]
0x00000000007c7b5e in ARDOUR::AutomationList::automation_write (this=0x0)
    at automation_event.h:116
116 automation_event.h: No such file or directory.
        in automation_event.h
(gdb) bt
#0 0x00000000007c7b5e in ARDOUR::AutomationList::automation_write (this=0x0)
    at automation_event.h:116
0000001 0x00000000007c2550 in ARDOUR::PluginInsert::automation_snapshot (
    this=0x2056140, now=66136346) at libs/ardour/insert.cc:327
#2 0x000000000081e271 in ARDOUR::Route::automation_snapshot (this=0x16d18c0,
    now=66136346) at libs/ardour/route.cc:2260
#3 0x00000000007682b0 in ARDOUR::AudioTrack::roll (this=0x16d18c0,
    nframes=32, start_frame=66136346, end_frame=66136378, offset=0, declick=0,
    can_record=false, rec_monitors_input=true)
    at libs/ardour/audio_track.cc:569
0000004 0x000000000086c32a in ARDOUR::Session::process_routes (this=0x1365560,
    nframes=32, offset=0) at libs/ardour/session_process.cc:138
0000005 0x000000000086d614 in ARDOUR::Session::process_without_events (
    this=0x1365560, nframes=32) at libs/ardour/session_process.cc:750
#6 0x000000000086d8ef in ARDOUR::Session::process_with_events (
    this=0x1365560, nframes=32) at libs/ardour/session_process.cc:276
#7 0x000000000086bd8b in ARDOUR::Session::process (this=0x1365560, nframes=32)
    at libs/ardour/session_process.cc:62
0000008 0x000000000077122c in ARDOUR::AudioEngine::process_callback (
    this=0x1045380, nframes=32) at libs/ardour/audioengine.cc:315
0000009 0x00000000007713c5 in ARDOUR::AudioEngine::_process_callback (nframes=32,
    arg=0x1045380) at libs/ardour/audioengine.cc:210
0000010 0x00002aaaacb348c7 in jack_client_thread (arg=Variable "arg" is not available.
) at client.c:1436
0000011 0x00002aaaac9020fa in start_thread () from /lib/libpthread.so.0
0000012 0x00002aaaad024383 in clone () from /lib/libc.so.6
0000013 0x0000000000000000 in ?? ()
TagsNo tags attached.

Activities

2005-12-09 04:52

 

autoredirect.patch (1,412 bytes)   
Index: libs/ardour/route.cc
===================================================================
RCS file: /home/las/cvsroot/ardour/ardour/libs/ardour/route.cc,v
retrieving revision 1.173
diff -u -r1.173 route.cc
--- libs/ardour/route.cc	9 Sep 2005 12:43:30 -0000	1.173
+++ libs/ardour/route.cc	9 Dec 2005 04:51:44 -0000
@@ -1935,12 +1935,14 @@
 {
 	jack_nframes_t now = _session.transport_frame();
 
-	if (!did_locate) {
-		automation_snapshot (now);
-	}
-
 	{
 		LockMonitor lm (redirect_lock, __LINE__, __FILE__);
+
+		if (!did_locate) {
+			automation_snapshot (now);
+		}
+
+
 		for (RedirectList::iterator i = _redirects.begin(); i != _redirects.end(); ++i) {
 			
 			if (Config->get_plugins_stop_with_transport() && can_flush_redirects) {
@@ -2053,7 +2055,15 @@
 Route::roll (jack_nframes_t nframes, jack_nframes_t start_frame, jack_nframes_t end_frame, jack_nframes_t offset, int declick,
 	     bool can_record, bool rec_monitors_input)
 {
-	automation_snapshot (_session.transport_frame());
+	{ 
+		TentativeLockMonitor am (redirect_lock, __LINE__, __FILE__);
+		
+		if (am.locked()) {
+			// we need to take the redirect lock out here because this
+			// method is called from two different thread contexts and accesses them
+			automation_snapshot (_session.transport_frame());
+		}
+	}
 
 	if ((n_outputs() == 0 && _redirects.empty()) || n_inputs() == 0 || !_active) {
 		silence (nframes, offset);
autoredirect.patch (1,412 bytes)   

essej

2005-12-09 04:56

manager   ~0002405

Found race condition with Route::automation_snapshot() call. It is called while rolling in the audio thread and accessed the redirects list without taking the redirect_lock. care was taken because automation_snapshot() is also called from other non-rt threads so made sure the lock was appropriately taken (tentatively or not) wherever it was called.

Please try to reproduce after applying the autoredirect.patch

indigo

2005-12-09 12:31

reporter   ~0002406

No joy. Seems to do the same thing:

(gdb) r
Starting program: /usr/local/bin/ardour
[Thread debugging using libthread_db enabled]
[New Thread 46912539054000 (LWP 26036)]
[New Thread 1082132832 (LWP 26037)]
Ardour/GTK 0.99.1
   (built using 1.0.2 with libardour 0.902.0 and GCC version 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9))
Copyright (C) 1999-2005 Paul Davis
Some portions Copyright (C) Steve Harris, Ari Johnson, Brett Viren, Joel Baker

Ardour comes with ABSOLUTELY NO WARRANTY
not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This is free software, and you are welcome to redistribute it
under certain conditions; see the source for copying conditions.
Loading UI configuration file /usr/local/etc/ardour/ardour_ui.rc
Loading system configuration file /usr/local/etc/ardour/ardour_system.rc
Loading user configuration file /home/indigo/.ardour/ardour.rc
ardour: [INFO]: No H/W specific optimizations in use
ardour: [WARNING]: Your system generates "Mod2" when the NumLock key is pressed. This can cause problems when editing so Ardour will use Mod3 to mean Meta rather than Mod2
[New Thread 1090525536 (LWP 26038)]
[New Thread 1098918240 (LWP 26039)]
Loading session /home/indigo/jams/2005-12-06 using snapshot 2005-12-06
[New Thread 1107310944 (LWP 26040)]
[New Thread 1115703648 (LWP 26041)]
[New Thread 1124096352 (LWP 26042)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1098918240 (LWP 26039)]
0x00000000007c7b5e in ARDOUR::AutomationList::automation_write (this=0x0) at automation_event.h:116
116 automation_event.h: No such file or directory.
        in automation_event.h
(gdb) thread apply all bt

Thread 7 (Thread 1124096352 (LWP 26042)):
#0 0x00002aaaad01b5d2 in poll () from /lib/libc.so.6
0000001 0x0000000000862f53 in ARDOUR::Session::feedback_thread_work (this=0x13658e0) at libs/ardour/session_feedback.cc:137
#2 0x00000000008632a7 in ARDOUR::Session::_feedback_thread_work (arg=0x13658e0) at libs/ardour/session_feedback.cc:112
#3 0x00002aaaac9020fa in start_thread () from /lib/libpthread.so.0
0000004 0x00002aaaad024383 in clone () from /lib/libc.so.6
0000005 0x0000000000000000 in ?? ()
#6 0x0000000000000000 in ?? ()
...
0000211 0x0000000000000000 in ?? ()
0000212 0x0000000000000000 in ?? ()
0000213 0x00002aaaad18e0e0 in __check_rhosts_file () from /lib/libc.so.6
0000214 0x0000000043005dc0 in ?? ()
0000215 0x000000000000000b in ?? ()
Previous frame inner to this frame (corrupt stack?)
0x00000000007c7b5e 116 in automation_event.h
(gdb) bt
#0 0x00000000007c7b5e in ARDOUR::AutomationList::automation_write (this=0x0) at automation_event.h:116
0000001 0x00000000007c2550 in ARDOUR::PluginInsert::automation_snapshot (this=0x1f5cf10, now=1608499) at libs/ardour/insert.cc:327
#2 0x000000000081e271 in ARDOUR::Route::automation_snapshot (this=0x1691140, now=1608499) at libs/ardour/route.cc:2270
#3 0x00000000007682b0 in ARDOUR::AudioTrack::roll (this=0x1691140, nframes=32, start_frame=1608499, end_frame=1608531, offset=0,
    declick=0, can_record=false, rec_monitors_input=true) at libs/ardour/audio_track.cc:569
0000004 0x000000000086c3a6 in ARDOUR::Session::process_routes (this=0x13658e0, nframes=32, offset=0) at libs/ardour/session_process.cc:138
0000005 0x000000000086d690 in ARDOUR::Session::process_without_events (this=0x13658e0, nframes=32) at libs/ardour/session_process.cc:750
#6 0x000000000086d96b in ARDOUR::Session::process_with_events (this=0x13658e0, nframes=32) at libs/ardour/session_process.cc:276
#7 0x000000000086be07 in ARDOUR::Session::process (this=0x13658e0, nframes=32) at libs/ardour/session_process.cc:62
0000008 0x000000000077122c in ARDOUR::AudioEngine::process_callback (this=0x1045380, nframes=32) at libs/ardour/audioengine.cc:315
0000009 0x00000000007713c5 in ARDOUR::AudioEngine::_process_callback (nframes=32, arg=0x1045380) at libs/ardour/audioengine.cc:210
0000010 0x00002aaaacb348c7 in jack_client_thread (arg=Variable "arg" is not available.
) at client.c:1436
0000011 0x00002aaaac9020fa in start_thread () from /lib/libpthread.so.0
0000012 0x00002aaaad024383 in clone () from /lib/libc.so.6
0000013 0x0000000000000000 in ?? ()
...
0000220 0x0000000000000000 in ?? ()
0000221 0x00002aaaad18e0e0 in __check_rhosts_file () from /lib/libc.so.6
0000222 0x0000000041802dc0 in ?? ()
0000223 0x0000000000000004 in ?? ()
Previous frame inner to this frame (corrupt stack?)
(gdb)

2005-12-11 16:16

 

autoredirect2.patch (800 bytes)   
Index: libs/ardour/audio_track.cc
===================================================================
RCS file: /home/las/cvsroot/ardour/ardour/libs/ardour/audio_track.cc,v
retrieving revision 1.74
diff -u -r1.74 audio_track.cc
--- libs/ardour/audio_track.cc	6 Dec 2005 04:02:29 -0000	1.74
+++ libs/ardour/audio_track.cc	11 Dec 2005 16:15:37 -0000
@@ -571,7 +571,15 @@
 	Sample* tmpb;
 	jack_nframes_t transport_frame;
 
-	automation_snapshot (start_frame);
+	{ 
+		TentativeLockMonitor am (redirect_lock, __LINE__, __FILE__);
+		
+		if (am.locked()) {
+			// we need to take the redirect lock here because this
+			// method is called from two different thread contexts and accesses them
+			automation_snapshot (start_frame);
+		}
+	}
 
 	if (n_outputs() == 0 && _redirects.empty()) {
 		return 0;
autoredirect2.patch (800 bytes)   

essej

2005-12-11 16:17

manager   ~0002407

OK, the first patch fixed the problem for buses, the 2nd patch should fix it for tracks. apply autoredirect2.patch and report back.

indigo

2005-12-12 14:32

reporter   ~0002408

Tried new patch in addition to the first one last night and behaviour seemed unchanged. I was pasting a traceback when my computer went totally nuts; I'll try to post it again when I get home tonight.

indigo

2005-12-12 14:34

reporter   ~0002409

oh yeah, it occured to me one possible cause of the crash is that I'm inserting a plugin with 1 input (tape delay simulation) after a plugin with 2 outputs (tap reverb, the track is stereo). I will try some stereo plugins tonight to see what they do.

taybin

2007-02-14 22:51

administrator   ~0003284

Is this still an issue?

paul

2007-03-05 20:35

administrator   ~0003514

this bug will be closed on March 7th if there is no further feedback.

paul

2007-03-12 15:03

administrator   ~0003559

see notes for history.

Issue History

Date Modified Username Field Change
2005-12-09 03:53 indigo New Issue
2005-12-09 03:53 indigo E-mail => indigo@bitglue.com
2005-12-09 04:52 essej File Added: autoredirect.patch
2005-12-09 04:56 essej Note Added: 0002405
2005-12-09 04:57 essej Assigned To => essej
2005-12-09 04:57 essej Status new => feedback
2005-12-09 12:31 indigo Note Added: 0002406
2005-12-11 16:16 essej File Added: autoredirect2.patch
2005-12-11 16:17 essej Note Added: 0002407
2005-12-12 14:32 indigo Note Added: 0002408
2005-12-12 14:34 indigo Note Added: 0002409
2007-02-14 22:51 taybin Note Added: 0003284
2007-03-05 20:35 paul Note Added: 0003514
2007-03-12 15:03 paul Status feedback => resolved
2007-03-12 15:03 paul Resolution open => fixed
2007-03-12 15:03 paul Note Added: 0003559
2008-11-21 00:09 seablade Status resolved => closed