Bug 1007803 - gcj java.awt.Toolkit.getDefaultToolkit w/o DISPLAY: exit 1
gcj java.awt.Toolkit.getDefaultToolkit w/o DISPLAY: exit 1
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-09-13 07:00 EDT by Stephan Bergmann
Modified: 2015-02-17 12:10 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-02-17 12:10:32 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Stephan Bergmann 2013-09-13 07:00:01 EDT
Description of problem:

In gcj, calling java.awt.Toolkit.getDefaultToolkit() with the DISPLAY environment variable not set leads to abrupt termination of the process with exit code 1.

Version-Release number of selected component (if applicable):

At least reproducible with java-1.5.0-gcj-devel- but also already with java-1.5.0-gcj-devel-

How reproducible:


Steps to Reproduce:

> $ cat Test.java
> public class Test {
>     public static void main(String[] arguments) {
>         try {
>             java.awt.Toolkit.getDefaultToolkit();
>             System.out.println("good");
>             System.exit(0);
>         } catch (Throwable e) {
>             e.printStackTrace();
>         }
>     }
> }
> $ /usr/lib/jvm/java-1.5.0-gcj- Test.java
> $ echo $DISPLAY
> :0
> $ /usr/lib/jvm/java-1.5.0-gcj- Test
> good
> $ unset DISPLAY
> $ /usr/lib/jvm/java-1.5.0-gcj- Test
> (.:31017): Gtk-WARNING **: cannot open display: 
> $ echo $?
> 1

Additional info:

> $ gdb --args /usr/lib/jvm/java-1.5.0-gcj- Test
> (gdb) b exit
> (gdb) r
> (.:30423): Gtk-WARNING **: cannot open display: 
> Breakpoint 1, __GI_exit (status=status@entry=1) at exit.c:99
> 99	  __run_exit_handlers (status, &__exit_funcs, true);
> (gdb) bt
> #0  __GI_exit (status=status@entry=1) at exit.c:99
> #1  0x0000003898f3fca3 in IA__gtk_init (argc=argc@entry=0x7fffffffde30, argv=argv@entry=0x7fffffffde38) at gtkmain.c:1048
> #2  0x00007ffff0ba74c0 in Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkInit (env=0x62c5c0, clazz=<optimized out>, portableNativeSync=-1, lock=<optimized out>) at ../../../../../../../libjava/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c:178
> #3  0x00000031f6df8509 in gnu.java.awt.peer.gtk.GtkToolkit.gtkInit(int, java.lang.Object)void () at /usr/src/debug/gcc-4.8.1-20130603/libjava/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java:198
> #4  0x00000031f6defdc8 in gnu.java.awt.peer.gtk.GtkToolkit.<clinit>()void () at /usr/src/debug/gcc-4.8.1-20130603/libjava/classpath/gnu/java/awt/peer/gtk/GtkToolkit.java:197
> #5  0x00000031f677f9bb in java::lang::Class::initializeClass (this=0x31f80ba520 <gnu::java::awt::peer::gtk::GtkToolkit::class$>) at ../../../libjava/java/lang/natClass.cc:791
> #6  0x00000031f677fc8e in _Jv_InitClass (klass=0x31f80ba520 <gnu::java::awt::peer::gtk::GtkToolkit::class$>) at ../../../libjava/java/lang/Class.h:742
> #7  java::lang::Class::forName (className=className@entry=0x7ffff1a58a80, initialize=initialize@entry=1 '\001', loader=0x7ffff1a5bf00) at ../../../libjava/java/lang/natClass.cc:111
> #8  0x00000031f6a464c0 in java.awt.Toolkit.getDefaultToolkit()java.awt.Toolkit () at /usr/src/debug/gcc-4.8.1-20130603/libjava/classpath/java/awt/Toolkit.java:583
> #9  0x00000031f6fa648c in ffi_call_unix64 () at ../../../libffi/src/x86/unix64.S:75
> #10 0x00000031f6fa5e64 in ffi_call (cif=0x7ffff179f3d0, fn=0x31f6a46410 <java.awt.Toolkit.getDefaultToolkit()java.awt.Toolkit>, rvalue=0x7fffffffe170, avalue=<optimized out>) at ../../../libffi/src/x86/ffi64.c:492
> #11 0x00000031f6fa2972 in ffi_java_raw_call (cif=0x7ffff179f3d0, fn=0x31f6a46410 <java.awt.Toolkit.getDefaultToolkit()java.awt.Toolkit>, rvalue=0x7fffffffe170, raw=<optimized out>) at ../../../libffi/src/java_raw_api.c:300
> #12 0x00000031f67627aa in _Jv_InterpMethod::run (retp=<optimized out>, args=<optimized out>, meth=0x7ffff180e460) at ../../../libjava/interpret-run.cc:613
> #13 0x00000031f6fa28e4 in ffi_java_translate_args (cif=0x7ffff0ef0060, rvalue=0x7fffffffe430, avalue=0x7fffffffe2a0, user_data=0x7ffff7fcb010) at ../../../libffi/src/java_raw_api.c:314
> #14 0x00000031f6fa627b in ffi_closure_unix64_inner (closure=0x7ffff7fcb010, rvalue=0x7fffffffe430, reg_args=0x7fffffffe380, argp=0x7fffffffe450 "\300\275\245\361\377\177") at ../../../libffi/src/x86/ffi64.c:637
> #15 0x00000031f6fa65f4 in ffi_closure_unix64 () at ../../../libffi/src/x86/unix64.S:228
> #16 0x00000031f67765c6 in gnu::java::lang::MainThread::call_main (this=this@entry=0x7ffff1a5bdc0) at ../../../libjava/gnu/java/lang/natMainThread.cc:54
> #17 0x00000031f67d7af5 in gnu.java.lang.MainThread.run()void (this=@7ffff1a5bdc0) at /usr/src/debug/gcc-4.8.1-20130603/libjava/gnu/java/lang/MainThread.java:106
> #18 0x00000031f6786b6b in _Jv_ThreadRun (thread=0x7ffff1a5bdc0) at ../../../libjava/java/lang/natThread.cc:335
> #19 0x00000031f6739981 in _Jv_RunMain (vm_args=vm_args@entry=0x7fffffffe530, klass=klass@entry=0x0, name=0x7fffffffe9a7 "Test", argc=argc@entry=1, argv=argv@entry=0x7fffffffe670, is_jar=is_jar@entry=false) at ../../../libjava/prims.cc:1790
> #20 0x00000031f8400d22 in main (argc=<optimized out>, argv=0x7fffffffe668) at ../../../libjava/gij.cc:333
> #21 0x00000031f3621b75 in __libc_start_main (main=0x400640 <main@plt>, argc=2, ubp_av=0x7fffffffe668, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe658) at libc-start.c:258
> #22 0x00000000004006a9 in _start ()
Comment 1 Fedora End Of Life 2015-01-09 14:49:42 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 2 Fedora End Of Life 2015-02-17 12:10:32 EST
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.