Closed Bug 938597 Opened 8 years ago Closed 8 years ago

Make 'cannot save prefs from content process assertions' more useful

Categories

(Toolkit :: Preferences, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: gwagner, Assigned: reuben)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file, 1 obsolete file)

Right now we only see an assertion in the log but we don't know what pref we want to save.
19:19:14     INFO -  [Child 879] WARNING: NS_ENSURE_TRUE(XRE_GetProcessType() == GeckoProcessType_Default) failed: file ../../../../gecko/modules/libpref/src/Preferences.cpp, line 1485
19:19:14     INFO -  [Child 879] ###!!! ASSERTION: cannot save prefs from content process: 'Error', file ../../../../gecko/modules/libpref/src/Preferences.cpp, line 618

It would be great to print the pref name as well.
Blocks: 933355
Reuben, something you could take?
Here's how it looks like:

[Child 34370] WARNING: ENSURE_MAIN_PROCESS failed. Cannot SetInt from content process: dom.foo.bar: file /Users/Reuben/Development/b2g-inbound/modules/libpref/src/Preferences.cpp, line 1493

[Child 34844] ###!!! ASSERTION: ENSURE_MAIN_PROCESS failed. Cannot SetIntPref from content process: dom.foo.bar: 'Error', file /Users/Reuben/Development/b2g-inbound/modules/libpref/src/nsPrefBranch.cpp, line 205
Assignee: nobody → reuben.bmo
Attachment #832335 - Flags: review?(benjamin)
Comment on attachment 832335 [details] [diff] [review]
Include pref name in the error message for operations that cannot happen in content processes

PR_smprintf allocs, and you're never freeing the buffer. Also, the string formatting isn't guarded by a debug-only block, which is what I think you want here, right?
Attachment #832335 - Flags: review?(benjamin) → review-
You may want nsPrintfCString
You are of course correct on both comments.
Attachment #832335 - Attachment is obsolete: true
Attachment #8334012 - Flags: review?(benjamin)
Attachment #8334012 - Flags: review?(benjamin) → review+
https://hg.mozilla.org/mozilla-central/rev/1687f0278bdd
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.