Closed
Bug 747870
Opened 12 years ago
Closed 12 years ago
Unaligned access in XPCCallContext::XPCCallContext
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
mozilla15
People
(Reporter: glandium, Assigned: glandium)
References
()
Details
Attachments
(1 file)
1.81 KB,
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
I got a report about Iceweasel crashing at startup on sparc. The relevant part of the backtrace is here: #0 XPCCallContext::XPCCallContext (this=0xffff566c, callerLanguage=XPCContext::LANG_JS, cx=0xf7924340, callBeginRequest=0, obj=0xf0c9d900, flattenedJSObject=0xf0c9d900, wrapper=0x0, tearOff=0x0) at js/xpconnect/src/XPCCallContext.cpp:83 #1 0xf6deef30 in XPCLazyCallContext::GetXPCCallContext (this=0xffff5648) at js/xpconnect/src/xpcprivate.h:1335 The problem comes from using the placement new operator with an array of char, which is not correctly aligned for the XPCCallContext class. Thanks to Jurij Smakov for tracking down the root cause.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #617439 -
Flags: review?(bobbyholley+bmo)
Comment 2•12 years ago
|
||
Comment on attachment 617439 [details] [diff] [review] Properly align XPCLazyCallContext::mData Review of attachment 617439 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/xpconnect/src/xpcprivate.h @@ +1315,1 @@ > mCallBeginRequest == CALL_BEGINREQUEST, Fix indentation somehow, please.
Comment 3•12 years ago
|
||
Comment on attachment 617439 [details] [diff] [review] Properly align XPCLazyCallContext::mData This won't cause any extra code to be run on XPCLazyCallContext instantiation, right? These things need to be super fast, at least until the new DOM bindings are done. r=bholley with the indentation fixed.
Attachment #617439 -
Flags: review?(bobbyholley+bmo) → review+
Assignee | ||
Comment 4•12 years ago
|
||
No, it's just a POD type with the right alignment.
Assignee | ||
Comment 5•12 years ago
|
||
(In reply to Ms2ger from comment #2) > Comment on attachment 617439 [details] [diff] [review] > Properly align XPCLazyCallContext::mData > > Review of attachment 617439 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: js/xpconnect/src/xpcprivate.h > @@ +1315,1 @@ > > mCallBeginRequest == CALL_BEGINREQUEST, > > Fix indentation somehow, please. As indenting would make that line you quote go overboard, what style would you prefer? mCcxToDestroy = mCcx = new (mData.addr()) XPCCallContext(mCallerLanguage, (...) mCcxToDestroy = mCcx = new (mData.addr()) XPCCallContext(mCallerLanguage, (...) char *data = mData.addr(); mCcxToDestroy = mCcx = new (data) XPCCallContext(mCallerLanguage, (...) other ? (The latter case allowing the current indentation being kept)
Assignee | ||
Comment 6•12 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #5) > char *data = mData.addr(); XPCCallContext *data, even.
Comment 7•12 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #5) > (The latter case allowing the current indentation being kept) SGTM.
Assignee | ||
Comment 8•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/77e68aa8f24c
Target Milestone: --- → mozilla15
Comment 9•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/77e68aa8f24c
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•