Closed Bug 1704034 Opened 4 years ago Closed 4 years ago

Make the stackwalker print out the name of NTSTATUS error codes

Categories

(Toolkit :: Crash Reporting, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: gsvelto, Assigned: gsvelto)

Details

Attachments

(1 file)

Sometimes the reason for a crash is not part of Windows' EXCEPTION_* error codes but rather comes from NTSTATUS. Additionally since bug 1692309 we're surfacing the contents of the last recorded error in the threads where it's non-null which is also an NTSTATUS value. We should print them out the actual names of those values.

This requires three things:

  • Update the list of NTSTATUS values which is outdated
  • Use the name of the value for the crash reason if it is an NTSTATUS code
  • Remove from the MDExceptionCodeWin enum the values that don't have corresponding macros in minwinbase.h, these will use the status codes instead to avoid confusion. Also correct the existing names because at least one is inconsistent with the Windows SDK headers.

Edit: the change that affects GetLastError() values should only happen in Socorro's stack walker

This patch changes a few things regarding how error codes are printed out.
First of all it updates the list of statuses defined in ntstatus.h, and makes
it up-to-date with the current Windows SDK. With this done we change how we
print out a minidump exception code so that if it's not among the known
EXCEPTION_* values we try to print it out as a STATUS_* one.

It's worth noting that the EXCEPTION_* definitions are just aliaeses for
STATUS_* ones and deprecated in Windows but since they're commonly used we
just keep them.

Last but not least we change how EXCEPTION_BOUNDS_EXCEEDED,
EXCEPTION_STACK_BUFFER_OVERRUN and EXCEPTION_HEAP_CORRUPTION are
printed because they are inconsistent with their Windows equivalents.
They're "breakpadisms" and they've caused confusion in the past.

Assignee: nobody → gsvelto
Status: NEW → ASSIGNED
Pushed by gsvelto@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d547d751a901 Make the stackwalker print out the name of NTSTATUS error codes r=KrisWright

Backed out for causing win xpc failures in test_crash_heap_corruption

Backout link: https://hg.mozilla.org/integration/autoland/rev/22c0d32317b8252edc06f92164299319039f58ca

Push with failures

Failure log

Flags: needinfo?(gsvelto)

Ah silly me, I should have updated the tests.

Flags: needinfo?(gsvelto)
Pushed by gsvelto@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d354f73eeaa5 Make the stackwalker print out the name of NTSTATUS error codes r=KrisWright
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: