Open Bug 1690326 Opened 4 years ago Updated 10 months ago

Add mappings for NS_ERROR_MODULE_WIN32 errors generated from nsLocalFileWin.cpp

Categories

(Core :: XPCOM, defect, P3)

defect

Tracking

()

People

(Reporter: sg, Unassigned)

References

(Blocks 7 open bugs)

Details

(Keywords: leave-open)

Attachments

(9 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

The NS_ERROR_MODULE_WIN32 errors actually generated from nsLocalFileWin.cpp should eventually be mapped to platform-agnostic error codes.

One candidate error code to be added is 0x570 ERROR_FILE_CORRUPT. We already have NS_ERROR_FILE_CORRUPTED, but we use it probably at a higher level of abstraction (reading a file whose content we don't understand wrt the expected content, like jar). As 0x570 ERROR_FILE_CORRUPT needs probably different actions (it is a strong indicator of file system corruption) than dealing with a file we might have wrecked ourself, I'd propose a new NS_ERROR_FILE_OS_CORRUPT. Ideas for a better naming are welcome!

While NS_ERROR_FILE_CORRUPTED already exists, it indicates most of the times more a parsing problem of a given file format.
But Windows ERROR_FILE_CORRUPTED signals a malfunctioning or corrupted file system at OS level, thus we translate it to the new
NS_ERROR_FILE_FS_CORRUPTED.

There seems to be no suitable errno under POSIX to map here.

Assignee: nobody → jstutte
Status: NEW → ASSIGNED
Attachment #9209758 - Attachment description: Bug 1690326: Map Windows error 0x570 ERROR_FILE_CORRUPT to NS_ERROR_FILESYSTEM_CORRUPTED r?sg,#xpcom-reviewers → Bug 1690326: Map Windows error 0x570 ERROR_FILE_CORRUPT to NS_ERROR_FILE_FS_CORRUPTED r?sg,#xpcom-reviewers
Keywords: leave-open
Attachment #9209758 - Attachment description: Bug 1690326: Map Windows error 0x570 ERROR_FILE_CORRUPT to NS_ERROR_FILE_FS_CORRUPTED r?sg,#xpcom-reviewers → Bug 1690326: Map Windows error 0x570 ERROR_FILE_CORRUPT to NS_ERROR_FILE_FS_CORRUPTED r?janv,#xpcom-reviewers
Pushed by jstutte@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5cd1ef556cbc Map Windows error 0x570 ERROR_FILE_CORRUPT to NS_ERROR_FILE_FS_CORRUPTED r=xpcom-reviewers,janv,nika
Blocks: 1704495
No longer blocks: 1704495
See Also: → 1704495

WIN32(0x45D) is ERROR_IO_DEVICE seems to happen in the wild, too.

See Also: → 1704439
See Also: → 1704438
Pushed by jstutte@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2899639c5db8 Map Windows error 0x45D ERROR_IO_DEVICE to NS_ERROR_FILE_DEVICE_FAILURE r=janv,xpcom-reviewers,mccr8
See Also: → 1706006

Looking at what I can map ERROR_DISK_FULL in ConvertWinError I was wondering, if ERROR_DISK_FULL and/or ERROR_HANDLE_DISK_FULL should really map to NS_ERROR_FILE_TOO_BIG, which sounds meaningful to me only in case we are writing a (large) file. And the only place we intercept NS_ERROR_FILE_TOO_BIG seems to deal with 32Bit limitations while reading, not with the disk full case.

The code which depends on the old generic NS_ERROR_MODULE_WIN32 mapping needs
to be updated too.

Depends on D113505

See Also: → 1705304
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a98b826be2d8 Follow-up fix for the ERROR_FILE_CORRUPT to NS_ERROR_FILE_FS_CORRUPTED mapping; r=jstutte
See Also: → 1703266

For bug 1704439, comment 7:

0x1E3 seem to have no current mapping in official documentation ? And in winerror.h we only see:

#define MK_E_UNAVAILABLE _HRESULT_TYPEDEF_(0x800401E3L)

whatever MK_E_UNAVAILABLE means (what I read in internet talks about marshaling to office?).

(In reply to Jens Stutte [:jstutte] from comment #13)

For bug 1704439, comment 7:

0x1E3 seem to have no current mapping in official documentation ? And in winerror.h we only see:

#define MK_E_UNAVAILABLE _HRESULT_TYPEDEF_(0x800401E3L)

whatever MK_E_UNAVAILABLE means (what I read in internet talks about marshaling to office?).

I don't think MK_E_UNAVAILABLE has to do with the error. According to net helpmsg 483, the error message for Win32 error code 483 (0x1E3) is "The request failed due to a fatal device hardware error."

(In reply to Jens Stutte [:jstutte] from comment #13)

And in winerror.h

Obviously this is not an official Microsoft repo. I found

//
// MessageId: ERROR_DEVICE_HARDWARE_ERROR
//
// MessageText:
//
// The request failed due to a fatal device hardware error.
//
#define ERROR_DEVICE_HARDWARE_ERROR 483L

in my local Windows SDK installation.

(In reply to Masatoshi Kimura [:emk] from comment #16)

#define ERROR_DEVICE_HARDWARE_ERROR 483L

in my local Windows SDK installation.

Thanks for looking that up! That sounds much more plausible, indeed.

Pushed by jstutte@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d148b4f4821e Add mappings for ERROR_DEVICE_HARDWARE_ERROR, ERROR_DEVICE_NOT_CONNECTED, ERROR_DISK_FULL and remove error NS_ERROR_FILE_DISK_FULL in favor of existing NS_ERROR_FILE_NO_DEVICE_SPACE r=xpcom-reviewers,necko-reviewers,nika,valentin
Regressions: 1709887
See Also: → 1709957
Blocks: 1703801

There are some new Windows errors. hurray!

Code Meaning Where
0x12 ERROR_NO_MORE_FILES GetNextFile, this might be something we need to handle/expect?
0x1 ERROR_INVALID_FUNCTION GetDirectoryEntries, not sure but we might try to invoke GetDirectoryEntries on a directory that vanished in the meantime?
0x5AA ERROR_NO_SYSTEM_RESOURCES Sounds not very actionable, but is definitely fatal
0x1129 ERROR_REPARSE_TAG_INVALID (The tag present in the reparse point buffer is invalid.) GetDirectoryEntries
0x17 ERROR_CRC Data error (cyclic redundancy check). CopyTo From what I read, it is another form of saying "filesystem corrupt"
No longer blocks: 1703801
Blocks: 1703801
Blocks: 1704440
Blocks: 1706006

We should map also:

ERROR_INVALID_NAME

  • 123 (0x7B)
  • The filename, directory name, or volume label syntax is incorrect.
Assignee: jstutte → jjalkanen
Pushed by echuang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a26f138f9054 Map Windows local file error 0x7B ERROR_INVALID_NAME to NS_ERROR_FILE_INVALID_PATH, r=xpcom-reviewers,dom-storage-reviewers,nika,jstutte
Blocks: 1704439
Severity: -- → S4
Priority: -- → P3
Assignee: jjalkanen → nobody
Status: ASSIGNED → NEW
Blocks: 1702422

The error 0x1129 ERROR_REPARSE_TAG_INVALID now also appeared in Bug 1702422 Comment 83 for the first time.

The error 0x571 ERROR_DISK_CORRUPT appeared in Bug 1704439 Comment 52 for the first time. The Microsoft docs says "The disk structure is corrupted and unreadable.", so maybe it could be mapped to NS_ERROR_FILE_FS_CORRUPTED.

The error 0x571 ERROR_DISK_CORRUPT also appeared in Bug 1702422 Comment 83 for the first time.

Blocks: 1720080

The error 0x1129 ERROR_REPARSE_TAG_INVALID appeared in Bug 1720080 Comment 52 for the first time.

Assignee: nobody → jkrause
Status: NEW → ASSIGNED
Pushed by jkrause@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6020e9690ec4 Map Windows error `ERROR_DISK_CORRUPT` to `NS_ERROR_FILE_FS_CORRUPTED`. r=xpcom-reviewers,dom-storage-reviewers,jstutte,nika
See Also: 1704439, 1706006

The error 0x510 ERROR_CONTENT_BLOCKED appeared in Bug 1702421 Comment 78 for the first time.

Blocks: 1702421
Pushed by jkrause@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3079bbbfc4cb Map Windows error `0x510 ERROR_CONTENT_BLOCKED` to `NS_ERROR_FILE_ACCESS_DENIED`. r=xpcom-reviewers,nika
See Also: → 1757754
Regressions: 1757754
See Also: 1757754
Pushed by jkrause@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f2ae3ed2e501 Map Windows error `ERROR_DEV_NOT_EXIST` (0x37) to `NS_ERROR_FILE_DEVICE_FAILURE`. r=xpcom-reviewers,barret

The severity field for this bug is relatively low, S4. However, the bug has 5 See Also bugs.
:jkrause, could you consider increasing the bug severity?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jkrause)

(In reply to Release mgmt bot [:suhaib / :marco/ :calixte] from comment #40)

The severity field for this bug is relatively low, S4. However, the bug has 5 See Also bugs.
:jkrause, could you consider increasing the bug severity?

The see also here keep just track where we've seen this Windows error the first time. Having or not having this mapping does not change anything for the end-user.

Flags: needinfo?(jkrause)
Pushed by jkrause@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9b6a517953b4 Map Windows error `ERROR_NO_SYSTEM_RESOURCES` (0x5AA) to `NS_ERROR_OUT_OF_MEMORY`. r=xpcom-reviewers,kmag

The leave-open keyword is there and there is no activity for 6 months.
:jkrause, maybe it's time to close this bug?
For more information, please visit auto_nag documentation.

Flags: needinfo?(jkrause)

Mapping the errors is on an ongoing basis.

Flags: needinfo?(jkrause)
Blocks: 1855352

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: jan.rio.krause → nobody
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: