Closed Bug 107803 Opened 23 years ago Closed 23 years ago

Not enough disk space in for /tmp

Categories

(SeaMonkey :: Installer, defect)

x86
Linux
defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.0

People

(Reporter: bugzilla, Assigned: slogan)

References

Details

Attachments

(1 file, 2 obsolete files)

using the stubs installer for the 2001.10.31.08 build [commercial, on linux
rh6.2], the xpi's are downloaded, but the installation fails.

i get the following error while extracting libmozjs.so: "Fatal error [-616]:
Extraction of XPCOM failed."
eek, i tried using the non-installer blob, but when i issue 'tar zxvf
[blobname]' i'm unable to completely decompress it:

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Child returned status 1
tar: Error exit delayed from previous errors
fwiw, it fails after decompressing package/chrome/comm.jar...

grace and curt will prolly come over to see if there's something fishy with my
machine. it might be a bug, but then again it might be something odd that has a
workaround...
Severity: critical → blocker
hrm, wonder if my dir permissions have changed...
QA Contact: bugzilla → ktrina
this might be due to lack of disk space, d'oh!

testing now...
hrm...actually, the /export partition on which i usually install is only 68%
full. the / partition is at 100%, but i guess i don't understand how that might
be causing this... other suggestions? i'll try removing some stuff off of / ...
okay, i removed a few things from / , although that still reports 100% used...
then i also removed the install directory, recreated it...then was successful at
installing using the stubs.

closing out as wfm.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
The installer unpacks things into /tmp. I thought the installer accounted for
that required space when /tmp is on a different volume than the install
directory, but maybe it's only windows that does that.
Reopening based on Dan's comments and changing the summary to reflect the
problem that we really care about.  Seems that we should spot this problem and
give the user some clue about what it going on.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Summary: unable to use the linux installer: error -616, xpcom install failed → Not enough disk space in for /tmp
I'll take this bug
Assignee: syd → curt
Status: REOPENED → NEW
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.8
bumping down sev, since i was able to find a workaround [threw out some big
items from /tmp, even tho' / remained at 100%, and removing the previous install
dir].
Severity: blocker → major
curt, i wonder if this might be dependent on bug 55690?
Keywords: nsbeta1
Target Milestone: mozilla0.9.8 → mozilla0.9.9
Target Milestone: mozilla0.9.9 → mozilla1.0
a comment
Assignee: curt → syd
Status: ASSIGNED → NEW
Keywords: nsbeta1nsbeta1+
*** Bug 55085 has been marked as a duplicate of this bug. ***
A couple of problems:

We should let the system give us a temporary name, this is preferred in unix.
For one, /tmp might not exist. Or, the user may prefer a different temp
directory. tempnam() is designed to give an appropriate unique name, and take
into account the TMP and TMPDIR env variables (which we ignored). In many cases
when the user fails because of minimal space in /tmp, he or she will have set
TMPDIR in their sh init file to specify a place that has more space. Also, if
the user fails, we can suggest they change TMPDIR to some other location and
rerun the installer. By hardcoding /tmp, they have to clear up /tmp or we will
fail, there is no other workaround.

Another problem I fixed is we never remove the temporary directory in the
engine destructor (we do free the memory allocated to the member variable that
holds the path, for what that is worth). So, added that code in as well.
Regarding the above patch, someone will point out potential security
implications using tempnam() (race conditions). These issues should only apply
to file creation, here we are creating a directory, not a file. I scanned the
appropriate bulletins and this is usage of tempnam() is not a problem.
Keywords: patch
Comment on attachment 67237 [details] [diff] [review]
Improve how we do temp directory creation and removal

r=sgehani
Attachment #67237 - Flags: review+
Comment on attachment 67237 [details] [diff] [review]
Improve how we do temp directory creation and removal

>+    if ( mTmp != (char *) NULL ) {

That's pretty ugly, especially the cast. Couldn't you "if ( mTmp )"?
If you absolutely must "if ( mTmp != 0 )", but the NULL #define is
discouraged in C++

ditto with if (buf)

>+    buf = tempnam( (const char *) NULL, "xpi" );
> 
>-    mTmp = (char *) malloc( (strlen(buf) * sizeof(char)) + 1 );
>+    if ( buf != (char *) NULL ) 
>+      mTmp = (char *) malloc( strlen(buf) + 1 );
>     if (!mTmp) return E_MEM;
>-
>     sprintf(mTmp, "%s", buf);
>-    mkdir(mTmp, 0755);
>-
>+    err = mkdir(mTmp, 0755);
>+    if ( err == -1 )
>+      err = E_DIR_CREATE;
>     return err;
> }

This routine leaks buf.
Attachment #67237 - Flags: needs-work+
Casting to (char *) NULL is very standard C. While NULL is almost always == 0,
it is not guaranteed. Man page for malloc() states NULL is returned on failure
(and makes no guarantee it is 0). 

Thanks for catching the leak, I'll put up a new patch.
Attachment #67237 - Attachment is obsolete: true
Comment on attachment 68031 [details] [diff] [review]
New patch, fix leak in first patch

> nsXIEngine::MakeUniqueTmpDir()
> {
>     int err = OK;
>     int i;
>-    char buf[MAXPATHLEN];
>-    struct stat dummy;
>+    char *buf; 
>     mTmp = NULL;
> 
>-    for (i = 0; i < MAX_TMP_DIRS; i++)
>-    {
>-        sprintf(buf, TMP_DIR_TEMPLATE, i);
>-        if (-1 == stat(buf, &dummy))
>-            break; 
>-    }
>+    buf = tempnam( (const char *) NULL, "xpi" );
> 
>-    mTmp = (char *) malloc( (strlen(buf) * sizeof(char)) + 1 );
>+    if ( buf != (char *) NULL ) 
>+      mTmp = (char *) malloc( strlen(buf) + 1 );
>     if (!mTmp) return E_MEM;

You still potentially leak buf if you return early here.

>-
>     sprintf(mTmp, "%s", buf);

Didn't notice this bit of ugliness before. Why not strcpy()?

>-    mkdir(mTmp, 0755);
>-
>+    err = mkdir(mTmp, 0755);
>+    if ( err == -1 )
>+      err = E_DIR_CREATE;
>+    free( buf );
>     return err;
> }

Looking at this again I'm not sure you even need buf anymore.
Couldn't you just mTmp = tempnam() now and be done with it?
Attachment #68031 - Attachment is obsolete: true
Attached patch better patchSplinter Review
Comment on attachment 68037 [details] [diff] [review]
better patch

sr=dveditz
Attachment #68037 - Flags: superreview+
Attachment #68037 - Flags: review+
fixed
Status: NEW → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
Verified code fix
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: