running "firefox-bin -profile /tmp/newdir" no longer works

RESOLVED FIXED in mozilla2.0b7

Status

()

Core
XPCOM
RESOLVED FIXED
7 years ago
2 years ago

People

(Reporter: Dolske, Assigned: Dolske)

Tracking

({dogfood, regression})

Trunk
mozilla2.0b7
x86
Mac OS X
dogfood, regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
In the recent past this has been working fine, and was superhandy for creating a new testing profile on-the-fly.

Now this is failing on OS X, I get the "Firefox is already running, please close it" error. Probably because the profile dir is being created mode 0644, so it's unreadable.
(Assignee)

Comment 1

7 years ago
Ahh, this looks suspicious...

http://mxr.mozilla.org/mozilla-central/source/toolkit/xre/nsAppRunner.cpp#2122

2122     // Check if the profile path exists and it's a directory.
2123     PRBool exists;
2124     lf->Exists(&exists);
2125     if (!exists) {
2126         rv = lf->Create(nsIFile::DIRECTORY_TYPE, 0644);
2127         NS_ENSURE_SUCCESS(rv, rv);
2128     }
(Assignee)

Comment 2

7 years ago
Created attachment 459641 [details] [diff] [review]
Patch v.1

Trivial fix. My build works as expected with this.
Assignee: nobody → dolske
Attachment #459641 - Flags: review?(benjamin)
(Assignee)

Updated

7 years ago
blocking2.0: ? → ---
(Assignee)

Comment 3

7 years ago
dholbert mentioned that -profile with a new dir never worked right on Linux, this would explain why!
FWIW, this actually still doesn't work on linux, even with dolske's patch. :(

No folder gets generated at all (not even one with bad permissions), and the error dialog I get is
> Profile Missing
> Your Firefox profile cannot be loaded. It may be missing or inaccessible.

This probably deserves another bug, though. (maybe there's already one filed?)
(FWIW, in my case on Linux, it looks like I never hit dolske's quoted chunk in comment 1, because an "XRE_GetFileFromPath()" call a few lines up fails & triggers an early return via NS_ENSURE_SUCCESS.
It makes sense that this wouldn't be a problem on Mac, because XRE_GetFileFromPath is a big cascade of "#if PLATFORM; ...; #elif ...", with the Mac chunk having the most fallback code.)
Yeah, you might be hitting a problem with different versions of Linux: previously realpath() would work on non-existent paths, and at some point fairly recently it has stopped working in that case, and you have to do magic like walking back to the last path chunk which exists and realpath()ing that. Sucky.

Comment 7

7 years ago
(In reply to comment #6)
> Yeah, you might be hitting a problem with different versions of Linux:
> previously realpath() would work on non-existent paths, and at some point
> fairly recently it has stopped working in that case, and you have to do magic
> like walking back to the last path chunk which exists and realpath()ing that.
> Sucky.

Darwin made the same change in the last major release or two, fyi. As of Mac OS X 10.6 and possibly 10.5 realpath won't work on non-existent paths:

LEGACY DESCRIPTION
     In legacy mode, the last component of file_name does not need to exist when realpath() is called.
Status: NEW → ASSIGNED
Keywords: regression
(Assignee)

Comment 8

7 years ago
gentile poke?

I think the already-broken Linux case can be spun off to another bug (if not already filed). I don't think there's any impact on this patch wrt OS X?
Attachment #459641 - Flags: review?(benjamin) → review+
Attachment #459641 - Flags: approval2.0+
(Assignee)

Comment 9

7 years ago
Pushed http://hg.mozilla.org/mozilla-central/rev/790fa8dce21b
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b6

Comment 10

7 years ago
(In reply to comment #4)
> FWIW, this actually still doesn't work on linux, even with dolske's patch. :(
> 
> No folder gets generated at all (not even one with bad permissions), and the
> error dialog I get is
> > Profile Missing
> > Your Firefox profile cannot be loaded. It may be missing or inaccessible.

Bug 237128 created that message, also fixing bug 289631 so you at least get an error now. I can't find one on creating the profile when it doesn't exist.
See Also: → bug 1136620
You need to log in before you can comment on or make changes to this bug.