Closed Bug 315163 Opened 19 years ago Closed 18 years ago

x86 Mac JEP crashes, no Java

Categories

(Core Graveyard :: Plug-ins, defect)

PowerPC
macOS
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mcafee, Assigned: mark)

References

Details

(Keywords: fixed1.8.0.2, fixed1.8.1, Whiteboard: [camino-1.0])

Attachments

(3 files)

8F1111/i386 (latest seed)

FF1.5rc1/intel/josh-build crashes with JEP 0.9.4+a, crash log to follow.
We may just need a recompile here, both the josh-firefox binary and the JEP
were pre-8F1111 for me.  We may be getting bitten by either the jni.h or
the dyld problems from earlier 8F* builds.
Severity: normal → critical
JEP: 0.9.4+a, steven mailed this to me 10/3/2005
FF15rc1: the binary from josh's blog site:

Firefox (http://josh.trancesoftware.com/mozilla/firefox-1.5.intel.mac.dmg) (2005.10.21, contains patch from bug 312929 (https://bugzilla.mozilla.org/show_bug.cgi?id=312929))
-> core
Component: General → Plug-ins
Product: Firefox → Core
Version: unspecified → Trunk
I've got this covered.
Assignee: smichaud → mark
Summary: Mac/i386: Universal JEP java plugin crashes on 8F1111 → x86 Mac JEP crashes, no Java
Patch against JEP 0.9.5+b, MRJPlugin in-tree portion.  A test build with this plugin is available at http://wiki.mozilla.org/Mac:Intel .
JEP still doesn't work with Cocoa on x86.  It crashes with an evil $ebp and resultant garbage stack.  Dumping from $esp gave some clues.  At the very least, direct use of objc_msgSend_stret is causing problems because the calling convention varies.

http://developer.apple.com/documentation/MacOSX/Conceptual/universal_binary/universal_binary_tips/chapter_5_section_23.html

If [normal objc] is out of the question (I see why it's difficult where it's not used), we can do something like:

#ifdef __ppc__
#define objc_msgSend_stret_NSRect objc_msgSend_stret
#elif defined (__i386__)
static const NSRect (*objc_msgSend_stret_NSRect)(NSRect*, id, SEL, ...) = &objc
_msgSend_stret;
#endif

[...]

objc_msgSend_stret_NSRect(&dirty, self, @selector(_dirtyRect));

These changes prevent $ebp from getting trashed due to not following the ABI and allows something resembling normal flow.  I still see crashes in objc_msgSend_stret called by something in AppKit, usually on something overridden by JEP where JEP calls back into AppKit with objc_msgSendSuper.

I can get the first frame of the applet to display by skipping the call into [NSView _propagateDirtyRectsToOpaqueAncestors].  And I can bypass the crashes entirely by skipping the call into [NSView _drawRect:clip:], but of course nothing draws then.
Making these calls through [normal objc] allows JEP to function in Camino.
objc_msgSend_stret was the only culprit.  I wasn't able to successfully send messages by calling that function directly, so I adapted it to standard Objective-C and added category interfaces to handle private methods that aren't defined by the system headers.
Blocks: 324651
A fat JEP has been checked into CAMINO_1_0_BRANCH.  This is JEP 0.9.5+c with x86 bits produced using these patches merged in using lipo.
Whiteboard: [camino-1.0]
Flags: blocking1.8.0.2?
Flags: blocking1.8.0.2? → blocking1.8.0.2+
This was fixed on the trunk, 1_8, and 1_8_0 branches by checking in a universal JEP 0.9.5+c with these patches in bug 327785.  Bug 327785 contains details about what exactly was checked in.  This bug will remain open until the patches or something else that accounts for the bugs makes it upstream to the JEP.
This is SO fixed.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: