Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[GTK3] Gdk-CRITICAL from gdk_threads_set_lock_functions when a second Display is created in the same JVM

Aperta
#3,556 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
java
Ambito
desktop

Direzione di ricerca

Start with the GTK3 Display initialization path and the call to gdk_threads_set_lock_functions() described in the issue. Reproduce the two-Display snippet on Linux/GTK3, then verify that creating and disposing a second Display no longer emits the Gdk-CRITICAL on stderr.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

On Linux/GTK3, SWT emits a Gdk-CRITICAL from gdk_threads_set_lock_functions:

(SWT:1664323): Gdk-CRITICAL **: 15:19:27.874: gdk_threads_set_lock_functions: assertion 'gdk_threads_lock == NULL && gdk_threads_unlock == NULL' failed

gdk_threads_set_lock_functions() has been deprecated since GTK 3.6, and its
implementation asserts that the lock functions have not already been installed. The
assertion therefore fails on any call after the first one in a process. This appears
to happen whenever a second Display is created in the same JVM.

Nothing fails as a result — the tests pass and the process does not crash — but the
CRITICAL is emitted on stderr on every affected run, which makes it noise in build
logs where a real GTK CRITICAL would matter.

Seen while running Tycho UI tests (org.eclipse.tycho.surefire.osgibooter.uitest),
where an Equinox workbench is provisioned per test module. The display is a normal
Xorg X11 session, not Xvfb and not headless.

To Reproduce

Run this on Linux/GTK3:

import org.eclipse.swt.widgets.Display;

public class Snippet {
    public static void main(String[] args) {
        Display d1 = new Display();
        d1.dispose();
        Display d2 = new Display();   // Gdk-CRITICAL is emitted here
        d2.dispose();
    }
}

Expected behavior

Creating a second Display in the same process should not emit a GTK CRITICAL. SWT
should either not call the deprecated gdk_threads_set_lock_functions() at all, or
call it only once per process.

Screenshots

Not applicable — the symptom is stderr output.

Environment:

  1. Select the platform(s) on which the behavior is seen:
    • All OS
    • Windows
    • Linux
    • macOS
  1. Additional OS info (e.g. OS version, Linux Desktop, etc)

    Ubuntu 24.04.4 LTS, aarch64, kernel 6.17.0-1031-nvidia.
    GTK 3.24.41-4ubuntu1.3 (libgtk-3-0t64:arm64). No GTK4 package installed and
    SWT_GTK4 is unset, so this is the GTK3 binding.
    Real X session: XDG_SESSION_TYPE=x11, Xorg on vt2 under gdm, DISPLAY=:0.
    Not headless, not Xvfb, not Xwayland.
    NVIDIA GPU present (PCI 10de:2e12).

  2. JRE/JDK version

    Eclipse Temurin 25.0.4.1+1 (OpenJDK 25.0.4.1 LTS), aarch64

Version since

Unknown. First observed with org.eclipse.swt.gtk.linux.aarch64 3.135.0 on the
Eclipse 2026-09 RC1 (4.41) target platform. Not checked against earlier versions,
so this is first-observed rather than a regression point.

Workaround (or) Additional context

No workaround known; the message is diagnostic only and nothing observable fails.

This is a pre-release target platform (2026-09 RC1), not a final release build.
SWT bundle qualifier:

Two further messages appear in the same runs. They are noted here only so they are
not mistaken for part of this issue:

  • (SWT:1664323): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -1 and height -1 — a separate SWT/GTK issue, not reported here.
  • pci id for fd 232: 10de:2e12, driver (null) — Mesa probing DRM file descriptors
    for an NVIDIA device it has no driver mapping for. Not SWT.
Lingua principale
Java
Stelle
202
Fork
206
Merge medio
14h 7m
PR unite (30g)
103

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-platform/eclipse.platform.swt

Tutte le issue di eclipse-platform/eclipse.platform.swt

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.