Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 919043 - dev-qt/qtscript-5.15.11: causes segfault in media-sound/mixxx-2.3.6 when compiled with lto or with clang
Summary: dev-qt/qtscript-5.15.11: causes segfault in media-sound/mixxx-2.3.6 when comp...
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-12-02 14:01 UTC by deim
Modified: 2023-12-12 13:04 UTC (History)
2 users (show)

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


Attachments
run log of stable alsa-lib (mixxx.log,24.75 KB, text/x-log)
2023-12-02 14:06 UTC, deim
Details
emerge --info mixxx (einfo.txt,8.21 KB, text/plain)
2023-12-02 14:07 UTC, deim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description deim 2023-12-02 14:01:53 UTC
built mixxx and when it loads it prints it can't find files in portage temp dir of alsa-lib.

Reproducible: Always

Steps to Reproduce:
1. install mixxx
2. run mixxx
Actual Results:  
SIGSEGV with errors it can't load alsa-lib files from portage temp

Expected Results:  
fine running app

tried unmask and build media-libs/alsa-lib-1.2.10-r2 but it makes same problems as stable alsa-lib
Comment 1 deim 2023-12-02 14:06:04 UTC
Created attachment 876384 [details]
run log of stable alsa-lib
Comment 2 deim 2023-12-02 14:07:21 UTC
Created attachment 876385 [details]
emerge --info mixxx
Comment 3 Alfred Wingate 2023-12-02 14:46:52 UTC
For the segfault could you recompile media-sound/mixxx with debugging symbols and then get the backtrace with gdb?

https://wiki.gentoo.org/wiki/Debugging#Installing_debugging_information_for_packages

Other than that I think I've reproduced this.

#0  0x00007ffff795684f in ?? () from /usr/lib64/libQt5Script.so.5
#1  0x00007ffff78af0c9 in ?? () from /usr/lib64/libQt5Script.so.5
#2  0x00007ffff789f392 in ?? () from /usr/lib64/libQt5Script.so.5
#3  0x00007ffff7923d01 in ?? () from /usr/lib64/libQt5Script.so.5
#4  0x00007ffff7986a41 in ?? () from /usr/lib64/libQt5Script.so.5
#5  0x00007ffff7986a89 in ?? () from /usr/lib64/libQt5Script.so.5
#6  0x00005555556f455e in SkinContext::SharedState::~SharedState (this=0x5555566ec8f0, __in_chrg=<optimized out>) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/skin/legacy/skincontext.h:284
#7  0x00005555556f4579 in std::_Destroy<SkinContext::SharedState> (__pointer=0x5555566ec8f0) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/stl_construct.h:151
#8  0x00005555556f43f2 in std::allocator_traits<std::allocator<void> >::destroy<SkinContext::SharedState> (__p=0x5555566ec8f0) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/alloc_traits.h:674
#9  std::_Sp_counted_ptr_inplace<SkinContext::SharedState, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x5555566ec8e0) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr_base.h:613
#10 0x0000555555649767 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x5555566ec8e0) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr_base.h:346
#11 0x000055555564cdef in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x5555566f23a0, __in_chrg=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr_base.h:1071
#12 0x00005555556f2df8 in std::__shared_ptr<SkinContext::SharedState, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x5555566f2398, __in_chrg=<optimized out>)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr_base.h:1524
#13 0x00005555556f2e14 in std::shared_ptr<SkinContext::SharedState>::~shared_ptr (this=0x5555566f2398, __in_chrg=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:175
#14 0x00005555556f0fc3 in SkinContext::~SkinContext (this=0x5555566f2370, __in_chrg=<optimized out>) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/skin/legacy/skincontext.cpp:74
#15 0x00005555556f100e in SkinContext::~SkinContext (this=0x5555566f2370, __in_chrg=<optimized out>) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/skin/legacy/skincontext.cpp:74
#16 0x00005555556eb882 in std::default_delete<SkinContext>::operator() (this=0x7fffffffd0c0, __ptr=0x5555566f2370) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h:99
#17 0x00005555556e81bc in std::unique_ptr<SkinContext, std::default_delete<SkinContext> >::~unique_ptr (this=0x7fffffffd0c0, __in_chrg=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h:404
#18 0x00005555556d4170 in LegacySkinParser::~LegacySkinParser (this=0x7fffffffd050, __in_chrg=<optimized out>) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/skin/legacy/legacyskinparser.cpp:193
#19 0x00005555557099c7 in SkinLoader::loadLaunchImage (this=0x5555566ca140, pParent=0x7fffffffd220) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/skin/skinloader.cpp:153
#20 0x000055555563deba in MixxxMainWindow::MixxxMainWindow (this=0x7fffffffd220, pApp=0x7fffffffd3c0, args=...) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/mixxx.cpp:266
#21 0x000055555563792b in (anonymous namespace)::runMixxx (app=0x7fffffffd3c0, args=...) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/main.cpp:27
#22 0x0000555555637c9d in main (argc=1, argv=0x7fffffffd538) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/main.cpp:112

Its coming from qt5script for me.
Comment 4 Alfred Wingate 2023-12-02 14:59:59 UTC
dev-qt/qtscript compiled with lto is the culprit. This could be addressed by either disabling lto in qtscript or adding qt6 support for mixxx.

Thread 1 "mixxx" received signal SIGSEGV, Segmentation fault.
0x00007ffff795684f in TCMalloc_PageMap3<36>::get (k=0, this=<optimized out>) at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCPageMap.h:234
234         return reinterpret_cast<Leaf*>(root_->ptrs[i1]->ptrs[i2])->values[i3];
(gdb) bt
#0  0x00007ffff795684f in TCMalloc_PageMap3<36>::get (k=0, this=<optimized out>) at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/wtf/TCPageMap.h:234
#1  QTWTF::TCMalloc_PageHeap::GetDescriptor (this=<optimized out>, p=0) at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1279
#2  QTWTF::do_free (ptr=<optimized out>) at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:3510
#3  QTWTF::fastFree (ptr=0x0) at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:3719
#4  0x00007ffff78af0c9 in QTWTF::Vector<QTJSC::Register, 0ul>::expandCapacity (this=0x555556706828, newMinCapacity=<optimized out>, ptr=0x7fffffffccc0)
    at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h:752
#5  0x00007ffff789f392 in QTWTF::Vector<void*, 0ul>::append<void*> (val=@0x7fffffffccc0: 0x7fff20000000, this=0x555556706828)
    at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Vector.h:870
#6  QTJSC::FixedVMPoolAllocator::free (size=16384, pointer=<optimized out>, this=0x555556706820)
    at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp:397
#7  QTJSC::ExecutablePool::systemRelease (allocation=...) at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp:457
#8  QTJSC::ExecutablePool::~ExecutablePool (this=<optimized out>, this=<optimized out>)
    at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h:123
#9  QTWTF::RefCounted<QTJSC::ExecutablePool>::deref (this=0x7fffe009e960) at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefCounted.h:109
#10 0x00007ffff7923d01 in QTWTF::RefPtr<QTJSC::ExecutablePool>::~RefPtr (this=<optimized out>, this=<optimized out>)
    at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefPtr.h:59
#11 QTJSC::ExecutableAllocator::~ExecutableAllocator (this=<optimized out>, this=<optimized out>)
    at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/jit/ExecutableAllocator.h:141
#12 QTJSC::JSGlobalData::~JSGlobalData (this=<optimized out>, this=<optimized out>) at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.cpp:195
#13 0x00007ffff7986a41 in QTWTF::RefCounted<QTJSC::JSGlobalData>::deref (this=0x7fffe0097800) at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/3rdparty/javascriptcore/JavaScriptCore/wtf/RefCounted.h:109
#14 QScriptEnginePrivate::~QScriptEnginePrivate (this=<optimized out>, this=<optimized out>) at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/script/api/qscriptengine.cpp:1060
#15 0x00007ffff7986a89 in QScriptEnginePrivate::~QScriptEnginePrivate (this=<optimized out>, this=<optimized out>) at /usr/src/debug/dev-qt/qtscript-5.15.11/qtscript-everywhere-src-5.15.11/src/script/api/qscriptengine.cpp:1066
#16 0x00005555556f455e in SkinContext::SharedState::~SharedState (this=0x5555566633d0, __in_chrg=<optimized out>) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/skin/legacy/skincontext.h:284
#17 0x00005555556f4579 in std::_Destroy<SkinContext::SharedState> (__pointer=0x5555566633d0) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/stl_construct.h:151
#18 0x00005555556f43f2 in std::allocator_traits<std::allocator<void> >::destroy<SkinContext::SharedState> (__p=0x5555566633d0) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/alloc_traits.h:674
#19 std::_Sp_counted_ptr_inplace<SkinContext::SharedState, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x5555566633c0) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr_base.h:613
#20 0x0000555555649767 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x5555566633c0) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr_base.h:346
#21 0x000055555564cdef in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x5555566f1e70, __in_chrg=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr_base.h:1071
#22 0x00005555556f2df8 in std::__shared_ptr<SkinContext::SharedState, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (this=0x5555566f1e68, __in_chrg=<optimized out>)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr_base.h:1524
#23 0x00005555556f2e14 in std::shared_ptr<SkinContext::SharedState>::~shared_ptr (this=0x5555566f1e68, __in_chrg=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/shared_ptr.h:175
#24 0x00005555556f0fc3 in SkinContext::~SkinContext (this=0x5555566f1e40, __in_chrg=<optimized out>) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/skin/legacy/skincontext.cpp:74
#25 0x00005555556f100e in SkinContext::~SkinContext (this=0x5555566f1e40, __in_chrg=<optimized out>) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/skin/legacy/skincontext.cpp:74
#26 0x00005555556eb882 in std::default_delete<SkinContext>::operator() (this=0x7fffffffd0c0, __ptr=0x5555566f1e40) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h:99
#27 0x00005555556e81bc in std::unique_ptr<SkinContext, std::default_delete<SkinContext> >::~unique_ptr (this=0x7fffffffd0c0, __in_chrg=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/unique_ptr.h:404
#28 0x00005555556d4170 in LegacySkinParser::~LegacySkinParser (this=0x7fffffffd050, __in_chrg=<optimized out>) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/skin/legacy/legacyskinparser.cpp:193
#29 0x00005555557099c7 in SkinLoader::loadLaunchImage (this=0x5555566df9a0, pParent=0x7fffffffd220) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/skin/skinloader.cpp:153
#30 0x000055555563deba in MixxxMainWindow::MixxxMainWindow (this=0x7fffffffd220, pApp=0x7fffffffd3c0, args=...) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/mixxx.cpp:266
#31 0x000055555563792b in (anonymous namespace)::runMixxx (app=0x7fffffffd3c0, args=...) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/main.cpp:27
#32 0x0000555555637c9d in main (argc=1, argv=0x7fffffffd538) at /usr/src/debug/media-sound/mixxx-2.3.6/mixxx-2.3.6/src/main.cpp:112
Comment 5 deim 2023-12-03 05:57:47 UTC
in between I compiled mixxx and qtscript without LTO but gdb gave me:
Thread 1 "mixxx" received signal SIGSEGV, Segmentation fault.
0x00007ffff7a54ed0 in ?? () from /usr/lib64/libQt5Script.so.5

I'll investigate more on qtscript now.
Comment 6 deim 2023-12-03 05:59:39 UTC
dev-qt/qtscript-5.15.11::gentoo was built with the following:
USE="jit scripttools -debug -test" ABI_X86="(64)"
CFLAGS="-march=silvermont -maes -mtune=silvermont -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=silvermont -maes -mtune=silvermont -O2 -pipe -fomit-frame-pointer"
FEATURES="usersync news binpkg-multi-instance fixlafiles xattr sandbox binpkg-docompress getbinpkg merge-sync distlocks config-protect-if-modified ebuild-locks strict ipc-sandbox buildpkg-live parallel-fetch unknown-features-warn usersandbox pid-sandbox binpkg-logs preserve-libs assume-digests binpkg-dostrip network-sandbox qa-unresolved-soname-deps userpriv multilib-strict userfetch unmerge-orphans unmerge-logs sfperms protect-owned"
LDFLAGS="-Wl,-O2,--as-needed -fuse-ld=lld -march=silvermont -maes -mtune=silvermont -O2 -pipe -fomit-frame-pointer -Wl,--undefined-version"
Comment 7 deim 2023-12-03 06:35:33 UTC
This worked clang-no-lto => gcc-no-lto; O1 in LDFLAGS

dev-qt/qtscript-5.15.11::gentoo was built with the following:
USE="jit scripttools -debug -test" ABI_X86="(64)"
CFLAGS="-march=silvermont -maes -mtune=silvermont -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=silvermont -maes -mtune=silvermont -O2 -pipe -fomit-frame-pointer"
FEATURES="unmerge-logs pid-sandbox getbinpkg xattr network-sandbox ipc-sandbox binpkg-dostrip protect-owned usersync unknown-features-warn parallel-fetch multilib-strict sandbox binpkg-multi-instance assume-digests binpkg-logs config-protect-if-modified unmerge-orphans news strict buildpkg-live distlocks merge-sync fixlafiles preserve-libs binpkg-docompress qa-unresolved-soname-deps usersandbox ebuild-locks userpriv userfetch sfperms"
LDFLAGS="-Wl,-O1,--as-needed -march=silvermont -maes -mtune=silvermont -O2 -pipe -fomit-frame-pointer"
Comment 8 Alfred Wingate 2023-12-03 13:44:11 UTC
So there are two issues then. Both with qtscript breaking with lto or clang.

From the perspective of mixx this could be addressed by adding qt6 support and completely avoiding it.

https://bugs.gentoo.org/915779
Comment 9 Andreas Sturmlechner gentoo-dev 2023-12-07 17:08:17 UTC
The solution to this is to globally disable lto for Qt5 packages.

Packaging wise, it will be unwise for some time to stabilise Qt6-based packages as it will not integrate well in current desktop environments.

IOW, even if mixxx supports Qt6 in some upcoming version, a Qt5-by-default version should still be used for stabilisation matters.
Comment 10 Larry the Git Cow gentoo-dev 2023-12-12 13:04:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d51131e1ec7aa03f22a2f2864237fdc3d4dc146

commit 2d51131e1ec7aa03f22a2f2864237fdc3d4dc146
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2023-12-07 17:56:50 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2023-12-12 12:56:01 +0000

    qt5-build.eclass: filter-lto
    
    Closes: https://bugs.gentoo.org/650488
    Closes: https://bugs.gentoo.org/692078
    Closes: https://bugs.gentoo.org/713850
    Closes: https://bugs.gentoo.org/908419
    Closes: https://bugs.gentoo.org/652158
    Closes: https://bugs.gentoo.org/919043
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 eclass/qt5-build.eclass | 3 +++
 1 file changed, 3 insertions(+)