Closed Bug 434190 Opened 17 years ago Closed 15 years ago

SharedStub assembly dangerously takes nsXPTCStubBase object from caller stack and can lead to crashes

Categories

(Core :: XPCOM, defect)

HP
Linux
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla1.9.3a5

People

(Reporter: glandium, Assigned: glandium)

Details

Attachments

(1 file)

This happens on hppa, but seeing the code, could happen on several other architectures, depending on how compilers work. Depending on optimization level, the nsXPTCStubBase::Stubnnn stack frame can be of zero size. On hppa, here is what can be seen: with -O0: _ZN14nsXPTCStubBase7Stub249Ev: .PROC .CALLINFO FRAME=64,CALLS,SAVE_RP,SAVE_SP,ENTRY_GR=4 with -02 or -Os: _ZN14nsXPTCStubBase7Stub249Ev: .PROC .CALLINFO FRAME=0,NO_CALLS,SAVE_RP At the same time, the assembly code in xptcstubs_asm_pa*.s assumes the stack frame for these stub functions to be always 64 bytes, leading the assembly code to not take the proper value for the nsXPTCStubBase object, and lead to crashes.
This is possibly the same crash as #18875...
This is also the same thing as bug #15604.
Actually, other architectures don't seem to be impacted.
Attached patch PatchSplinter Review
Assignee: nobody → mh+mozilla
Attachment #435823 - Flags: review?(shaver)
Comment on attachment 435823 [details] [diff] [review] Patch Bouncing to Benjamin, but it seems like the right thing is to make the HPPA code either handle the possible stack frame size, or add a configure test for specific behaviour we want to avoid (0-sized frame?) rather than just wiping out all optimizations here and hoping that we don't hit this problem for some other reason (like PGO).
Attachment #435823 - Flags: review?(shaver) → review?(benjamin)
Comment on attachment 435823 [details] [diff] [review] Patch I'm ok with the hack, because I really don't know what form a configure test would take. Would be nice to have a more precise fix, though.
Attachment #435823 - Flags: review?(benjamin) → review+
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: