Java crashes under Rosetta

RESOLVED FIXED

Status

Core Graveyard
Java: OJI
RESOLVED FIXED
12 years ago
7 years ago

People

(Reporter: Mark Mentovai, Assigned: Mark Mentovai)

Tracking

({fixed1.8.0.2, fixed1.8.1})

1.8 Branch
PowerPC
Mac OS X
fixed1.8.0.2, fixed1.8.1
Bug Flags:
blocking1.8.0.2 +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [camino-1.0])

Attachments

(1 attachment)

(Assignee)

Description

12 years ago
This isn't a significantly big deal, but if it can be fixed easily, it should be.  Java doesn't work under Rosetta, but instead of gracefully accepting the fact that a JVM can't be started, we crash when we're running translated.  I don't have a good stack because, um, we're running under Rosetta.

Printed to the console:

### MRJPlugin: getPluginBundle() here. ###
### MRJPlugin: CFBundleGetBundleWithIdentifier() succeeded. ###
### MRJPlugin: CFURLGetFSRec() succeeded. ###
Java for ppc cannot run in this configuration.
Please consult documentation.

This is one option:

http://developer.apple.com/documentation/MacOSX/Conceptual/universal_binary/universal_binary_exec_a/chapter_7_section_7.html

But it's probably better to implement a fix that will give up without crashing if a JVM can't be started.
(Assignee)

Comment 1

12 years ago
*** Bug 324524 has been marked as a duplicate of this bug. ***
(Assignee)

Updated

12 years ago
Assignee: yuanyi21 → mark
(Assignee)

Comment 2

12 years ago
Here's what's happening.  On the first call to JEP's [AppletView maybeCreateJavaVM:...], the call to JNI_CreateJavaVM is failing and JEP is properly returning an error (ENOMEM).  On the next call into maybeCreateJavaVM:, JNI_GetCreatedJavaVMs returns success and indicates that one JVM is available, and gives back a JavaVM object for it.  The object is detached, so maybeCreateJVM: attempts to attach it by calling AttachCurrentThread, and that's where the crash occurs.

I can't think of a good reason for JNI_GetCreatedJavaVMs to return bogus JVMs, so I'll follow up separately on that with Apple.

In the mean time, I'm adding a static variable to maybeCreateJavaVM: that tracks whether or not a JVM was ever created successfully, and avoiding calling JNI_GetCreatedJavaVMs if none has been.  Running under Rosetta now, the broken-plugin icon is properly displayed upon encountering Java.

I'll post the patch here and check in a new fat JEP bundle with this modification for Camino 1.0.

Reminder: those of you patching JEP locally for x86/universal builds will also be interested in bug 315163.  This bug affects Rosetta so the ppc build is the critical portion, that bug affects the straight x86 build.
Status: NEW → ASSIGNED
(Assignee)

Comment 3

12 years ago
Created attachment 210813 [details] [diff] [review]
Only try existing JVMs if any had been created
(Assignee)

Comment 4

12 years ago
New JEP bits (0.9.5+c+2) checked in on CAMINO_1_0_BRANCH.
Whiteboard: [camino-1.0]
(Assignee)

Updated

12 years ago
Flags: blocking1.8.0.2?
(Assignee)

Comment 5

12 years ago
rdar://4434041

Comment 6

12 years ago
Thanks for the Radar number...I'll track that.
Flags: blocking1.8.0.2? → blocking1.8.0.2+
(Assignee)

Comment 7

11 years ago
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.
Keywords: fixed1.8.0.2, fixed1.8.1
(Assignee)

Comment 8

11 years ago
*** Bug 333009 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 9

11 years ago
JEP 0.9.5+d now contains a similar fix.  This version is now on the 1.8 branch and trunk.  0.9.5+c, with x86 patches including this one, is now on the 1.8.0 branch and shipped with 1.8.0.2.
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED

Comment 10

11 years ago
*** Bug 331494 has been marked as a duplicate of this bug. ***

Updated

7 years ago
Component: Java: OJI → Java: OJI
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.