United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6678385 Random java.lang.StackOverflowError from various JDKs
JDK-6678385 : Random java.lang.StackOverflowError from various JDKs

Details
Type:
Bug
Submit Date:
2008-03-21
Status:
Closed
Updated Date:
2011-05-18
Project Name:
JDK
Resolved Date:
2011-05-18
Component:
client-libs
OS:
linux_2.6
Sub-Component:
java.awt
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
6u4
Fixed Versions:

Related Reports
Backport:
Backport:
Relates:
Relates:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

Description
We've got over 30 reports of exception with this stacktrace. It has no exact steps to reproduce.

See comments in our exceptions reporter:
http://statistics.netbeans.org/analytics/detail.do?id=38330

STACKTRACE: (first 10 lines)
java.lang.StackOverflowError
        at sun.awt.X11.XlibWrapper.CallErrorHandler(XlibWrapper.java:0)
        at sun.awt.X11.XToolkit.SAVED_ERROR_HANDLER(XToolkit.java:125)
        at sun.awt.X11.XToolkit.GlobalErrorHandler(XToolkit.java:136)
        at sun.awt.X11.XlibWrapper.CallErrorHandler(XlibWrapper.java:0)
        at sun.awt.X11.XToolkit.SAVED_ERROR_HANDLER(XToolkit.java:125)
        at sun.awt.X11.XToolkit.GlobalErrorHandler(XToolkit.java:136)
        at sun.awt.X11.XlibWrapper.CallErrorHandler(XlibWrapper.java:0)
        at sun.awt.X11.XToolkit.SAVED_ERROR_HANDLER(XToolkit.java:125)
        at sun.awt.X11.XToolkit.GlobalErrorHandler(XToolkit.java:136)
        at sun.awt.X11.XlibWrapper.CallErrorHandler(XlibWrapper.java:0)
This problem is described in details in SWT bugs database:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=171432

                                    

Comments
EVALUATION

I have to say I have not been able to "decode" informtation available at http://statistics.netbeans.org/analytics/detail.do?id=38330
The only thing I've understood:

 	I've just created new Ruby on Rails application using new Project wizard and I've got this. It was on Ubuntu 8.04 Alpha 6 with composite window manager (window effects set to normal in GNOME).

Though I'm not sure if this information is useful :(
                                     
2008-03-21
SUGGESTED FIX

An idea is to make AWT error handlers synthetic: install a real handler at the very beginning and call the requested handlers from it instead of real calls to XSetErrorHandler(). This would change the sequence of error handlers the following way (compare to what is described in SWT bug #171432):

AWT thread: XToolkit is initialized and sets its global event handler
            saved_error_handler = XSetErrorHandler(XlibWrapper.ToolkitErrorHandler)

AWT thread: invokes XToolkit.WITH_XERROR_HANDLER()
            the new handler is stored in XToolkit and all the errors from default
            toolkit handler are forwared to it
            no call to XSetErrorHandler() is performed

GTK thread: invokes gdk_error_trap_push() and remembers the temporary
            AWT toolkit error handler (XlibWrapper.ToolkitErrorHandler)

AWT thread: invokes XToolkit.RESTORE_XERROR_HANDLER()
            current error handler is cleared, all the subsequent errors are skipped
            (or forwarded to saved_error_handler)
            no call to XSetErrorHandler() is performed

GTK thread: invokes gdk_error_trap_pop() and again sets
            the X error handler to XlibWrapper.ToolkitErrorHandler

AWT thread: on JVM shutdown, XToolkit restores the saved handler
            XSetErrorHandler(saved_error_handler)
                                     
2009-03-30
PUBLIC COMMENTS

This bug also affects SWT: https://bugs.eclipse.org/bugs/show_bug.cgi?id=142644.
                                     
2009-04-15



Hardware and Software, Engineered to Work Together