Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915695 - dev-qt/qtdeclarative-6.6.0 may fail with sandbox under unknown conditions when using qsb (FAILED: src/quick/.qsb/<snip>)
Summary: dev-qt/qtdeclarative-6.6.0 may fail with sandbox under unknown conditions whe...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-13 17:14 UTC by he.ousia
Modified: 2024-01-27 10:47 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
full build log (buildlog.txt,54.07 KB, text/plain)
2023-10-13 17:16 UTC, he.ousia
Details
no-silent.patch (no-silent.patch,197 bytes, patch)
2023-10-13 18:44 UTC, Ionen Wolkens
Details | Diff
j=1, nosilent build log (nosilent.build.log.txt,70.64 KB, text/plain)
2023-10-13 19:42 UTC, he.ousia
Details
core dump of "sandbox qsb args" (core.gz,27.58 KB, application/gzip)
2023-10-18 21:17 UTC, he.ousia
Details
qmake crash (qmake.txt,7.16 KB, text/plain)
2023-10-19 19:29 UTC, vowstar
Details
qsb crash (qsb.txt,4.11 KB, text/plain)
2023-10-19 19:35 UTC, vowstar
Details
qsb strace (qsb_strace.txt,72.06 KB, text/plain)
2023-10-19 19:39 UTC, vowstar
Details
patch for dev-qt/qtbase-6.6.0 (qtbase-6.6.0-fix-vfork-stack.patch,925 bytes, patch)
2023-10-20 05:20 UTC, vowstar
Details | Diff
patch for dev-qt/qtbase-6.6.0 (0001-forkfd_linux-change-childStack-size-from-4096-to-SIG.patch,1.56 KB, patch)
2023-10-20 17:55 UTC, vowstar
Details | Diff
patch for dev-qt/qtbase-6.6.0 (0001-forkfd_linux-change-childStack-size-from-4096-to-SIG.patch,1.43 KB, patch)
2023-10-20 19:42 UTC, vowstar
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description he.ousia 2023-10-13 17:14:53 UTC
FAILED: src/quick/.qsb/scenegraph/shaders_ng/32bitcolortext.frag.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/32bitcolortext.frag.qsb 
cd /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick && /usr/lib64/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/32bitcolortext.frag.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/shaders_ng/32bitcolortext.frag

and so on.

Portage 3.0.52 (python 3.11.6-final-0, default/linux/amd64/17.1/no-multilib, gcc-13, glibc-2.38-r5, 6.5.5-gentoo x86_64)
=================================================================
System uname: Linux-6.5.5-gentoo-x86_64-AMD_Ryzen_9_7950X_16-Core_Processor-with-glibc2.38
KiB Mem:   131626760 total,   6687528 free
KiB Swap:  268435452 total, 268435452 free
Timestamp of repository gentoo: Fri, 13 Oct 2023 16:00:01 +0000
Head commit of repository gentoo: 3193d129abe64fee4b87ac4ceafb46fe3ef45f0f
sh bash 5.2_p15-r7
ld GNU ld (Gentoo 2.41 p2) 2.41.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p15-r7::gentoo
dev-java/java-config:      2.3.1-r1::gentoo
dev-lang/perl:             5.38.0-r1::gentoo
dev-lang/python:           3.11.6::gentoo, 3.12.0::gentoo
dev-lang/rust:             1.73.0::gentoo
dev-util/cmake:            3.27.7::gentoo
dev-util/meson:            1.2.2-r1::gentoo
sys-apps/baselayout:       2.14::gentoo
sys-apps/openrc:           0.51::gentoo
sys-apps/sandbox:          2.38::gentoo
sys-devel/autoconf:        2.13-r8::gentoo, 2.71-r7::gentoo
sys-devel/automake:        1.16.5-r1::gentoo
sys-devel/binutils:        2.40-r7::gentoo, 2.41-r2::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           15.0.7-r3::gentoo, 16.0.6::gentoo, 17.0.2::gentoo
sys-devel/gcc:             13.2.1_p20230826::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             15.0.7::gentoo, 16.0.6::gentoo, 17.0.2::gentoo
sys-devel/llvm:            15.0.7-r3::gentoo, 16.0.6::gentoo, 17.0.2-r1::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.5-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.38-r5::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 16
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes

ACCEPT_KEYWORDS="amd64 ~*"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=znver4 -O2 -pipe  -flto"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=znver4 -O2 -pipe  -flto"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.vectranet.pl/gentoo/     http://mirror.leaseweb.com/gentoo/     http://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo/     http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/     http://mirror.netcologne.de/gentoo/     http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/     http://ftp.belnet.be/pub/rsync.gentoo.org/gentoo/     http://mirror.init7.net/gentoo/     http://tux.rainside.sk/gentoo/     http://gentoo.mirror.web4u.cz/"
LANG="en_US"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j30"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac aacs acl alsa amd64 bittorrent bluray btrfs bzip2 cli connection-sharing context contrib contribdnn crypt cups cxx dbus dcaenc dhcpcd dri dts emboss exif extra fam fbcon fdk ffmpeg fontconfig fortran frei0r ftp gdbm geoclue geolocation gimp gps graphite gui iconv icu iptables jpeg kde lame lapack latex libass libglvnd libtirpc llvm lm-sensors lto mac minizip mpi ncurses no-multilib nptl nvenc ogg opencl opengl openmp opus pam parallel-compiler pcre plasma pthread pulseaudio qml qt5 qt6 readline resolvconf romio rustfmt sdl seccomp spirv split-usr ssd ssl svg syslog taglib tbb tensorpipe test-rust text theora threads tiff tools truetype unicode v4l vaapi vector-icons vorbis vulkan webp x264 x265 xattr xla xml zlib" ABI_X86="64" ADA_TARGET="gnat_2021" AMDGPU_TARGETS="gfx1031" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="stage" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer nlpsolver" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby32" VIDEO_CARDS="amdgpu fbdev amd radeon radeonsi vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 he.ousia 2023-10-13 17:16:33 UTC
Created attachment 872724 [details]
full build log
Comment 2 Ionen Wolkens gentoo-dev 2023-10-13 18:44:19 UTC
Created attachment 872728 [details, diff]
no-silent.patch

Can't reproduce and I don't really have ideas given it says nothing about why it failed.

Could you try to rebuild with the attached patch? This is not a fix, but it removes the -s flag (silent) and "perhaps" it'll tell us what happened. May possibly have errors about spirv-opt being not found, but that shouldn't be the cause (it's optional), Qt added -s to silence that. Anything else would be suspicious though.

Could also try with a lower MAKEOPTS -j, at -j30 I wouldn't be surprised if it hits some rare race condition not that I've been able to have it fail that way.
Comment 3 he.ousia 2023-10-13 19:42:57 UTC
Created attachment 872729 [details]
j=1, nosilent build log
Comment 4 Ionen Wolkens gentoo-dev 2023-10-13 21:20:02 UTC
Thanks, unfortunately it still doesn't say why qsb is failing (that's from dev-qt/qtshadertools). The .frag/.vert files themselves haven't changed since 2021, so if there's an issue it's "probably" in qtshadertools.

It's not completely broken right? `/usr/lib64/qt6/bin/qsb --version` should return "qsb 6.6.0".

If not, then no idea what may be going on, nor anything else to suggest at the moment.
Comment 5 he.ousia 2023-10-13 21:42:25 UTC
Running directly ninja from build directory succeeds, and then the package installs ok using the ebuild commands. Evidently there is some problem with my portage system.
Comment 6 Ionen Wolkens gentoo-dev 2023-10-13 21:52:05 UTC
Maybe a sandbox thing then.

Does it build with FEATURES="-sandbox -usersandbox", if still doesn't could try FEATURES="-ipc-sandbox -pid-sandbox" too I guess.

Albeit if it is I wonder why I don't run into it and why there's no sandbox errors.
Comment 7 Ionen Wolkens gentoo-dev 2023-10-13 21:58:51 UTC
(In reply to Ionen Wolkens from comment #6)
> Maybe a sandbox thing then.
> 
> Does it build with FEATURES="-sandbox -usersandbox", if still doesn't could
> try FEATURES="-ipc-sandbox -pid-sandbox" too I guess.
If both still fail, could try letting run as root too (FEATURES="-sandbox -userpriv -usersandbox), reminds me of unsolved bug #913493 comment #5 where qmake6 was strangely acting up with sandbox. qsb being a qt tool as well could have the same problem.
Comment 8 he.ousia 2023-10-13 22:10:09 UTC
With FEATURES="-sandbox -usersandbox" it builds OK.
Comment 9 he.ousia 2023-10-13 22:15:24 UTC
(In reply to Ionen Wolkens from comment #7)
I always do all emerge operations as root.
Comment 10 Ionen Wolkens gentoo-dev 2023-10-13 22:35:20 UTC
(In reply to he.ousia from comment #9)
> (In reply to Ionen Wolkens from comment #7)
> I always do all emerge operations as root.
FEATURES="userpriv" makes the compilation phase run as the portage user regardless of what you ran emerge as.
Comment 11 Ionen Wolkens gentoo-dev 2023-10-13 22:41:23 UTC
(In reply to he.ousia from comment #8)
> With FEATURES="-sandbox -usersandbox" it builds OK.
Well, guess it can be a workaround until this is figured out.

I do assume it's related to bug #908809 and bug #913493 (except it was qmake rather than qsb).
Comment 12 he.ousia 2023-10-16 17:37:53 UTC
Found a host of qsb segfaults in a syslog. So it is a real culprit.
a) then how it is that sandbox trick does work?
b) what is wrong with qtshadertools?
Comment 13 Ionen Wolkens gentoo-dev 2023-10-16 20:37:24 UTC
I'm not the expert on sandbox, but it uses LD_PRELOAD to wrap calls qsb does which could potentially result in unexpected behaviour and making things crash.

Like if qsb only does minimal error checking (aka things that under normal conditions without sandbox do not fail, and then it continues while expecting that it worked then segfaults). Debug symbols and a backtrace could potentially reveal more.
Comment 14 Manuel Nickschas 2023-10-17 07:48:51 UTC
FWIW, I am seeing exactly the same issue on only one of my four Gentoo machines that pretty much run the same configuration and USE flags. I also have segfaults from qsb in the logs. The machine has an Intel Xeon, so I guess a hardware-specific issue is to be ruled out...
Comment 15 he.ousia 2023-10-17 15:55:43 UTC
I've compiled qsb + its library with -g but have no clue how to extract the debug info during emerge process. Syslog shows nothing interesting:
Oct 17 00:47:37 [kernel] [1321881.325768] qsb[4882]: segfault at 7ffd92fcf1a8 ip 00007ffd92fcf1a8 sp 00007ffd92fcf0f0 error 15 likely on CPU 31 (core 15, socket 0)
Oct 17 00:47:37 [kernel] [1321881.325772] Code: 00 00 8f 00 00 00 00 00 00 00 c0 11 ab 40 91 7f 00 00 78 d4 fe 40 91 7f 00 00 ce fe de 40 91 7f 00 00 00 00 00 00 00 00 00 00 <00> 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 68 95 5d 42 91 7f
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-17 16:28:16 UTC
I would suggest trying to run the crashing command manually outside of portage, but prefix it with 'sandbox ...' to run it under there. Then try gdb to step through.
Comment 17 he.ousia 2023-10-17 18:19:13 UTC
Sorry, I do not know how to work with gdb.

qsb crashes gladly in sandbox:

t ~ # sandbox /usr/lib64/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert
Sandboxed process killed by signal: Segmentation fault

but in gdb it kind of runs:

gdb  sandbox --args /usr/lib64/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert
GNU gdb (Gentoo 13.2 vanilla) 13.2
---------------------------------------------snip
Reading symbols from /usr/lib64/qt6/bin/qsb...
(gdb) run
Starting program: /usr/lib64/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[Detaching after vfork from child process 28017]
[Detaching after vfork from child process 28018]
[Inferior 1 (process 28016) exited normally]
Comment 18 he.ousia 2023-10-18 21:17:14 UTC
Created attachment 873111 [details]
core dump of "sandbox qsb args"
Comment 19 vowstar 2023-10-19 16:52:10 UTC
Same issue for me.

[ 9090.185549] qsb[567219]: segfault at 7ffd232e5e28 ip 00007ffd232e5e28 sp 00007ffd232e5d70 error 15 likely on CPU 7 (core 3, socket 0)
[ 9090.185564] Code: 00 00 f8 28 48 63 4b 7f 00 00 00 a0 65 63 4b 7f 00 00 00 61 69 6e 00 00 00 00 00 00 00 00 00 00 00 00 38 5e 2e 23 00 00 00 00 <00> 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 70 d4 2d 65 4b 7f
[10481.175952] qsb[573504]: segfault at 7fffbe73d768 ip 00007fffbe73d768 sp 00007fffbe73d6b0 error 15 likely on CPU 13 (core 6, socket 0)
[10481.175967] Code: 00 00 f8 08 02 88 26 7f 00 00 00 80 1f 88 26 7f 00 00 00 61 69 6e 00 00 00 00 00 00 00 00 00 00 00 00 78 d7 73 be 00 00 00 00 <00> 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 70 b4 e7 89 26 7f
[10481.202488] qsb[573506]: segfault at 7ffe6a5b96a8 ip 00007ffe6a5b96a8 sp 00007ffe6a5b95f0 error 15 likely on CPU 5 (core 2, socket 0)
[10481.202501] Code: 00 00 f8 e8 7d ac 31 7f 00 00 00 60 9b ac 31 7f 00 00 00 61 69 6e 00 00 00 00 00 00 00 00 00 00 00 00 b8 96 5b 6a 00 00 00 00 <00> 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 70 94 63 ae 31 7f

CPU: AMD Ryzen 9 PRO 7940HS w/ Radeon 780M Graphics (16) @ 5.583GHz
Comment 20 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-19 17:46:10 UTC
(In reply to he.ousia from comment #18)
> Created attachment 873111 [details]
> core dump of "sandbox qsb args"

If you load it in gdb, then run 'bt', what do you get?
Comment 21 vowstar 2023-10-19 18:08:29 UTC
Not only qsb, but also qmake6 crash.
QT 6.5.3 works with sandbox.
QT 6.6.0 crash with sandbox.

[13202.157418] qsb[623005]: segfault at 7ffc7240b668 ip 00007ffc7240b668 sp 00007ffc7240b5b0 error 15 likely on CPU 14 (core 7, socket 0)
[13202.157426]  likely on CPU 8 (core 4, socket 0)
[13202.157429] Code: 00 00 90 00 00 00 00 00 00 00 90 a2 f2 c2 a0 7f 00 00 80 44 45 c3 a0 7f 00 00 98 8f 26 c3 a0 7f 00 00 00 00 00 00 00 00 00 00 <00> 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 70 04 83 c4 a0 7f
[13202.157431] Code: 00 00 90 00 00 00 00 00 00 00 90 92 ce 4b 7a 7f 00 00 80 34 21 4c 7a 7f 00 00 98 7f 02 4c 7a 7f 00 00 00 00 00 00 00 00 00 00 <00> 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 70 f4 5e 4d 7a 7f
[13821.623309] qmake[631528]: segfault at 7ffd9f4f7068 ip 00007ffd9f4f7068 sp 00007ffd9f4f6fb0 error 15 likely on CPU 0 (core 0, socket 0)
[13821.623319] Code: 00 00 f8 18 71 b4 23 7f 00 00 b0 b0 1b b5 23 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <00> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 70 a4 1b b5 23 7f


- qmake

In sandbox:

gdb --args qmake6 Kactus2.pro
GNU gdb (Gentoo 13.2 vanilla) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from qmake6...
(No debugging symbols found in qmake6)
(gdb) run
Starting program: /usr/bin/qmake6 Kactus2.pro
 * ACCESS DENIED:  open_wr:            /proc/self/mem
warning: opening /proc/self/mem file failed: Permission denied (13)
 * ACCESS DENIED:  open_wr:            /proc/639163/task/639163/mem
warning: opening /proc/PID/mem file for lwp 639163.639163 failed: Permission denied (13)
 * ACCESS DENIED:  mkdir:              /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/__pycache__
 * ACCESS DENIED:  mkdir:              /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
 * ACCESS DENIED:  mkdir:              /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
 * ACCESS DENIED:  mkdir:              /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
 * ACCESS DENIED:  mkdir:              /usr/share/glib-2.0/gdb/__pycache__
 * ACCESS DENIED:  open_wr:            /proc/639166/task/639166/mem
warning: opening /proc/PID/mem file for lwp 639166.639166 failed: Permission denied (13)
[Detaching after vfork from child process 639166]

Program received signal SIGSEGV, Segmentation fault.
0x00007fffffff9e68 in ?? ()
(gdb) bt
#0  0x00007fffffff9e68 in ?? ()
#1  0x00007fffffff9e64 in ?? ()
#2  0x00007ffff7d180e6 in ?? () from /usr/lib64/qt6/bin/../../libQt6Core.so.6
#3  0x00007ffff7d18a16 in ?? () from /usr/lib64/qt6/bin/../../libQt6Core.so.6
#4  0x00007ffff7cff57a in ?? () from /usr/lib64/qt6/bin/../../libQt6Core.so.6
#5  0x00005555556898ce in ?? ()
#6  0x000055555568d3aa in ?? ()
#7  0x00005555556925a0 in ?? ()
#8  0x00005555556a3f7e in ?? ()
#9  0x00005555556a428f in ?? ()
#10 0x00005555556a4da6 in ?? ()
#11 0x00005555556a51fa in ?? ()
#12 0x00005555556a2076 in ?? ()
#13 0x00005555556a6c21 in ?? ()
#14 0x00005555556a7617 in ?? ()
#15 0x00005555556a90c9 in ?? ()
#16 0x00005555556a750e in ?? ()
#17 0x00005555556a7617 in ?? ()
#18 0x00005555556c12eb in ?? ()
#19 0x00005555556b81fc in ?? ()
#20 0x0000555555564d03 in ?? ()
#21 0x00007ffff7536f0a in ?? () from /lib64/libc.so.6
#22 0x00007ffff7536fc5 in __libc_start_main () from /lib64/libc.so.6
--Type <RET> for more, q to quit, c to continue without paging--


qsb

In sandbox:

gdb --args /usr/lib64/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert
GNU gdb (Gentoo 13.2 vanilla) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib64/qt6/bin/qsb...
(No debugging symbols found in /usr/lib64/qt6/bin/qsb)
(gdb) run
Starting program: /usr/lib64/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert
 * ACCESS DENIED:  open_wr:            /proc/self/mem
warning: opening /proc/self/mem file failed: Permission denied (13)
 * ACCESS DENIED:  open_wr:            /proc/645208/task/645208/mem
warning: opening /proc/PID/mem file for lwp 645208.645208 failed: Permission denied (13)
 * ACCESS DENIED:  mkdir:              /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/__pycache__
 * ACCESS DENIED:  mkdir:              /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
 * ACCESS DENIED:  mkdir:              /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
 * ACCESS DENIED:  mkdir:              /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
 * ACCESS DENIED:  mkdir:              /usr/share/glib-2.0/gdb/__pycache__
 * ACCESS DENIED:  open_wr:            /proc/645211/task/645211/mem
warning: opening /proc/PID/mem file for lwp 645211.645211 failed: Permission denied (13)
[Detaching after vfork from child process 645211]

Program received signal SIGSEGV, Segmentation fault.
0x00007fffffffac68 in ?? ()
(gdb) bt
#0  0x00007fffffffac68 in ?? ()
#1  0x00007fffffffac64 in ?? ()
#2  0x00007ffff69680e6 in ?? () from /usr/lib64/qt6/bin/../../libQt6Core.so.6
#3  0x00007ffff6968a16 in ?? () from /usr/lib64/qt6/bin/../../libQt6Core.so.6
#4  0x00007ffff694f57a in ?? () from /usr/lib64/qt6/bin/../../libQt6Core.so.6
#5  0x000055555555ee41 in ?? ()
#6  0x000055555555c0cc in ?? ()
#7  0x00007ffff6184f0a in ?? () from /lib64/libc.so.6
#8  0x00007ffff6184fc5 in __libc_start_main () from /lib64/libc.so.6
#9  0x000055555555d191 in ?? ()
(gdb)
Comment 22 vowstar 2023-10-19 18:12:50 UTC
Message with sandbox exit:

exit
Cleaning up sandbox process
============================= Gentoo path sandbox ==============================
The protected environment has been shut down.
 * ----------------------- SANDBOX ACCESS VIOLATION SUMMARY -----------------------
 * LOG FILE: "/var/log/sandbox/sandbox-645021.log"
 * 
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /proc/self/mem
A: /proc/self/mem
R: /proc/645190/mem
C: gdb --args /usr/lib64/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert 

F: open_wr
S: deny
P: /proc/645208/task/645208/mem
A: /proc/645208/task/645208/mem
R: /proc/645208/task/645208/mem
C: gdb --args /usr/lib64/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert 
F: mkdir
S: deny
P: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/__pycache__
A: /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/__pycache__
R: /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/__pycache__
C: gdb --args /usr/lib64/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert 

F: mkdir
S: deny
P: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
A: /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
R: /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
C: gdb --args /usr/lib64/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert 

F: mkdir
S: deny
P: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
A: /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
R: /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
C: gdb --args /usr/lib64/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert 

F: mkdir
S: deny
P: /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
A: /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
R: /usr/share/gcc-data/x86_64-pc-linux-gnu/13/python/libstdcxx/v6/__pycache__
C: gdb --args /usr/lib64/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert 

F: mkdir
S: deny
P: /usr/share/glib-2.0/gdb/__pycache__
A: /usr/share/glib-2.0/gdb/__pycache__
R: /usr/share/glib-2.0/gdb/__pycache__
C: gdb --args /usr/lib64/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert 

F: open_wr
S: deny
P: /proc/645211/task/645211/mem
A: /proc/645211/task/645211/mem
R: /proc/645211/task/645211/mem
C: gdb --args /usr/lib64/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0_build/src/quick/.qsb/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert.qsb /var/tmp/portage/dev-qt/qtdeclarative-6.6.0/work/qtdeclarative-everywhere-src-6.6.0/src/quick/scenegraph/shaders_ng/loqsubpixeldistancefieldtext.vert 
 * --------------------------------------------------------------------------------
Comment 23 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-19 18:15:49 UTC
vowstar, was your qtcore etc built with debugging symbols (https://wiki.gentoo.org/wiki/Debugging#Per-package)? if not, please do that.

(also, please use attachments for big pastes, to help keep things readable)
Comment 24 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-19 18:15:58 UTC
+ glibc pls
Comment 25 vowstar 2023-10-19 19:29:59 UTC
Created attachment 873163 [details]
qmake crash

Thanks for your patient guidance, I have learned how to add debug symbols.

This attachment is qmake crash gdb bt with symbol.
Comment 26 vowstar 2023-10-19 19:35:13 UTC
Created attachment 873164 [details]
qsb crash

This attachment is qsb crash gdb bt with symbol.
Comment 27 vowstar 2023-10-19 19:39:19 UTC
Created attachment 873165 [details]
qsb strace

This attachment is strace of qsb in sandbox
Comment 28 Mike Gilbert gentoo-dev 2023-10-19 19:48:09 UTC
A segfault after a vfork probably indicates that the child process is corrupting the stack of the parent.

Maybe the child stack is too small?

https://github.com/qt/qtbase/blob/dev/src/3rdparty/forkfd/forkfd_linux.c#L160
Comment 29 vowstar 2023-10-20 05:20:52 UTC
Created attachment 873170 [details, diff]
patch for dev-qt/qtbase-6.6.0

(In reply to Mike Gilbert from comment #28)
> A segfault after a vfork probably indicates that the child process is
> corrupting the stack of the parent.
> 
> Maybe the child stack is too small?
> 
> https://github.com/qt/qtbase/blob/dev/src/3rdparty/forkfd/forkfd_linux.c#L160

Thank you so much. This may be the root cause.

After I changed childStack[4096] to childStack[8192], both qsb and qmake can work normally.

I made a patch qtbase-6.6.0-fix-vfork-stack.patch, after applied to /etc/portage/patches/dev-qt/qtbase-6.6.0, this problem fixed.
Comment 31 vowstar 2023-10-20 17:55:08 UTC
Created attachment 873173 [details, diff]
patch for dev-qt/qtbase-6.6.0
Comment 32 vowstar 2023-10-20 19:42:29 UTC
Created attachment 873179 [details, diff]
patch for dev-qt/qtbase-6.6.0
Comment 33 Ionen Wolkens gentoo-dev 2023-10-21 05:16:42 UTC
Maybe I'll just do 8192 for now until upstream figures out on exactly what's best, SIGSTKSZ has strings attached and I'd rather not have to think about it (haven't forgotten things like e.g. [1]).

That aside, many thanks for figuring this out.

[1] https://github.com/axboe/liburing/commit/8aac320a
Comment 34 Larry the Git Cow gentoo-dev 2023-10-21 06:22:37 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9152c25f592db19e2d6f6ab0aab991a463503a34

commit 9152c25f592db19e2d6f6ab0aab991a463503a34
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2023-10-21 05:46:22 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2023-10-21 06:21:50 +0000

    dev-qt/qtbase: fix qsb and qmake with sandbox
    
    Also add to 6.5.3, while the issue has been less prominent in
    6.5.x, there has been users that ran into issues with older
    versions, and is needed for stable users.
    
    See bug #915695 for details, the others are essentially duplicates
    which are hopefully fixed too (please report if still issues given
    I could never reproduce myself and cannot confirm).
    
    Closes: https://bugs.gentoo.org/908809
    Closes: https://bugs.gentoo.org/908816
    Closes: https://bugs.gentoo.org/913493
    Closes: https://bugs.gentoo.org/915695
    Thanks-to: vowstar
    Thanks-to: Mike Gilbert <floppym@gentoo.org>
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 .../qtbase-6.5.3-forkfd-childstack-size.patch      | 27 ++++++++++++++++++++++
 ...{qtbase-6.5.3.ebuild => qtbase-6.5.3-r1.ebuild} |  1 +
 ...{qtbase-6.6.0.ebuild => qtbase-6.6.0-r1.ebuild} |  1 +
 3 files changed, 29 insertions(+)
Comment 35 vowstar 2023-10-25 12:16:49 UTC
(In reply to Ionen Wolkens from comment #33)
> Maybe I'll just do 8192 for now until upstream figures out on exactly what's
> best, SIGSTKSZ has strings attached and I'd rather not have to think about
> it (haven't forgotten things like e.g. [1]).
> 
> That aside, many thanks for figuring this out.
> 
> [1] https://github.com/axboe/liburing/commit/8aac320a

Yes, 8192 may a good idea, SIGSTKSZ not being a constant, it may cause compile error.
Comment 36 Larry the Git Cow gentoo-dev 2023-11-29 05:36:52 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=313ee5bd17f851405ea0f9176797bc7355a9e648

commit 313ee5bd17f851405ea0f9176797bc7355a9e648
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2023-11-29 04:44:24 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2023-11-29 05:36:15 +0000

    dev-qt/qtbase: re-add forkfd stacksize patch but with 32k
    
    Bug: https://bugs.gentoo.org/918664
    Bug: https://bugs.gentoo.org/915695
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 .../qtbase-6.6.1-forkfd-childstack-size.patch      | 23 ++++++++++++++++++++++
 ...{qtbase-6.6.1.ebuild => qtbase-6.6.1-r1.ebuild} |  1 +
 dev-qt/qtbase/qtbase-6.6.9999.ebuild               |  1 +
 dev-qt/qtbase/qtbase-6.9999.ebuild                 |  1 +
 4 files changed, 26 insertions(+)