Community
Participate
Working Groups
The error output: [xcb] Unknown sequence number while processing queue [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called [xcb] Aborting, sorry about that. java: ../../src/xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed. Java Result: 134 It looks like XInitThreads is not called, but SWT and AWT call Xlib concurrently.
The reason for that is most probably that Swing GTK LnF loads gtk2 while SWT loads GTK3. To verify this is the case try starting with SWT_GTK3=0 env variable. Mixing the two gtk versions in the same process is a guarantee for disaster. This is a limitation on JVM side which can't be easily overcome (see http://openjdk.java.net/jeps/283 ) and staying on GTK2 by default is not an option for SWT as it means certain widgets not functioning anymore. Recomendation would be to not use the Swing GTK LnF if using the SWT_AWT bridge.
> The reason for that is most probably that Swing GTK LnF loads gtk2 while SWT loads GTK3. It is not the case. The issue happens after GTK lib has been initialized. The app works some time and dies on random UI action. The issue is reproducible with both GTK2 (SWT_GTK3=0) and GTK3. Also it is reproducible before and after JEP-283.
Can you provide snippet reproducing the issue? (In reply to Semyon Sadetsky from comment #2) > > The reason for that is most probably that Swing GTK LnF loads gtk2 while SWT loads GTK3. > > It is not the case. The issue happens after GTK lib has been initialized. > The app works some time and dies on random UI action. > > The issue is reproducible with both GTK2 (SWT_GTK3=0) and GTK3. Also it is > reproducible before and after JEP-283. Is JEP-283 available in some Java 9 build? Asking cause on Fedora 24 trying to set Swing GTK LnF I get the regular mixture errors/crash (SWT:5008): GLib-GObject-WARNING **: cannot register existing type 'GdkDisplayManager' (SWT:5008): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed
> Can you provide snippet reproducing the issue? public class SwingAppTest { public static void main(String[] args) throws Exception { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); } catch (Exception e) { e.printStackTrace(); } } }); Thread.sleep(2000); Thread thread = new Thread() { @Override public void run() { Display display; Shell shell; org.eclipse.swt.widgets.Button swtButton; Composite composite; Frame frame; JTabbedPane tabbedPane; display = new Display(); shell = new Shell(display); shell.setText("AWT Test"); org.eclipse.swt.layout.GridLayout gridlayout = new org.eclipse.swt.layout.GridLayout(); shell.setLayout(gridlayout); swtButton = new org.eclipse.swt.widgets.Button(shell, SWT.PUSH); swtButton.setText("SWTButton"); composite = new Composite(shell, SWT.EMBEDDED); composite.setLayoutData(new GridData(GridData.FILL_VERTICAL | GridData.FILL_HORIZONTAL)); composite.setBackground(display.getSystemColor(SWT.COLOR_WHITE)); frame = SWT_AWT.new_Frame(composite); frame.setLayout(new java.awt.BorderLayout()); Panel panel = new Panel(); panel.setLayout(new java.awt.BorderLayout()); tabbedPane = new JTabbedPane(JTabbedPane.TOP); tabbedPane.add("InternalFrame Test", new DesktopPanePanel()); tabbedPane.add("SplitPane Test", new SplitPanePanel()); panel.add(tabbedPane); frame.add(panel); shell.setLocation(10, 10); shell.setSize(600, 600); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } } }; thread.start(); thread.join(); } } Please note: You may need several attempts to make this UI running. Then do several action in the embedded Swing UI. JEP-283 is available from JDK9 build 120. But you don't need JDK9. The bug is filed against JDK8.
Can you still reproduce this one with Java 11 and SWT 4.10 ?
(In reply to Alexander Kurtakov from comment #5) > Can you still reproduce this one with Java 11 and SWT 4.10 ? Ping, any update?
I've started getting similar crashes on Eclipse launch after upgrading to 4.16.0.v20200604-0540 today on Kubuntu 20.04. It was just freezing at first and I started launching it from CLI. At first I didn't notice anything but then there was an X Error: $ eclipse (Eclipse:732750): Gdk-ERROR **: 03:09:29.937: The program 'Eclipse' received an X Window System error. This probably reflects a bug in the program. The error was 'BadLength (poly request too large or internal Xlib length erro'. (Details: serial 7808 error_code 16 request_code 139 (RENDER) minor_code 33) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the GDK_SYNCHRONIZE environment variable to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.) $ GDK_SYNCHRONIZE=1 eclipse [xcb] Unknown sequence number while processing reply [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called [xcb] Aborting, sorry about that. java: ../../src/xcb_io.c:641: _XReply: Не пройдено перевірку «!xcb_xlib_threads_sequence_lost».
This seems related: https://bugs.eclipse.org/bugs/show_bug.cgi?id=454708
Today it no longer crashes. Maybe it was something in other packages.
Marking as resolved as the original reporter didn't reply and latest one no longer face the issue.
Looks like related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=568859