Closed Bug 55026 Opened 24 years ago Closed 24 years ago

crash if saving file w/ non-existent directory in filepicker

Categories

(Core :: XUL, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: xk, Assigned: jag+mozbugs)

References

Details

(Keywords: crash)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.17 i686; en-US; m18) Gecko/20000928 BuildID: 2000092821 When saving any file ("Save Page As...","Save Image As...", etc) through file picker, if you specify a directory which does not exist, it eventually crashes (if you confirm "ok" on the error dialogs) Reproducible: Always Steps to Reproduce: load up file:///home/xk save 'todo' as '/home/xk/crasher' dialogs pop up: Unknown error [3 80004005] Unknown error [0 C1F30001] Press ok on both => crash. Actual Results: Browser segfaults. Expected Results: if we own (have enough privileges) the last directory that exists in the path, create it and be quiet that it was done. If we don't, warning dialog should pop up for "cancel" and "try filepicker again" or something like that.
did this occur in a trunk or branch build? does it still occur with a more recent build?
Keywords: crash
hm, i cannot get a crash to occur. all i get is a dialog similar to what you see ("unknown error 3 80004005"), which i dismiss by clicking OK. no segfaults, no core, browser still running. then again, i'm using 2000.10.03.09-n6, which are commercial branch bits. Asa, can you repro with a recent trunk build? if not, feel free to mark wfm (unless of course it is a trunk bug).
Whatever build is in the mozilla/nightly/latest/ directory.
xk@leguin.org.uk, please do not use the /latest directory as you can't tell which build you're getting. looking in the /nightly/ you can see by the directory names which build you're downloading.
the build that I used was 2000092821 (as in the original bug report submission) and still occurs with 2000100221. I would not have a clue whether it's a trunk or branch build since I always download the tarball from the 'latest' directory. Since I gather this is automatically symlink'd, I thought you would know what type of build it is linked to unless it's done manually and randomly.
I think this is a dupe, let me find it. Well, at least I've got a partial fix for this :-)
Okay, it's not really a dupe, but it's related to bug 27612, and requires the same fix. Currently, we show some weird error dialog. What I want to show is something like: +----------------------------------+ |Can't save file | |foo/bar | |because directory | |foo | |doesn't exist. | |Create directory and save file? | | [create] [cancel]| +----------------------------------+ Where [create] would create any directories needed (with failure warnings where needed). Alternatively, we add a directory creation button to the filepicker and just popup a warning "Couldn't save foo/bar because foo doesn't exist or isn't a directory" [ok] Changing component, cc'ing mpt, bryner and pavlov, taking bug (for now), I have a partial fix. mpt, help! UI?
Assignee: ben → disttsc
Status: UNCONFIRMED → NEW
Component: XP Apps: GUI Features → XP Toolkit/Widgets
Ever confirmed: true
A number of things to check/implement here. Firstly, when the user clicks `Save', the file picker should make an experimental attempt at writing to the specified file *before* closing the filepicker. This is so you don't have to reopen the filepicker (unnecessarily unstable UI) if you get an error message like this, or if you don't have permissions to write to the file, or if the user clicks `Cancel' in the `Replace existing "KingFred.html"?' dialog for overwriting an existing file, or whatever. Secondly, If I try to save /users/jag/foo/docs/KingFred.html, but accidentally specify /users/jag/fop/docs/KingFred.html, I should get this error: +--------------------------------------------------+ | Save Error ::::::::::::::::::::::::::::::::::::::| +--------------------------------------------------+ | . The file "King Fred.html" could not be saved | | /!\ in the folder "fop", because the folder does | | `"' not exist. | | | | ( Cancel ) (( Retry )) | +--------------------------------------------------+ Note that the message should complain about the highest-level missing directory (fop/), which is not necessarily the same as the immediate-parent missing directory (docs/). That way the user is more likely to realize the cause of the problem. Thirdly, this error dialog should be generalized so that I can inject various `because' phrases into it -- such as `you do not have permission to change the file', or `you do not have permission to change the contents of the folder', or (in the worst case, where you don't have a handy error message) `an error of type {errCode} occurred'. In all cases, `Cancel' takes you back to the filepicker (which is still open), and `Retry' is for if you've scurried to a shell and created the directory (or changed the permissions, or whatever to fix the particular error) in the meantime. Allowing the user to create the folder (and all its missing parents!) from within the error dialog is tempting, but it is probably too prone to causing further user errors. So fourthly, you want to implement a `New Folder ...' button in the save filepicker itself instead.
Hi. In Mozilla/5.0 (Windows; U; Win98; en-US; 0.6) Gecko/20001205 When I save a link and the file don´t exist, Mozilla report an Alert dialog with Unknown error [1 804B000E] When I save a link and the file is downloading, but in any time the server don´t responding, Mozilla report an Alert dialog with Unknown error [1 80004005]
Please do not report bugs on Mozilla 0.6 until you have tried to reproduce it with a recent nightly build. Mozilla 0.6 is based off a several-months-old branch.
Marking this depend on bug 27612.
Depends on: 27612
We're not crashing any longer, marking this fixed. mpt, I partially implemented your suggestion as part of bug 27612. I completely forgot about your design here. Comparing what I implemented against what you suggested here, I don't have the Retry button, I'm not pre-checking for permissions, and my texts are slightly simpler. Want to make that part of your redesigned XP filepicker, or shall I open a new bug on the current one?
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
> I don't have the Retry button Good ... I changed my mind about that. :-) Since the user can just press Enter twice (`OK' to dismiss the dialog, then `Save' again in the filepicker to retry the same path), having a `Retry' button is not worth the confusion. (That also means that the caution (!) icon in my design should be changed to the error (X) icon, since the alert no longer offers the user a choice of commands.) I'll file the other bugs when the filepicker spec is finished.
vrfy fixed using 2001.05.22.08 linux moz bits. when entering a bogus dir, get an error and no crash [still won't create/offer to create the dir].
Status: RESOLVED → VERIFIED
Summary: crash if saving file w/ non-existant directory in filepicker → crash if saving file w/ non-existent directory in filepicker
You need to log in before you can comment on or make changes to this bug.