Issue with Audacity 3.7.1 on Ubuntu 24 - Macro paste error

Hello, my version of Audacity was recently upgraded and it broke a macro I have been running for some time. I have isolated it to this bit of code:

Select:End=“1800” Mode=“Set” Start=“0”
Cut:
NewStereoTrack:
Paste:

The error is:
“An internal error at libraries/lib-wave-track/WaveTrack.cpp line 1232”
The Paste operation is what generates the error.

OS:
cat /etc/os-release
PRETTY_NAME=“Ubuntu 24.04.2 LTS”
NAME=“Ubuntu”
VERSION_ID=“24.04”
VERSION=“24.04.2 LTS (Noble Numbat)”
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian

uname -a
Linux 6.11.0-26-generic #26~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 17 19:20:47 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Audacity:
Program build date: Jun 3 2025
Commit Id: 7051a7 of Wed Dec 11 22:25:12 2024 +0300
Build type: CMake Release build (debug level 1), 64 bits
Compiler: GCC 13.3.0
Installation Prefix: /usr

Core Libraries
wxWidgets (Cross-platform GUI library) 3.2.4
PortAudio (Audio playback and recording) v19
libsoxr (Sample rate conversion) Enabled
File Format Support
libmpg123 (MP3 Import) Enabled
libmp3lame (MP3 Export) Enabled
libvorbis (Ogg Vorbis Import and Export) Enabled
libopus (Opus Import and Export) Enabled
libid3tag (ID3 tag support) Enabled
libflac (FLAC import and export) Enabled
libtwolame (MP2 export) Enabled
ffmpeg (FFmpeg Import/Export) Enabled
Features
Nyquist (Plug-in support) Enabled
LADSPA (Plug-in support) Enabled
Vamp (Plug-in support) Enabled
Audio Units (Plug-in support) Disabled
VST (Plug-in support) Enabled
LV2 (Plug-in support) Enabled
PortMixer (Sound card mixer support) Enabled
SoundTouch (Pitch and Tempo Change support) Enabled
SBSMS (Extreme Pitch and Tempo Change support) Enabled

I can confirm this bug. It is 100% repeatable for me with Audacity 3.7.3 on Linux.

The crash occurs when THROW_INCONSISTENCY_EXCEPTION is reached in this block of code:

void WaveTrack::ClearAndPaste(
   double t0,                      // Start of time to clear
   double t1,                      // End of time to clear
   const WaveTrack& src,           // What to paste
   bool preserve,                  // Whether to reinsert splits/cuts
   bool merge,                     // Whether to remove 'extra' splits
   const TimeWarper* effectWarper, // How does time change
   bool clearByTrimming)
{
   // Get a modifiable copy of `src` because it may come from another project
   // with different tempo, making boundary queries incorrect.
   const auto& tempo = GetProjectTempo(*this);
   if (!tempo.has_value())
      THROW_INCONSISTENCY_EXCEPTION;
   const auto copyHolder = src.DuplicateWithOtherTempo(*tempo);
   ClearAndPasteAtSameTempo(
      t0, t1, *copyHolder, preserve, merge, effectWarper, clearByTrimming);
}

I’d suggest that you log it as a new issue on Audacity’s GitHub (requires a free GitHub account) as the developers rarely visit this forum.

Thanks for the confirmation and deeper insight.