patch for startup crash without a temporary directory

Would post on Bugzilla, but requesting an account there is too much of a hassle. I won’t bother.

Here is a patch for 2.0.5 fixing a crash on startup when there is no temporary directory configured (LP #766918, RH #954818):

--- src/AudacityApp.cpp	2013-10-19 09:31:48.000000000 +0200
+++ src/AudacityApp.cpp	2014-06-16 21:12:37.408119425 +0200
@@ -1208,6 +1208,8 @@
    mLocale = NULL;
    InitLang( lang );
+   mImporter = new Importer;
    // Init DirManager, which initializes the temp directory
    // If this fails, we must exit the program.
@@ -1292,8 +1294,6 @@
-   mImporter = new Importer;
    // Auto-recovery

I don’t know if this is the prettiest way to fix it, but it has the advantage of working.

Sorry but we get far too many false bug reports and requests for “help” (even sometimes from Linux users) to open Audacity Bugzilla to the public.

The best place to post a patch is normally to write to our feedback address .

Is your specific issue if you try to use a non-native file system?

There is a known issue (on Ubuntu) that executing Audacity as root produces “could not find a place to store temporary files”.

On some distributions if /var/tmp/ only has 0755 permission the use “may” receive the same error when first using Audacity.

I’ll test if your patch does anything for the Ubuntu problem mentioned above. Thanks.


I use Arch. My specific issue is that I get a segmentation fault. The patch fixes only that.

Turns out I had no free space available for non-root users on / (which contains /var/tmp on my system). Still, the error message could be more informative.

I tested your patch for the issue launching Audacity as root on Ubuntu. The patch does allow Audacity to launch, to offer the Directories Preferences to change the temp directory, then close with a message telling the user to launch Audacity again. So it is an advance for sure.

On Ubuntu, once I have run Audacity as root and changed the temp dir, I can’t run Audacity as my own user without changing the temp dir. Then having changed the temp dir as my own user, I can’t run Audacity as root, even though root clearly has permission to modify my own user’s temp dir. So the problem seems specifically about ownership and not permissions in that case. I am a Windows user mainly, but do I assume this is normal behaviour on Linux, or could Audacity be more user-friendly here?

Anyhow, I will mention your patch to the powers that be - I would like to see this fixed. Please note that if you submit more patches they should be against HEAD (there is no GStreamerStartup(); in src/AudacityApp.cpp).

Audacity does have a warning if the space available to the temp dir is 100 MB or less. Presumably Audacity never gets far enough to run the check if it forces the Preferences dialogue as a result of having nowhere to store temp files?

Arguably there are enough message boxes already when Audacity can’t store temp files, without adding a message about shortage of space. Also with your patch, wouldn’t the Preferences show that there was no space in the directory Audacity was trying to write its temp dir to?