Closed Bug 1940494 Opened 2 months ago Closed 1 month ago

nsICrashReporter::annotateCrashReport does not support typed annotations

Categories

(Toolkit :: Crash Reporting, defect)

defect

Tracking

()

RESOLVED FIXED
136 Branch
Tracking Status
firefox136 --- fixed

People

(Reporter: gsvelto, Assigned: gsvelto)

References

Details

Attachments

(1 file, 1 obsolete file)

The implementation for nsICrashReporter::annotateCrashReport() assumes that the annotation type is a string. This wasn't a problem when all annotations were strings, but now that some can use concrete types this doesn't work anymore. Passing a boolean for example will appear to work if the value is true in a release build because there's no checking and the value will be converted to a string. In a debug build it will crash, and a value of false will succeed but will set the annotation to "1" which is wrong.

We should at very least support integer and boolean annotations from JavaScript and return an error for all other types that aren't supported in annotations.

Assignee: nobody → gsvelto
Status: NEW → ASSIGNED
Pushed by gsvelto@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f955d08effb9 Allow using typed crash annotations from JavaScript r=afranchuk

Backed out for causing build bustages @ ws2def.h

/builds/worker/fetches/vs/Windows Kits/10/Include/10.0.22621.0/shared/ws2def.h(240,16): error: redefinition of 'sockaddr'
Flags: needinfo?(gsvelto)

This is highlighting an issue with includes when windows.h gets included before the other includes in LSPAnnotator.cpp. I don't think we need windows.h in nsExceptionHandler.h so I'll get rid of that.

Flags: needinfo?(gsvelto)
Pushed by gsvelto@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/910b00bf2240 Allow using typed crash annotations from JavaScript r=afranchuk https://hg.mozilla.org/integration/autoland/rev/295e23cf17a0 Remove the windows.h inclusion in nsExceptionHandler.h to fix issues in non-unified builds r=afranchuk
Regressions: 1941762
Backout by abutkovits@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/70821984b161 Backed out 2 changesets for causing bustages at ProtocolUtils.cpp. CLOSED TREE

Ugh, sorry. I had rolled a fix in the patch yesterday and it had picked up an unrelated change, so I reverted the unrelated change... or at least I thought I did that. I had reverted the fix instead. Landing again.

Pushed by gsvelto@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/25c2c93f1f7a Allow using typed crash annotations from JavaScript r=afranchuk
Attachment #9459331 - Attachment is obsolete: true

It seems that only half of the patch-set landed, I must have done something wrong on Lando. Either way here's a try run with both patches folded together. This should work.

Pushed by gsvelto@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e9b4aef0aa14 Allow using typed crash annotations from JavaScript r=afranchuk,win-reviewers,gstoll
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
Flags: needinfo?(gsvelto)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: