Project corrupted when pressing cancel during compacting project
- Dominant language
- C++
- Stars
- 18.4k
- Forks
- 2.7k
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 87
Description
### Bug description
When closing a project i chose not to save (to revert changes made), i also clicked cancel on the compacting project dialog out of impatience. Rather than safely close the project while aborting/reversing the compaction step, it instead corrupted the project.
I have not attempted to cause this problem to occur again, but using audacity-project-tools and dropping the autosave thankfully worked to repair it. The detailed steps are below, and i have put the generic steps (untested) in the steps to produce section.
The steps i recall taking were as follows :
1. Opened project with three tracks
2. Used normalize on the third track with default setting.
3. Undid this normalize step.
4. Tried to normalize that same track again with a different db value (as the waveform was not as large as I had hoped it would be).
5. I repeated step 2 to step 4 with values 0.0 and -2.0 to no effect (normalized waveform was identical regardless of supplied value)
6. Struggling to get audacity to recognize the ffmpeg libraries (another bug i have discovered) i decided to restart audacity.
7. I pressed close, told it not to save, then hit cancel on the compaction step.
### Steps to reproduce
1. Open project of sufficient size / undo history to cause compaction on closing.
2. Close the project without saving.
3. Click cancel when the project is being compacted.
### Expected behavior
The project should be left uncompressed/uncompacted and ardour should close. The project should not become unreadable/corrupted.
### Actual behavior
The project is left uncompacted (perhaps partially compacted?) but corrupted and unreadable.
### Audacity Version
Audacity 3.7.7
### Operating system
macOS
### Additional context
The Build
Program build date:
Dec 11 2025
Commit Id:
5ef610 of Thu Dec 11 17:30:51 2025 +0300
Build type:
CMake Release build (debug level 1), 64 bits
Compiler:
GCC 4.2.1 (Audacity)
Compiler:
clang 15.0.0 (clang-1500.3.9.4)
Cache folder:
/Users/soulshine/Library/Application Support/audacity
Settings folder:
/Users/soulshine/Library/Application Support/audacity
Data folder:
/Users/soulshine/Library/Application Support/audacity
State folder:
/Users/soulshine/Library/Application Support/audacity
Core Libraries
wxWidgets
(Cross-platform GUI library)
3.1.3 (Audacity)
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)
Enabled
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
Contributor guide
Research direction
No source files or tests are named. Start by reproducing the reported sequence on macOS: close a sufficiently large project without saving, then cancel the compaction dialog, and inspect the project’s closing and compaction flow. Done means cancellation safely leaves the project readable and Audacity closes without corruption.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100