The Source for Java Technology Collaboration

Home » java.net Forums » Java Desktop Technologies » Swing & AWT

Thread: What would it take to fix bug #4486580?

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 8 - Last Post: Oct 12, 2008 7:48 PM by: i30817
cowwoc

Posts: 1,055
What would it take to fix bug #4486580?
Posted: Sep 7, 2008 2:31 PM
 
  Click to reply to this thread Reply

Hi,

I'd like to see http://bugs.sun.com/view_bug.do?bug_id=4486580 fixed and I have a pretty good idea on what needs to be done except that the entire OpenJDK process is way over my head. The last time I tried building OpenJDK in order to produce a patch for Sun I ended up wasting weeks of my time, got nowhere and gave up.

The fix for this bug is understood. We need to ensure that the JDK waits for all shutdown hooks to process before returning from WM_ENDSESSION (right now it returns right away).

Seeing how we've done quite a bit of investigation on our end, would it be possible for someone at Sun to help us finish this off?

Thank you,
Gili

cowwoc

Posts: 1,055
Re: What would it take to fix bug #4486580?
Posted: Sep 7, 2008 2:36 PM   in response to: cowwoc
 
  Click to reply to this thread Reply

BTW: I posted a workaround near the end of the bug report (using a JFrame) that turns out to be unreliable.

Seeing how this bug is 7 years old, the fix is well-understood and that there isn't a workaround for it I would really love to see it fixed in the near future. It is even more relevant in light of the recent "Java on the Desktop" efforts.

i30817

Posts: 386
Re: What would it take to fix bug #4486580?
Posted: Sep 7, 2008 2:44 PM   in response to: cowwoc
 
  Click to reply to this thread Reply

Hear, hear.

It's simply stupid there is no test case for this - the only reason i can think of for not catching it.

Besides, every jar file (the double click wonder) starts with javaws.

THERE IS NO RELIABLE WAY TO SAVE SETTINGS IN A JAVA APPLICATION IF YOU NEED TO FLUSH LAST MINUTE RECORDS.

(I know this is not common, or even advisable, but due to my strategy to find a position, i need it).

mthornton

Posts: 528
Re: What would it take to fix bug #4486580?
Posted: Sep 8, 2008 6:17 AM   in response to: i30817
 
  Click to reply to this thread Reply

Of course you mean javaw not javaws.

As far as I can tell the problem exists with both java and javaw. If you create a window in either, then shutdown doesn't work reliably. This is because Windows distinguishes between processes which have an event thread and those which don't. Shutdown will work with a javaw process that never creates a GUI, and does not work reliably with a java.exe process that does create a GUI.

mthornton

Posts: 528
Re: What would it take to fix bug #4486580?
Posted: Sep 8, 2008 5:40 AM   in response to: cowwoc
 
  Click to reply to this thread Reply

Personally a major impediment to working on this myself is that the OpenJDK build for 32 bit Windows still depends on a (non free) compiler which is now two versions out of date (Microsoft Visual Studio .NET 2003 (VS2003) Professional Edition).

i30817

Posts: 386
Re: What would it take to fix bug #4486580?
Posted: Sep 9, 2008 10:59 AM   in response to: mthornton
 
  Click to reply to this thread Reply

God gosh, i think it would take one of us with a complete openjdk bundle to fix it ourselves.

mthornton what are the steps you're taking for this? My university has VS 2003, but i'm not sure i have the space to compile the openjdk project in these computers (and doing it in a pen is masochistic at least).

mthornton

Posts: 528
Re: What would it take to fix bug #4486580?
Posted: Sep 10, 2008 1:01 AM   in response to: i30817
 
  Click to reply to this thread Reply

I have several hundred GB of free space on my home computer and a copy of VS 2005 (standard edition). Unfortunately I'm a bit short of time for the next couple of weeks.

i30817

Posts: 386
Re: What would it take to fix bug #4486580?
Posted: Oct 12, 2008 7:23 PM   in response to: mthornton
 
  Click to reply to this thread Reply

So any news here?

Apparently even the sun classes have problems with the trigger happy shutdown hooks.
To recapitulate:
1) Apparently shutdown hooks don't well work with window applications.
2) Or, if they work, they are likely to be interrupted (or in other words-not give you any time at all - not even 2 seconds. Heck even 1) before you finish writing.


It's kinda ridiculous but i found a "workaround" - that limits me to sun VM. No mac-os for me grrr.

You'd have to register both a window listener to listen to close events for normal shutdown, and use these sun classes:
        SignalHandler handler = new SignalHandler () {
        public void handle(Signal sig) {
            writeObjects(stateLocation, app);
            System.exit(0);
        }
        };
        Signal.handle(new Signal("INT"), handler);
        Signal.handle(new Signal("TERM"), handler);
        invokeLater(new SwingRun());


i30817

Posts: 386
Re: What would it take to fix bug #4486580?
Posted: Oct 12, 2008 7:48 PM   in response to: i30817
 
  Click to reply to this thread Reply

Reading that the apple VM has the same problems (closed will not fix), does anyone get the sense that the only way for a consistent java platform on all OS is only one implementation?

Yeah.




 XML java.net RSS