Firefox fails to start when the current working directory has been deleted
Categories
(Toolkit :: Startup and Profile System, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox84 | --- | fixed |
People
(Reporter: robwu, Assigned: Gijs)
References
Details
Attachments
(1 file)
When the current working directory (cwd) has been deleted, Firefox refuses to start due to an early exit. This is unexpected, as the successful startup of Firefox should be independent of the cwd. E.g. Chrome starts just fine.
This is not a recent regression, the logic was introduced 15 years ago in bug 276588.
There is similarly error-prone logic in the updater: https://searchfox.org/mozilla-central/rev/b58ca45005fe02077c92779483d1b60e9a49687c/toolkit/xre/nsUpdateDriver.cpp#401-404
STR:
$ mkdir /tmp/profdir
$ mkdir /tmp/delme
$ cd /tmp/delme
$ rmdir /tmp/delme
$ firefox --no-remote -profile /tmp/profdir
Expected:
- Firefox starts up
Actual:
- Firefox does not start but exits immediately.
( I experienced this issue before, but looked deeper this time because it was a reliable way to reproduce a shutdown crash according to https://bugzilla.mozilla.org/show_bug.cgi?id=1601678#c11 )
Assignee | ||
Comment 1•4 years ago
|
||
Rob, are you intending to pursue fixing this?
Reporter | ||
Comment 2•4 years ago
|
||
I wasn't planning to patch this myself, at least not before bug 1601678 (since this bug makes it easier to test the other bug) .
If anyone is interested in fixing this: Check the callers of nsCommandLine::Init
and remove the early return when the working dir cannot be determined. Passing nullptr
is fine (there are already some callers that do this). To fix the specific issue that I reported, at least the one in nsAppRunner.cpp
that I referenced above should be changed.
Assignee | ||
Comment 3•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Pushed by gijskruitbosch@gmail.com: https://hg.mozilla.org/integration/autoland/rev/53b38c458144 cope with not having a working directory, r=robwu,mossop
Comment 5•4 years ago
|
||
bugherder |
Description
•