audacity / audacity

Audio Editor
https://wiki.audacityteam.org/wiki/For_Developers
Other
12.21k stars 2.25k forks source link

3.6.2 crash on exit #7131

Closed petersampsonaudacity closed 4 days ago

petersampsonaudacity commented 3 weeks ago

Bug description

I get a crash when I exit without saving when I have three or more tracks imported.

Testing shows that this is a regression on 3.6.1

Steps to reproduce (Updated with the steps by @DavidBailes)

  1. Add a new stereo track
  2. Generate 30s of silence (duration doesn't seem to matter)
  3. Quit Audacity

Expected behavior

No crash

Actual behavior

image

Audacity Version

3.6.2

Operating system

Windows 10, 11

petersampsonaudacity commented 3 weeks ago

Further testing shows that this bug was present in the 3.6.2 Beta build immediately before the build with the fix for #6929 (the build for the update to the Russian translations) so is not caused by the fix for that bug,

dozzzzer commented 3 weeks ago

I couldn't reproduce this on my Win10 machine using the latest 3.6.2 build.

https://github.com/user-attachments/assets/f7beec5f-da24-4f76-86cd-eecbab14313b

LWinterberg commented 2 weeks ago

I could also not repro this

petersampsonaudacity commented 2 weeks ago

I can still reproduce this on my w10 machine with the very latest 3.6.2 Beta

image

kryksyh commented 2 weeks ago

@petersampsonaudacity could you attach crashdump file for this crash? It should be in C:\Users\%USERNAME%\AppData\Local\audacity\crashreports\reports .

petersampsonaudacity commented 2 weeks ago

@kryksyh

480eb002-74c6-482e-919c-496945ad821f.dmp

kryksyh commented 2 weeks ago

@petersampsonaudacity unfortunately it doesn't make it clear what's happening. Does it happen for you all the time you repeat the steps? Is it possible for you to record your desktop?

petersampsonaudacity commented 2 weeks ago

@kryksyh

Yes seems to happen every time

Is it possible for you to record your desktop?

How do I do that?

Update

I'm out for most of today, I may get some time late this afternoon

petersampsonaudacity commented 2 weeks ago

Is it possible for you to record your desktop?

@kryksyh

I can record the app but not the desktop - and only the primary window of the app gets recorded so I don;t even see the File>Exit dialog recorded, nor the crash report.

kryksyh commented 2 weeks ago

@petersampsonaudacity Well even recording using smartphone would do. As for the software I'm using OBS Studio, but it may be tricky to setup.

This one is free and easy to use: https://www.microsoft.com/store/productId/9N9CCD41TFT3?ocid=pdpshare . It works on w10 despite its name.

The reason I'm asking for the recording is that no one else could reproduce, so it probably something special in your setup or your actions, and the recording is the easiest way to find out what is it.

petersampsonaudacity commented 2 weeks ago

@kryksyh

OK so here is a desktop recording taken with my camera (hand-held, so a bit wobbly)

Actually it's too big to post here, so I put it in my Dropbox - here is a link to the file: https://www.dropbox.com/s/vwm9exfr8etb9q9/MVI_7817.MP4?dl=0

kryksyh commented 2 weeks ago

@petersampsonaudacity thank you! Out of curiosity, does it happen with a different file format or only with m4a?

petersampsonaudacity commented 2 weeks ago

Out of curiosity, does it happen with a different file format or only with m4a?

@kryksyh

I just imported an Opus, a flac and a wav - and I still get the crash on exit.

I will try to find some time tomorrow to test on my wife's 2 laptops (both W10)

petersampsonaudacity commented 2 weeks ago

@kryksyh @dozzzzer

I tried this on my wife's 2 PCs

1) Big HP Envy, same as mane 256 SSD and 1TB HD W10 With this I could not get it to fail with a crash report on exit I have no idea what is different between hers and mine as they are both the same spec.

2) Small HP Envy 128 HD only W10 (this is a tiny one that we use for photos on diving trips) a) with three smallish files I could not get this to crash report on exit b) IF one of the 3 files was a 2-hour stereo wav THEN it did crash report on exit

petersampsonaudacity commented 2 weeks ago

@kryksyh @dozzzzer

Curiously I do NOT get the crash report on exit when using the latest 3.7.0 alpha

dozzzzer commented 2 weeks ago

@petersampsonaudacity probably https://github.com/audacity/audacity/pull/7205 has fixed it...

petersampsonaudacity commented 2 weeks ago

@dozzzzer

I don't think the latest 3.7.0 alpha has that fix already - or am I wrong?

dozzzzer commented 2 weeks ago

Yeah, you're right

petersampsonaudacity commented 1 week ago

Still seeing this on the newly-released 3.6.2

petersampsonaudacity commented 1 week ago

@dozzer @LWinterberg

See this recent Forum thread: https://forum.audacityteam.org/t/audacity-crashes-on-exit/116803

DavidBailes commented 1 week ago

On my computer I can get the crash repeatably with the following steps to reproduce.

  1. Add a new stereo track.
  2. Generate 30s of silence (duration doesn't seem to matter).
  3. Close Audacity. Crash.

Call stack:

lib-project-file-io.dll!std::_Func_class::_Getimpl() Line 1040 C++ lib-project-file-io.dll!std::_Func_class::_Empty() Line 934 C++ lib-project-file-io.dll!std::function<void cdecl(void)>::operator bool() Line 1164 C++ lib-project-file-io.dll!SqliteSampleBlockFactory::OnSampleBlockDtor(const SampleBlock & formal) Line 174 C++ lib-project-file-io.dll!SqliteSampleBlock::~SqliteSampleBlock() Line 349 C++ [External Code]

dozzzzer commented 1 week ago

Thanks @DavidBailes , I managed to reproduce this on Windows following your STR

DavidBailes commented 1 week ago

@dozzzzer . Doesn't this need to be added to 3.6.3 rather than 3.7? Surely it needs to be fixed asap?

petersampsonaudacity commented 1 week ago

Doesn't this need to be added to 3.6.3 rather than 3.7? Surely it needs to be fixed asap?

I totally agree with @DavidBailes - this reflects badly on Audacity (we do have several Forum reports of this happening).

Using David's STRs I get the crash report on exit in both 3.6.2 and the latest 3.7.0 alpha test build.

DavidBailes commented 1 week ago

On my computer I can get the crash repeatably with the following steps to reproduce.

  1. Add a new stereo track.
  2. Generate 30s of silence (duration doesn't seem to matter).
  3. Close Audacity. Crash.

Looks like step 1 can be omitted. Just generate 30s of silence and close produces a crash.

billw58 commented 1 week ago

FWIW I can make this happen on Mac. macOS 14.6.1, Macbook Air 2020, M1 Steps: 1) Start Audacity 3.6.2 2) Generate Silence, 30 sec. 2a) Optionally, Save the project 3) Quit Audacity Audacity appears to quit normally and return to the Finder, but the Audacity icon remains in the dock and bounces. Clicking on the Audacity icon in the dock reveals a Problem Report dialog. Closing the dialog or clicking Don't Send finally lets Audacity quit. If at step 2 I import a file (any type, any size), then quit, there is no crash.

JoeS209 commented 1 week ago

Looks like mpFactory is NULL in SqliteSampleBlock::~SqliteSampleBlock().

dozzzzer commented 1 week ago

Tested

petersampsonaudacity commented 5 days ago

@dozzzzer @kryksyh @LWinterberg

Forum report today with 3.6.3 was still getting the crash report on exit: https://forum.audacityteam.org/t/audacity-crashes-on-exit/116803/22

I was able to reproduce this with simple steps on W10 with 3.6.3

  1. set the temp files to be on my onboard 1TD HD D: drive (default is SSD C: drive)
  2. relaunch 3.6.3
  3. import a 3 minute WAV file
  4. Amplify it
  5. Quit Audacity without saving
  6. Observe crash report.

The Forum reporter (kaji) Exported an MP3 between steps 4 and 6 (a more realistic use-case for exiting without saving a project) - but I did not need that step

Note that the crash does NOT occur if you omit step 4 (the editing step)

Nor does it occur if I omit step 1 and leave the temp files on my SSD C: default drive.

I will re-open the issue

UPDATE

Further testing shows that these STRs are a regression on 3.5.1 (with the bug introduced in 3.6.0)

=========================================================

Note that my use case is a perfectly reasonable one - and definitely not an edge-case.

My PC has a smallish 256GG SSD (nearly full) C: drive and an onboard 1TB onboard HD D: drive with plenty of free space - so it's quite reasonable and indeed sensible to set the temp files (and project files) to be on the D: drive.

JoeS209 commented 5 days ago

Probably a different bug. I definitely fixed the issue with the prior repro steps. These are new repro steps, hence likely different bug. Today is busy for me but I will try to take a look soon.

petersampsonaudacity commented 5 days ago

I definitely fixed the issue with the prior repro steps.

@JoeS209 - yes, I tested those steps quite thoroughly and repeatedly on my W10 Machine - thanks for that.

Probably a different bug. ... These are new repro steps, hence likely different bug. Today is busy for me but I will try to take a look soon.

Would you prefer me to log this as a new issue?

JoeS209 commented 5 days ago

Would you prefer me to log this as a new issue?

No, it's OK. Just wanted to make the clarification.

JoeS209 commented 5 days ago

OK, I was able to repro a crash with similar but not exact repro steps as the latest above. In my case, mVsbar is non-NULL but points to garbage in ProjectWindow::GetVerticalThumbPosition(), ProjectWindow.cpp, line 770. I don't yet know why and I may not be able to spend any more time on this today.

JoeS209 commented 5 days ago

Unfortunately this new repro occurred for me only once, so likely timing related. Possible fix for the repro I saw might be to check mwWindow->mIsDeleting in GetVerticalWindowPosition() (ProjectWindow.cpp, line 493) before calling mwWindow->GetVerticalThumbPosition().

That's all the time I can spend on this today.

JoeS209 commented 5 days ago

OK, found some spare time. I've coded up a change that I believe should fix the one repro case that I hit. I will post a pull request and someone can test this to see if it fixes the other cases.

petersampsonaudacity commented 5 days ago

Testing on W10 with @JoeS209 's latest branch build for this: audacity-win-3.7.0-alpha-20240910+9ae3cfd-x64

I now get NO crash reports on editing without saving in any of the three STR use cases in #7131

  1. I tested the latest use case I reported yesterday following a Forum report. Change the temp directory to my large onboard HD D: drive, import a WAV file, Amplify it and then Exit without saving.

  2. Bill's simple use case: generate silence and then exit without saving. Tested both with temp files on the default C: drive and then switched to the HD D: drive.

  3. My original use case: import 3 audio files and exit without saving. Tested both with temp files on the default C: drive and then switched to the HD D: drive.

  4. I repeated test 1. but without switching the temp files to D:, leaving them on the C: default drive.

All worked fine with no crash dialogs on exit - and no recovery offered on restart and no crash reports in the appdata folder.

Looks to be fixed to me.

Thanks Joe for finding the time to work on this so quickly.

======================================================================

The acid-test will come when this latest bug-fix gets released into the wild and the users effectively become the real-life "testers".

As anyone who monitors the Forum regularly will note, with each of the 3.6 releases we have had many complaints of crashes, including with the latest 3.6.3 current release - sadly most of them fail to provide any STRs or background so cannot be useful for analysis. We were lucky that yesterday user Kaji provided some nice simple STRs that I was able to work with.

It worries me that we have been getting so many crashes recently as that has the potential to cause reputational damage to Audacity.

This morning I tested the two simple use cases (tests 2 and 3 above in this post) on all major releases of Audacity from 1.2.6 through to 3.5 and none of them produced the crash report on exiting without saving.

This does beg the question: what was it exactly that changed in 3.6 to cause this recent crash behavior that was never present in Audacity?

petersampsonaudacity commented 5 days ago

@LWinterberg

Leo, I note that @kryksyh already approved @JoeS209 's changes in PR #7310 to fix this latest use case a few hours ago.

So might we expect to see a quick 3.6.4 release to hopefully clear up all the 3.6 crashes?