[Bug]: Linux startup crash when Mesa's GLX is forced (static libstdc++ in libskiko)

オープン 初心者向け
#8,372 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
91/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java, kotlin, linux

調査の方向性

apps/multiplatform/build.gradle.kts から始め、skiko-awt-runtime-linux-x64 の依存関係解決を確認します。Issue で提案されたバージョンの上書きを適用し、skiko-awt は 0.9.24 のままにしてから、該当するディストリビューションをビルドします。完了の基準は、Linux アプリが __GLX_VENDOR_LIBRARY_NAME=mesa 付きで起動し、ロケールによる中断や SkSL の失敗が発生しないことです。

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

説明

bug triage
Is there an existing issue for this?
  • I have searched the existing issues
Platform

Linux

OS version

Fedora 44, KDE Plasma 6 Wayland. Hybrid GPU: AMD Radeon 680M and NVIDIA RTX 3050 (driver 620.73.04). Mesa 26.2.7, glibc 2.43.

App version

7.1.4 AppImage, 7.1.5 AppImage, 7.1.5 Flatpak.

Current Behavior

The app aborts during startup when the session prefers Mesa's GLX vendor. Hybrid laptops use this to keep the dGPU powered down:

export __GLX_VENDOR_LIBRARY_NAME=mesa
  • 7.1.4 AppImage (skiko 0.9.4.2): free(): invalid size, SIGABRT.
  • 7.1.5 AppImage and Flatpak (skiko 0.9.24): 129 SkSL compiler errors, then SkSLModuleLoader.cpp:157: fatal error: "Unable to load module sksl_shared".

Without the variable, or with __GLX_VENDOR_LIBRARY_NAME=nvidia, both versions start.

Expected Behavior

The app starts with Mesa's GLX vendor pinned.

Steps To Reproduce
  1. On a hybrid GPU system, set __GLX_VENDOR_LIBRARY_NAME=mesa in the session, for example in ~/.config/environment.d/50-battery-gpu.conf.
  2. Start the 7.1.4 or 7.1.5 AppImage, or the 7.1.5 Flatpak.
  3. The process aborts before the main window is usable.
  4. Workarounds that start it: LD_PRELOAD=/usr/lib64/libstdc++.so.6 <app>, or unset the variable, or set it to nvidia.
Relevant log output

7.1.4 AppImage:

free(): invalid size
...
#4  malloc_printerr
#5  malloc_printerr_tail
#6  std::locale::_Impl::_M_install_facet(...)
#7  std::locale::_Impl::_Impl(unsigned long)
#8  std::locale::_S_initialize_once()
#13 std::ios_base::Init::Init()
#14 _GLOBAL__sub_I_StdVectorDecoder.cc
#21 _dl_open(.../libskiko-linux-x64.so)

7.1.5 AppImage and Flatpak:

error: 1: floating-point value is too large: 1.
...3 b;a.yz*=.01;if(a.y+a.z>=1.)b=(a.y/(a.y+a.z)).xxx;else{b=$css_hsl_to_srgb(half3(a.x,100.,50.));b*=(1.-a.y)-a.z;b+=a.y;}return b;}
129 errors

../../src/sksl/SkSLModuleLoader.cpp:157: fatal error: "Unable to load module sksl_shared"
Root cause

libskiko-linux-x64.so in 0.9.4.2 and 0.9.24 statically links libstdc++ and exports its symbols. readelf -d has no NEEDED libstdc++.so.6 entry.

With __GLX_VENDOR_LIBRARY_NAME=mesa, glvnd loads Mesa's GLX stack before libskiko:

calling init: /lib64/libstdc++.so.6
calling init: /lib64/libLLVM.so.22.1
calling init: /lib64/libgallium-26.2.7.so
calling init: /lib64/libGLX_mesa.so.0
calling init: .../libskiko-linux-x64.so

The gdb trace shows locale ids coming from both copies. The crashing call uses std::numpunct<char>::id from libskiko at index 33. The classic locale's facet arrays are static storage, created with placement new in libstdc++-v3/src/c++11/locale_init.cc:495-496. _M_install_facet in libstdc++-v3/src/c++98/locale.cc:364-365 grows the array and calls delete[] on the static facet_vec and cache_vec, which glibc rejects.

0.9.24 no longer aborts at that delete[], but the same mixed runtime produces the SkSL failure above.

Upstream fix

skiko fixed the root cause by linking libstdc++ dynamically on Linux:

97472ddee061581089bd073c83e5299159e40522 2025-11-24
Link libstdc++ dynamically on linux

https://github.com/JetBrains/skiko/pull/1133
https://github.com/JetBrains/skiko/commit/97472ddee061581089bd073c83e5299159e40522

First tags: v0.9.37.1, v0.9.37.3, v0.9.37.4. The 0.9.37.4 native library has NEEDED libstdc++.so.6; the 0.9.24 library does not.

SimpleX 7.1.5 pins skiko 0.9.24, which predates the fix. A full bump to 0.9.37.4 breaks Compose 1.8.2 (NoSuchMethodError: SkiaLayerProperties.<init>). The native library alone is compatible: keeping the app's 0.9.24 Java jar and replacing only libskiko-linux-x64.so with the 0.9.37.4 native library starts both 7.1.4 and 7.1.5 with the Mesa variable, in a 10 second startup test.

Suggested change in apps/multiplatform/build.gradle.kts: force only skiko-awt-runtime-linux-x64 to 0.9.37.4, and keep skiko-awt at 0.9.24 for the font fix from https://github.com/simplex-chat/simplex-chat/pull/8288.

if (requested.name == "skiko-awt-runtime-linux-x64" &&
    (requested.version == "0.9.4.2" || requested.version == "0.9.24")) {
    useVersion("0.9.37.4")
}

The AppImage packager can do the same by copying the 0.9.37.4 libskiko-linux-x64.so over the one from createDistributable. The Flatpak extracts the same AppImage, so it inherits the fix.

Related

They are the bitmap PCF font crash in SkTypeface_fontconfig::onOpenStream, fixed by https://github.com/simplex-chat/simplex-chat/pull/8288. That is a different stack from this report.

Minor

On KDE, com.jthemedetecor.GnomeThemeDetector throws at line 119 because the gsettings output is empty. It is harmless and appears in successful runs too.

Exception in thread "GTK Theme Detector Thread" java.lang.NullPointerException: Cannot invoke "String.split(String)" because "readLine" is null
	at com.jthemedetecor.GnomeThemeDetector$DetectorThread.run(GnomeThemeDetector.java:119)
rc=124
主要言語
Haskell
スター
19.8k
フォーク
1.3k
平均マージ
1日 6時間
マージ済み PR(30日)
233

環境構築

はじめの一歩

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

simplex-chat/simplex-chat のほかの issue

simplex-chat/simplex-chat の issue をすべて見る

似ている issue

Haskell の issue をもっと見る

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

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