Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Heads-up re 1.4 builds on classic MRJ
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Heads-up re 1.4 builds on classic MRJ



No, this isn't a "When will JDK 1.4 be available on classic MacOS?"
question ;-p ....but it may be of interest to those considering doing
a build with 1.4

We do our applet & server builds for a number of platforms on a
Linux box. Recently for a new release, we upgraded the build system
JDK to 1.4. We noticed that the applet began hanging in Mac OS 9
(MRJ 2.2.5) and of course attributed it to some of the code changes.

What we found out (eventually) was that there is a threading problem
with 1.4 built classes that run in MRJ 2.2.5

I filed a bug report with Sun, who told me to send it to Apple as
it's an Apple problem..so I sent it to email@hidden

Here's the complete message including Sun bug report:

-------- To email@hidden -----------------
Hi,

Sun have replied to me saying that this is an
MRJ problem and I should direct it to Apple.

I think the problem is fairly significant as
it means any threaded applet built with 1.4
will hang in the MRJ.

The complete bug report is attached below.

-------- Original Message --------
Subject: Re: (Review ID: 153934) Class built with -target 1.1 hangs in
synchronized() on MacOS MRJ
Date: Fri, 21 Jun 2002 12:04:41 -0700 (PDT)
From: Girish Manwani <email@hidden>
To: email@hidden


We don't have the Macintosh talent or equipment
in-house to debug problems with the MRJ (Macintosh
Runtime for Java(tm)), so we are referring all Mac
related problems to the folks at Apple.


Apple has a MRJ bug reporting address now at:
<email@hidden>. Please send any additional
bugs you have to that address. Feedback and
feature requests still go to The MRJ Feedback
address: <email@hidden>.

Hope this helps,

Regards,
Girish
----------------- Original Bug Report-------------------

category : java
release : hopper-beta
subcategory : compiler
type : bug
synopsis : Class built with -target 1.1 hangs in synchronized() on MacOS MRJ
description : FULL PRODUCT VERSION :
tim@elf:~$ java -version
java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)


FULL OPERATING SYSTEM VERSION :
Debian Linux testing aka 'potato'
kernel 2.5.20
glibc 2.2.5

ADDITIONAL OPERATING SYSTEMS :
MacOS 9.2.2
MRJ 2.2.5 (JDK 1.1.8)



A DESCRIPTION OF THE PROBLEM :
Creating a simple applet source that synchronizes on an
object and then compiling it with JDK 1.4.1 and '-target
1.1' produces a class file that causes MRJ 2.2.5 to hang in
the synchronized(..) { .. } clause.

Problem does not occur if built with JDK 1.1 or JDK 1.3

REGRESSION. Last worked in version 1.3.1

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile the source code attached with JDK 1.4 using the
target parameter '-target 1.1'

2. Jar the class file into a jar file e.g. 'applet.jar' and
place it on a web server.

3. Create an html page with the following applet tag in the
same directory as the applet.

<applet archive="applet.jar"
code=com.hotu.chat.ui.BugApplet width=600 height=500>

4. Install MRJ 2.2.5 on a Macintosh running classic Mac OS.
The JVM is available at
http://developer.apple.com/java/download.html

5. Run the appletviewer and load the html page.


EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected:
The applet should display a text area that contains
the following lines:

entered testSync()
in synchronized method
left testSynch()

Actual:
entered testSync()
in synchronized method

The synchronized clause is never left by the current thread.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
If MacsBug is installed on the Macintosh, it can be initiated
by pressing Command-Eject (Command-Power). Dumping a stack trace
of the current thread with 'mrj sc' produces:

"AVGrp-com.apple.mrj.JManager.JMAWTContextImpl@25cc27f-Disp"
TID: $12e82de8, prio: 4 *current thread*
sys_thread: $12c45730, priority: 4
state: RDY, mon: $0, cq: $1309bd48
$129c9ba8 -> com.hotu.chat.ui.BugApplet.testSync(Compiled Code)
$129c9ba8 -> com.hotu.chat.ui.BugApplet.start(BugApplet.java:36)
$12e813c8 ->
com.apple.mrj.JManager.JMAppletViewer_OLD.doAppletStart(JMAppletViewerOld.java)

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
/**
* An applet to demo synchronised problem
*
*/

package com.hotu.chat.ui;


import java.applet.*;
import java.awt.*;


public class BugApplet extends Applet {

TextArea generalOutput;

private Object listenerLock;

public void init() {

listenerLock = new Object();

generalOutput = new TextArea();
generalOutput.setBackground(Color.white);


add(generalOutput);

setVisible(true);
}


public void start() {

try {
testSync();

}
catch (Exception e) {
e.printStackTrace();
}

}

public void testSync() {

generalOutput.append("entered testSync()\n");
synchronized(listenerLock) {
generalOutput.append("in synchronized method\n");
}
generalOutput.append("left testSynch()\n");

}

public void stop() {
System.out.println("stop() called");
}


public void destroy() {
System.out.println("destroy() called");
}


}
---------- END SOURCE ----------

CUSTOMER WORKAROUND :
Workaround is to build applet with JDK 1.3 or JDK 1.1
instead of JDK 1.4
workaround :
suggested_val :
cust_name : Tim Burgess
cust_email : email@hidden
jdcid :
keyword : webbug
company : hotU Inc
hardware : x86
OSversion : Linux
bugtraqID : 0
dateCreated : 2002-06-20 19:33:00.7
dateEvaluated : 2002-06-21 13:05:18.626
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.