patch for startup crash without a temporary directory

Building and customizing Audacity from the source code.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
felix
Posts: 2
Joined: Tue Jun 17, 2014 7:19 am
Operating System: Please select

patch for startup crash without a temporary directory

Post by felix » Tue Jun 17, 2014 7:33 am

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):

Code: Select all

--- 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 @@
    GStreamerStartup();
    #endif
 
-   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.

Gale Andrews
Quality Assurance
Posts: 26087
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10
Contact:

Re: patch for startup crash without a temporary directory

Post by Gale Andrews » Tue Jun 17, 2014 11:02 am

felix wrote:Would post on Bugzilla, but requesting an account there is too much of a hassle. I won't bother.
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 .
felix wrote:Here is a patch for 2.0.5 fixing a crash on startup when there is no temporary directory configured (LP #766918, RH #954818):
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.
felix wrote:I don't know if this is the prettiest way to fix it, but it has the advantage of working.
I'll test if your patch does anything for the Ubuntu problem mentioned above. Thanks.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

felix
Posts: 2
Joined: Tue Jun 17, 2014 7:19 am
Operating System: Please select

Re: patch for startup crash without a temporary directory

Post by felix » Tue Jun 17, 2014 1:24 pm

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.

Gale Andrews
Quality Assurance
Posts: 26087
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10
Contact:

Re: patch for startup crash without a temporary directory

Post by Gale Andrews » Tue Jun 17, 2014 3:02 pm

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).
felix wrote: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.
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?


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Post Reply