Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception at exit #94

Closed
anntzer opened this issue Jul 1, 2014 · 19 comments
Closed

Unhandled exception at exit #94

anntzer opened this issue Jul 1, 2014 · 19 comments

Comments

@anntzer
Copy link

anntzer commented Jul 1, 2014

Fiji (life-line version, 06/02/2014, linux-64) raises an exception upon exit and then needs to be ctrl-c'd.

Below is the stderr output.

log4j:WARN No appenders could be found for logger (org.bushe.swing.event.EventService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[ERROR] Skipping unsupported option -port7
Exception during disposal:
java.lang.reflect.InvocationTargetException
    at java.awt.EventQueue.invokeAndWait(EventQueue.java:1276)
    at java.awt.Window.doDispose(Window.java:1209)
    at java.awt.Window.dispose(Window.java:1147)
    at ij.ImageJ.run(ImageJ.java:767)
    at net.imagej.legacy.IJ1Helper.dispose(IJ1Helper.java:246)
    at net.imagej.legacy.ui.LegacyUI.dispose(LegacyUI.java:127)
    at org.scijava.ui.DefaultUIService.dispose(DefaultUIService.java:362)
    at org.scijava.Context.dispose(Context.java:376)
    at net.imagej.legacy.DefaultLegacyHooks.quit(DefaultLegacyHooks.java:100)
    at ij.ImageJ.quit(ImageJ.java)
    at ij.plugin.Commands.run(Commands.java:45)
    at ij.IJ.runPlugIn(IJ.java:172)
    at ij.Executer.runCommand(Executer.java:131)
    at ij.Executer.run(Executer.java:64)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: null source
    at java.util.EventObject.<init>(EventObject.java:56)
    at java.awt.AWTEvent.<init>(AWTEvent.java:337)
    at java.awt.event.InvocationEvent.<init>(InvocationEvent.java:285)
    at java.awt.event.InvocationEvent.<init>(InvocationEvent.java:174)
    at sun.awt.X11.XBaseMenuWindow.dispose(XBaseMenuWindow.java:907)
    at java.awt.MenuComponent.removeNotify(MenuComponent.java:310)
    at java.awt.Menu.removeNotify(Menu.java:198)
    at java.awt.Component.removeNotify(Component.java:6991)
    at java.awt.Container.removeNotify(Container.java:2800)
    at java.awt.Window.removeNotify(Window.java:782)
    at java.awt.Frame.removeNotify(Frame.java:1041)
    at java.awt.Window$1DisposeAction.run(Window.java:1190)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:302)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:708)
    at java.awt.EventQueue$4.run(EventQueue.java:706)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
@dscho
Copy link
Contributor

dscho commented Jul 1, 2014

Fiji (life-line version, 06/02/2014, linux-64)

Please note that we cannot support life-line versions. We only provide life-line versions in case that an up-to-date Fiji broke something that worked previously.

Having said that...

Caused by: java.lang.IllegalArgumentException: null source

This was addressed in a Herculean effort by @ctrueden and was uploaded (imagej-legacy 0.5.19/ij1-patcher 0.10.0 contain the fixes).

@dscho dscho closed this as completed Jul 1, 2014
@anntzer
Copy link
Author

anntzer commented Jul 2, 2014

When will this patch be included in the daily builds? Today's build suffers from the same issue -- or, more precisely, suffers from the same issue after running ./ImageJ-linux64 --update update-force-pristine.
Before doing that, the build would not even start, failing with

Error while executing the main() method of class 'net.imagej.Main':
java.lang.IllegalArgumentException: Invalid service: io.scif.ome.services.DefaultOMEMetadataService

@dscho
Copy link
Contributor

dscho commented Jul 3, 2014

@anntzer it hit the "daily builds" already. If I understand correctly that you mean the contiuous release, available from http://fiji.sc/Downloads.

@anntzer
Copy link
Author

anntzer commented Jul 3, 2014

Yes, I meant the continuous release. If the daily builds mean something else, are they available somewhere?

@dscho
Copy link
Contributor

dscho commented Jul 3, 2014

@anntzer no, I just got confused by your nomenclature.

If you cannot run Fiji correctly, and you are comfortable around a debugger, please investigate.

If you are more of a user, please use Help>Report a Bug to report the problem. It would be good if you could try to be thorough to facilitate reproducing the issue on the other side, the side of the developers who you ask for help. You might get some inspiration for writing good bug reports from http://stackoverflow.com/questions/how-to-ask and from http://whathaveyoutried.com/.

@anntzer
Copy link
Author

anntzer commented Jul 7, 2014

I tried running fiji (fresh download of today's (2014/07/07) continuous release) with jdb, following the instructions on the "Debugging intro" page.
Unfortunately, after catch uncaught java.lang.IllegalArgumentException and catch uncaught java.lang.reflect.InvocationTargetException (the two exceptions mentioned in the traceback), fiji (invoked with run) still crashes with the same traceback at exit.
I don't know much about jdb but can certainly try more debugging approaches if you help me.

@ctrueden
Copy link
Member

This exception still occurs with an up-to-date Fiji when using Linux 64-bit OpenJDK 1.7.0_55.

@ctrueden ctrueden reopened this Jul 10, 2014
@ctrueden
Copy link
Member

After further investigation with @dscho, we have concluded this is a bug in OpenJDK7 (starting somewhere in the _30s). While it is an ugly exception, execution continues so it is not a crash, and can be generally ignored safely.

I'd be interested to know, once OpenJDK8 becomes available, if the problem still happens there.

@anntzer
Copy link
Author

anntzer commented Jul 10, 2014

It is actually a real issue for me as I am writing a program that can call fiji and wait for it to exit. Unfortunately, as it is right now, the wait never completes because fiji never returns. Of course I could read stderr and kill fiji when the traceback shows up but a simpler workaround would be welcome...

@dscho
Copy link
Contributor

dscho commented Jul 10, 2014

@anntzer if it is that critical a bug for you, feel free to invest as much time and energy into the bug as @ctrueden and I did. Which is a lot. Quite a lot.

We really have to put this on a low flame for now because we have many bugs to address that concern more than just one single user, and since you seem to be a developer yourself, it is fair to put more of a burden on your shoulders.

The thing I would try to do is to figure out whether the peer of the PopupMenu that containsthe Rounded Rectangle Tool menu item of the toolbar ever has a non-null target. If it does, a possibly working workaround might be to disconnect the PopupMenu from the Toolbar before ij.ImageJ's dispose() method is called.

@anntzer
Copy link
Author

anntzer commented Jul 10, 2014

I certainly understand that there are other priorities and did not intend to imply lack of concern from the fiji team -- I rather wanted to point out that "just an ugly exception" can have real consequences too.
I don't know much about the fiji internals nor about jdb but your suggestions are well-taken, I'll have a look at them at some point. Is there any reason why you suspect the Rounded Rectangle Tool to be the culprit?

@ctrueden
Copy link
Member

I think that exception is a red herring. I do not believe it is actually blocking the shutdown. I think the "Fiji won't quit" problem is a wholly different bug, which affects much more than only a single user and which we will continue to work very hard to squash as soon as possible.

But if you have evidence otherwise you are more than welcome to let us know!

@dscho
Copy link
Contributor

dscho commented Jul 11, 2014

I rather wanted to point out that "just an ugly exception" can have real consequences too.

We single-stepped in the debugger and found that while the exception is printed, the code actually continues as it should. Therefore I highly doubt that the consequence you are seeing is a consequence of the exception.

why you suspect the Rounded Rectangle Tool to be the culprit?

As I said, we single-stepped through it. The PopupMenu containing the menu item in question was triggering the error.

@anntzer
Copy link
Author

anntzer commented Jul 11, 2014

As you may have guessed, I actually care very little about the exception, and much more about the failure to quit. Thanks for your investigation of it.

@ctrueden
Copy link
Member

@anntzer Indeed. Then I suggest watching Fiji bug #805 for a resolution.

@ctrueden
Copy link
Member

I believe we fixed this issue in mid-July. Please reopen if the issue persists.

@anntzer
Copy link
Author

anntzer commented Dec 17, 2014

It's fixed now indeed.

@FannyGeorgi
Copy link

Hi guys, despite the optimistic comment from @anntzer, the error message still pops up.

@ctrueden
Copy link
Member

ctrueden commented Nov 4, 2015

@FannyGeorgi To be clear: the problem which @anntzer refers to as "fixed" is actually Fiji's failure to terminate as expected.

The exception given in the OP above is both unrelated and harmless. It also only occurs on Linux with Java 7, to my knowledge.

But if the message bothers or inconveniences you somehow: could you please use Help > Report a Bug to get a snapshot of your system configuration? In particular, OS and version of Java. And if you are using Java 7, could you test with Java 8? It might be fixed there; would be good to know for certain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants