View Issue Details

IDProjectCategoryView StatusLast Update
0009027ardourbugspublic2022-10-26 23:14
Reportergonsolo Assigned Tox42  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformUbuntuOSLinuxOS Version(any)
Product Version7.0 
Summary0009027: Ardour 7 crashes
Description0009011 fixed a bug where Midi notes were lost. Now Ardour is crashing (when I'm looping through a region after the first run):

ardour-7.0.78: ../libs/ardour/plugin_insert.cc:1382: void ARDOUR::PluginInsert::automate_and_run(ARDOUR::BufferSet&, ARDOUR::samplepos_t, ARDOUR::samplepos_t, double, ARDOUR::pframes_t): Zusicherung »cnt > 0« nicht erfüllt.

It seems it is this problematic "distance" again:

    samplecnt_t cnt = min (timepos_t (start).distance (next_event.when).samples(), (samplecnt_t) nframes);

The archived project can be found here (since I couldn't upload it because it is 2.5MB):
https://drive.google.com/file/d/1yAc12rxdwuMNrcdr2gV_lpkL0vPSrNcY/view?usp=sharing

I'm trying to loop through bars 40 to 48.
Steps To ReproduceOpen the project.
Try to loop from bar 40 to bar 48.
Bang.
TagsNo tags attached.

Activities

gonsolo

2022-10-23 07:15

reporter   ~0026677

I'm also getting a crash when trying to play from bar 290:

#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
0000001 __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3 0x00007fffe7a3bc46 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
0000004 0x00007fffe7a227fc in __GI_abort () at ./stdlib/abort.c:79
0000005 0x00007ffff4870707 in Temporal::TempoMap::get_grid (this=0x55555ecca830, ret=empty std::__cxx11::list, start=275076360720, end=275082381840,
    bar_mod=0) at ../libs/temporal/tempo.cc:1906
#6 0x00007ffff6e75fa2 in ARDOUR::LV2Plugin::connect_and_run (this=0x55556e442560, bufs=..., start=46781694, end=46782718, speed=1, in_map=...,
    out_map=..., nframes=1024, offset=0) at ../libs/ardour/lv2_plugin.cc:2670
#7 0x00007ffff6b4c418 in ARDOUR::PluginInsert::connect_and_run (this=0x55556e43cbc0, bufs=..., start=46781694, end=46782718, speed=1,
    nframes=1024, offset=0, with_auto=true) at ../libs/ardour/plugin_insert.cc:1107
0000008 0x00007ffff6b4de7c in ARDOUR::PluginInsert::automate_and_run (this=0x55556e43cbc0, bufs=..., start=46781694, end=46782718, speed=1,
    nframes=1024) at ../libs/ardour/plugin_insert.cc:1375
0000009 0x00007ffff6b4da74 in ARDOUR::PluginInsert::run (this=0x55556e43cbc0, bufs=..., start_sample=46781694, end_sample=46782718, speed=1,
    nframes=1024) at ../libs/ardour/plugin_insert.cc:1326
0000010 0x00007ffff6c2a55e in ARDOUR::Route::process_output_buffers (this=0x55556cec9c60, bufs=..., start_sample=46781694, end_sample=46782718,
    nframes=1024, gain_automation_ok=true, run_disk_reader=true) at ../libs/ardour/route.cc:543

paul

2022-10-24 03:13

administrator   ~0026683

This should already be fixed in git master.

gonsolo

2022-10-24 08:33

reporter   ~0026686

I just compiled 7.0-104-g72846814ba and it's still there:

ardour-7.0.104: ../libs/ardour/plugin_insert.cc:1382: void ARDOUR::PluginInsert::automate_and_run(ARDOUR::BufferSet&, ARDOUR::samplepos_t, ARDOUR::samplepos_t, double, ARDOUR::pframes_t): Zusicherung »cnt > 0« nicht erfüllt.
Abgebrochen (Speicherabzug geschrieben)

gonsolo

2022-10-25 15:23

reporter   ~0026695

Printing cnt shows this at the end of the loop:
cnt: 822
cnt: -8469942

gonsolo

2022-10-25 15:40

reporter   ~0026696

This (preliminary) patch prevents the crash.
0001-Negative-cnt-crashes-ardour-at-the-end-of-a-loop.patch (878 bytes)   
From 0f20e8173fe1a9c636a7ca4d2014fdc0915a6c23 Mon Sep 17 00:00:00 2001
From: Gon Solo <gonsolo@gmail.com>
Date: Tue, 25 Oct 2022 17:37:24 +0200
Subject: [PATCH] Negative cnt crashes ardour at the end of a loop.

---
 libs/ardour/plugin_insert.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc
index 46795dc807..330eb6924b 100644
--- a/libs/ardour/plugin_insert.cc
+++ b/libs/ardour/plugin_insert.cc
@@ -1379,7 +1379,8 @@ PluginInsert::automate_and_run (BufferSet& bufs, samplepos_t start, samplepos_t
 	while (nframes) {
 
 		samplecnt_t cnt = min (timepos_t (start).distance (next_event.when).samples(), (samplecnt_t) nframes);
-		assert (cnt > 0);
+		//assert (cnt > 0);
+		if (cnt < 0) cnt = 0;
 
 		connect_and_run (bufs, start, start + cnt * speed, speed, cnt, offset, true);
 
-- 
2.37.2

gonsolo

2022-10-25 16:13

reporter   ~0026697

The next crash is here:

0000001 __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3 0x00007ffff343bc46 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
0000004 0x00007ffff34227fc in __GI_abort () at ./stdlib/abort.c:79
0000005 0x00007ffff58a2d0b in Temporal::TempoMap::get_grid(std::__cxx11::list<Temporal::TempoMapPoint, std::allocator<Temporal::TempoMapPoint> >&, long, long, unsigned int) const (this=0x555557b30000, ret=empty std::__cxx11::list, start=280890775200, end=280896796320, bar_mod=0)
    at ../libs/temporal/tempo.cc:1906
#6 0x00007ffff774b7d6 in ARDOUR::LV2Plugin::connect_and_run(ARDOUR::BufferSet&, long, long, double, ARDOUR::ChanMapping const&, ARDOUR::ChanMapping const&, unsigned int, long) (this=0x55556bb1b790, bufs=..., start=47770540, end=47771564, speed=1, in_map=..., out_map=..., nframes=1024, offset=0)
    at ../libs/ardour/lv2_plugin.cc:2668
#7 0x00007ffff73d12b9 in ARDOUR::PluginInsert::connect_and_run(ARDOUR::BufferSet&, long, long, double, unsigned int, long, bool)
     (this=0x55556bb16680, bufs=..., start=47770540, end=47771564, speed=1, nframes=1024, offset=0, with_auto=true) at ../libs/ardour/plugin_insert.cc:1107
0000008 0x00007ffff73d2f5b in ARDOUR::PluginInsert::automate_and_run(ARDOUR::BufferSet&, long, long, double, unsigned int)
    (this=0x55556bb16680, bufs=..., start=47770540, end=47771564, speed=1, nframes=1024) at ../libs/ardour/plugin_insert.cc:1375
0000009 0x00007ffff73d2b67 in ARDOUR::PluginInsert::run(ARDOUR::BufferSet&, long, long, double, unsigned int, bool)
    (this=0x55556bb16680, bufs=..., start_sample=47770540, end_sample=47771564, speed=1, nframes=1024) at ../libs/ardour/plugin_insert.cc:1326
0000010 0x00007ffff74c66c4 in ARDOUR::Route::process_output_buffers(ARDOUR::BufferSet&, long, long, unsigned int, bool, bool)
     (this=0x55556a3fa3b0, bufs=..., start_sample=47770540, end_sample=47771564, nframes=1024, gain_automation_ok=true, run_disk_reader=true)
    at ../libs/ardour/route.cc:543

paul

2022-10-25 16:21

administrator   ~0026698

That's the same crash as in one of your previous notes.

gonsolo

2022-10-25 16:29

reporter   ~0026699

Ahhh, yes. Sorry. I meant it's still there after the fix above.

x42

2022-10-26 23:14

administrator   ~0026707

Fixed in 7.0-116-g489c9ace9f

Issue History

Date Modified Username Field Change
2022-10-23 06:42 gonsolo New Issue
2022-10-23 07:15 gonsolo Note Added: 0026677
2022-10-24 03:13 paul Note Added: 0026683
2022-10-24 08:33 gonsolo Note Added: 0026686
2022-10-25 15:23 gonsolo Note Added: 0026695
2022-10-25 15:40 gonsolo Note Added: 0026696
2022-10-25 15:40 gonsolo File Added: 0001-Negative-cnt-crashes-ardour-at-the-end-of-a-loop.patch
2022-10-25 16:13 gonsolo Note Added: 0026697
2022-10-25 16:21 paul Note Added: 0026698
2022-10-25 16:29 gonsolo Note Added: 0026699
2022-10-26 23:14 x42 Assigned To => x42
2022-10-26 23:14 x42 Status new => resolved
2022-10-26 23:14 x42 Resolution open => fixed
2022-10-26 23:14 x42 Note Added: 0026707