Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audacity crashes when the output directory for Macros is set to C:\ #1174

Closed
petersampsonaudacity opened this issue Jun 27, 2021 · 8 comments · Fixed by #1219
Closed

Audacity crashes when the output directory for Macros is set to C:\ #1174

petersampsonaudacity opened this issue Jun 27, 2021 · 8 comments · Fixed by #1219
Assignees
Labels
bug An error, undesired behaviour, or missed functionality P2 High priority bugs
Milestone

Comments

@petersampsonaudacity
Copy link

petersampsonaudacity commented Jun 27, 2021

Describe the bug
Audacity crashes when the output directory for Macros is set to C:\ (and I suspect any unwritable location)

To Reproduce

  1. Go to Directories preferences
  2. Set the default location for Macro output to be C:\
  3. Observe: Audacity does not stop you doing this (Bugzilla Bug Make amplify stateless #2740)
  4. Tools > Macros
  5. choose the shipped MP3 Conversion Macro
  6. Apply Macro to: Files
  7. choose any audio file for processing
  8. Observe: Audacity crashes when it reaches the Export step in the Macro

Expected behavior
a) at Step 2 Audacity should block the use of C:\ and other unwritable locations for ALL default directories
b) At step 8 a sensible and helpful error message should be shown to the user.

Step b) is required even if step a) i.e. Bug #2740 is fixed - a folder location that was writable at the time the user visited Directories preferences may later become unwritable.

Additional information (please complete the following information):
This crash happen with 3.0.2, 3.0.3 and 3.0.4 alpha - it does not occur on 3.0.0 as that does not have the prefs setting for Macro output. So technically this is a regression on 3.0.0

I discovered this issue when I was testing around on Bug #2740 as Paul has recently allowed the PR for a user fix for this issue
https://github.com/audacity/audacity/actions/druns/975549297

Sadly, in addition to this crash, that PR does not seem to fix the Bug 2740 issue when I test on 3.0.4 master build.

Additional context
OS: Windows 10 Home
Audacity versions: 3.0.2-3.0.4

I have flagged this bug as P2 - it is marginal P1, as that is what is used for most crashes, but only the very incautious and unwise user will set their default Macro output directory to be C:\ hence P2 and non-blocking, but still serious.

See: https://bugzilla.audacityteam.org/show_bug.cgi?id=2740
P2 Bug 2740 - Directories in Directories preferences can be set to unwritable locations

@petersampsonaudacity petersampsonaudacity added bug An error, undesired behaviour, or missed functionality P2 High priority bugs labels Jun 27, 2021
@petersampsonaudacity
Copy link
Author

petersampsonaudacity commented Jun 27, 2021

I just researched an realized that this was lready reported as Bug 2738
https://bugzilla.audacityteam.org/show_bug.cgi?id=2738
P2 Bug 2738 - Audacity crashes with Macros on files when the macro-output folder is in an unwriteable location

@petersampsonaudacity
Copy link
Author

petersampsonaudacity commented Jun 27, 2021

See also Bug 2739
https://bugzilla.audacityteam.org/show_bug.cgi?id=2739
P2 Bug 2739 - If Temporary files directory is set to be unwritable then Audacity has a catalog of cryptic unhelpful errors

And see also Bug 2740
https://bugzilla.audacityteam.org/show_bug.cgi?id=2740
P2 Bug 2740 - Directories in Directories preferences can be set to unwritable locations

@crsib crsib added this to To do (Dev) in Release 3.1 via automation Jun 30, 2021
@crsib crsib added this to To do in Sprint 1 - Release 3.1 via automation Jun 30, 2021
@crsib crsib added this to To Do (Dev) in Scripting and Macros via automation Jun 30, 2021
@crsib crsib added this to the Sprint 1 milestone Jun 30, 2021
@gera-gas gera-gas moved this from To do to In progress in Sprint 1 - Release 3.1 Jun 30, 2021
@gera-gas
Copy link
Contributor

gera-gas commented Jul 1, 2021

Reproduce

OS: Windows 10 Home
Audacity: master branch 4770b1f

Set the default location for Macro output to be C:\
At this step, Audacity blocked the use of C:\ and other unwritable locations with the following message:
0 - unable_set_unwritable_dir

Folder location that changing the status from writable to unwritable..
Set folder to macro output writable directory with name ttttttttt
1 - set_macro_directory

Then lock this directory for writing.
2 - lock_directory

Run MP3 Conversion Macro and apply to Files
3 - run_macro_tool

After that Audacity show message with a problem to the writing result and then successfully continue working.
4 - message_after_macro

@gera-gas
Copy link
Contributor

gera-gas commented Jul 2, 2021

@petersampsonaudacity, could you please provide me with a print screen with Audacity crash when used unwritable directory for macro output? Because I tried reproducing these steps and still can't get the same result (crash). I described my steps above. But in some cases I get exception from wxWidgets, may be it the same.

@petersampsonaudacity
Copy link
Author

petersampsonaudacity commented Jul 2, 2021

@gera-gas
image

@petersampsonaudacity
Copy link
Author

petersampsonaudacity commented Jul 2, 2021

When I set the Macros output folder to be a sub-folder of C: (I used C:\Program Files) - I get no crash, but I do get this error message:

image

@petersampsonaudacity
Copy link
Author

petersampsonaudacity commented Jul 4, 2021

Audacity 3.0.4 alpha now blocks the use of C:\ (and other unwritable system files) with the pulling in to audacity:master for 3.4.0
of this Pull Request:
#1185
Add Directory permission check for Open, Import, Macro Output, and Temporary directory in Directory Preference #1185

This enabled me to mark P2 Bug 2740 as RESOLVED FIXED
https://bugzilla.audacityteam.org/show_bug.cgi?id=2740

But also importantly it means that this issue can no longer occur - so I shall close this.

Please note that this is fixed for 3.0.4 - but NOT for 3.0.3 (which is still in RC stage right now).

Release 3.1 automation moved this from To do (Dev) to Done Jul 4, 2021
Scripting and Macros automation moved this from To Do (Dev) to Done Jul 4, 2021
Sprint 1 - Release 3.1 automation moved this from In progress to Done Jul 4, 2021
@gera-gas gera-gas moved this from Done to Review in progress in Sprint 1 - Release 3.1 Jul 4, 2021
@petersampsonaudacity
Copy link
Author

petersampsonaudacity commented Jul 5, 2021

I tested this on W10 with audacity-win-3.0.4-alpha-20210704+0cef813-64bit
this is a branch build: https://github.com/audacity/audacity/actions/runs/999270883
The directory setting has to be made with 3.0.2 as in latest 3.0.4 the use of C:\ is now blocked by Audacity.

  1. clear Audacity settings folder
  2. launch 3.0.2
  3. Directories preferences
  4. set the Macro output directory to be C:\
  5. Exit Audacity
  6. Launch 3.0.4 branch alpha with the fix
  7. Tools Macros
  8. choose the shipped MP3 Conversion Macro
  9. Apply Macro to: Files
  10. choose any audio file for processing
  11. Observe: Audacity does not crash but displays the following error message when it reaches the Export step in the Macro

image

@gera-gas gera-gas moved this from Review in progress to Done in Sprint 1 - Release 3.1 Jul 6, 2021
@AnitaBats AnitaBats modified the milestones: Sprint 1, Audacity 3.1 Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error, undesired behaviour, or missed functionality P2 High priority bugs
Projects
Development

Successfully merging a pull request may close this issue.

4 participants