Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#3,556 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
java
領域
desktop

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
Java
スター
202
フォーク
206
平均マージ
16時間 56分
マージ済み PR(30日)
110

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

eclipse-platform/eclipse.platform.swt のほかの issue

eclipse-platform/eclipse.platform.swt の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。