Closed
Bug 89436
Opened 24 years ago
Closed 23 years ago
Seg fault on install; cannot install
Categories
(SeaMonkey :: Installer, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.9.8
People
(Reporter: throop, Assigned: slogan)
Details
(Keywords: crash)
Attachments
(2 files, 2 obsolete files)
6.91 KB,
patch
|
Details | Diff | Splinter Review | |
5.13 KB,
patch
|
Details | Diff | Splinter Review |
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-22 i686; en-US; rv:0.9) Gecko/20010505
BuildID: 20010628
After running the talkback-enabled mozilla-installer, I get hundreds of messages
of the form
> Gtk-CRITICAL **: file gtkprogress.c: line 518 (gtk_progress_set_percentage):
assertion `percentage >= 0 && percentage <= 1.0' failed.
Followed by
> mozilla-installer: line 55: 6661 Segmentation fault
./mozilla-installer-bin --sync $
Running mozilla-installer again, I get
> Gtk-CRITICAL **: file gtkwidget.c: line 1507 (gtk_widget_hide): assertion
`widget != NULL' failed.
> mozilla-installer: line 55: 6667 Segmentation fault
./mozilla-installer-bin --sync $@
Install is straightforward: no proxies, and the files seem to download OK.
Nothing ever gets copied into my destination distall directory, however.
Reproducible: Always
Steps to Reproduce:
1. Download & unpack 0.9.2
2. Click Next, Accept, Change, OK, Next, Install
3. Download begins
Actual Results: > Gtk-CRITICAL **: file gtkprogress.c: line 518
(gtk_progress_set_percentage): assertion `percentage >= 0 && percentage <= 1.0'
failed.
> mozilla-installer: line 55: 6661 Segmentation fault ./mozilla-installer-bin
--sync $
> Gtk-CRITICAL **: file gtkwidget.c: line 1507 (gtk_widget_hide): assertion
`widget != NULL' failed.
> mozilla-installer: line 55: 6667 Segmentation fault ./mozilla-installer-bin
--sync $@
Expected Results: Installed properly! All previous versions (0.8, 0.8.1, 0.9,
0.9.1) installed fine. This is the first one to break.
Updated•24 years ago
|
QA Contact: gemal → gbush
Comment 1•24 years ago
|
||
Marking NEW.
Comment 2•24 years ago
|
||
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Comment 3•24 years ago
|
||
This is not a duplicate of 83478, that one's a benign assertion, this one is a
segfault. (He gets the same assertion first, but that's just noise -- look at
what happens next.)
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Reporter | ||
Comment 4•24 years ago
|
||
This bug still exists. Although I installed the 2001091311 0.9.4 distribution
successfully, as of today I can't install the most recent Linux nightly build.
The message is:
mozilla-installer: line 55: 29035 Segmentation fault
./mozilla-installer-bin --sync
Ensure that the user only installs where permissions are appropriate. And
handle the error in the file picker where we should.
Simple steps to reproduce:
su
mkdir /moztest
(ensure that only root and root's group have rw perms on /moztest, it should be
that way by default)
exit (log off as root)
run the stub or blob installer
select /moztest as the install location
continue on with the install, you should download all the files if using the
stub, but crash trying to process these files.
Comment 9•23 years ago
|
||
Comment on attachment 63472 [details] [diff] [review]
patch to fix this
>+ if (0 == stat(selDir, &destStat))
>+ if (!S_ISDIR(destStat.st_mode) || VerifyDestination() != OK ) /* not a directory so don't tear down */
>+ return;
Please update this comment to indicate what the added VerifyDestination() check
is doing. Also the line's getting pretty long now, maybe move the comment
to its own line above or below the if (re-wording as necessary)
>+ if ( !(isRead && isWrite && isExecute) )
On IM you mentioned it'd have been better to use access(path, W_OK|R_OK|X_OK)
instead
Assignee | ||
Comment 10•23 years ago
|
||
Comment on attachment 63472 [details] [diff] [review]
patch to fix this
I'm going to rewrite to use access(), which is simpler.
Attachment #63472 -
Attachment is obsolete: true
Assignee | ||
Comment 11•23 years ago
|
||
Assignee | ||
Comment 12•23 years ago
|
||
Comment on attachment 63563 [details] [diff] [review]
why implement access() when I can just call it?
ack, bug in this patch, one more try...
Attachment #63563 -
Attachment is obsolete: true
Assignee | ||
Comment 13•23 years ago
|
||
Needed the stat() call, that was what was checking for file existence. I took
it out in the previous patch assuming stat() was only being used to get the
permissions values, but on inspection, that was not the case.
Assignee | ||
Comment 14•23 years ago
|
||
Comment 15•23 years ago
|
||
Comment on attachment 63576 [details] [diff] [review]
added -w flag to get rid of whitespace changes
>Index: nsSetupTypeDlg.cpp
>===================================================================
>RCS file: /cvsroot/mozilla/xpinstall/wizard/unix/src2/nsSetupTypeDlg.cpp,v
>retrieving revision 1.18
>diff -w -u -2 -0 -r1.18 nsSetupTypeDlg.cpp
>--- nsSetupTypeDlg.cpp 14 Aug 2001 07:59:58 -0000 1.18
>+++ nsSetupTypeDlg.cpp 4 Jan 2002 22:11:17 -0000
>@@ -1,21 +1,21 @@
>-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
>+
Looks like we are eliminating the mode line. Let's restore it. (Or remove it
from all the files under src2.)
>- if (0 == stat(selDir, &destStat))
>- if (!S_ISDIR(destStat.st_mode)) /* not a directory so don't tear down */
>- return;
>
> strcpy(gCtx->opt->mDestination, selDir);
>
>+ if (0 == stat(selDir, &destStat))
>+ if (!S_ISDIR(destStat.st_mode) || VerifyDestination() != OK ) /* not a directory so don't tear down */
>+ return;
Please comment about where VerifyDestination() is getting the destination to
verify would help code readability (or change VerifyDestination to take a path
and set mDestination only if it verifies correctly).
r=sgehani contingent upon above nits being addressed.
Attachment #63576 -
Flags: review+
Assignee | ||
Comment 16•23 years ago
|
||
I'll also add back in the mode line I removed by accident. I thought samir was
talking about the line that contained the stat() st_mode field, which was not
removed.Doh, sorry samir :-)
Comment 17•23 years ago
|
||
Comment on attachment 63576 [details] [diff] [review]
added -w flag to get rid of whitespace changes
I talked to syd. There are things that could be done to make the code slightly
simpler, but for sake of not wanting to break anything else, r=ssu.
Attachment #63576 -
Flags: review+
Comment 18•23 years ago
|
||
Comment on attachment 63570 [details] [diff] [review]
restored the stat() call, final patch
>+ if (0 == stat(selDir, &destStat))
>+ if (!S_ISDIR(destStat.st_mode) || VerifyDestination() != OK ) /* not a directory so don't tear down */
>+ return;
>+
VerifyDestination() does the same stat(), so why not move the S_ISDIR
test inside VerifyDestination() and remove one of the stat() calls?
In addition, whatever it is that nsSetupTypeDlg::Next() is doing will
now also be doing the full correct check when it calls VerifyDestination
rather than lucking out because some other part of the code has checked
it's a directory.
And fix the long comment :-) (What does it mean by "tear down" anyway?)
if (VerifyDestination() != OK)
return;
Assignee | ||
Comment 19•23 years ago
|
||
I'd like to go for low risk. verify destination is called in one other place,
and not checking that S_ISDIR, so in the interest of minimizing risk, I'd rather
just fix the check inside the function to be correct, and add that extra call to
make sure we have permissions, and leave it at that.
Comment 20•23 years ago
|
||
My point was that the "one other place" (nsSetupTypeDlg::Next) is probably a bug
waiting to happen. Why *isn't* it checking S_ISDIR? Simplifying the code would
meet my definition of "low risk" for future problems.
But I could be argues your way, especially if this is a patch you'd like to
retrofit into a 6.2.1 installer re-spin.
sr=dveditz
Assignee | ||
Comment 21•23 years ago
|
||
Fix checked in
Status: NEW → RESOLVED
Closed: 24 years ago → 23 years ago
Resolution: --- → FIXED
Comment 22•23 years ago
|
||
Comment on attachment 63576 [details] [diff] [review]
added -w flag to get rid of whitespace changes
why are you getting rid of the mode line.
stat_err = stat(gCtx->opt->mDestination, &stbuf);
if (stat_err == 0)
{
- // check perms on dir: we need rwx for user
- if ( !(stbuf.st_mode & S_IREAD) ||
- !(stbuf.st_mode & S_IWRITE) ||
- !(stbuf.st_mode & S_IEXEC) )
+ if (access(gCtx->opt->mDestination, R_OK | W_OK | X_OK ) != 0)
{
Do you still need to do the stat?
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•