<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QString constructor segfault. qshaderdescription.cpp corruption]]></title><description><![CDATA[<p dir="auto">A few function calls past our main function a QString gets constructed and segfaults with the following stack trace</p>
<pre><code>(gdb) bt
#0  0x000000000044d60b in int QAtomicOps&lt;int&gt;::loadRelaxed&lt;int&gt;(std::atomic&lt;int&gt; const&amp;) ()
#1  0x000000000044ceb8 in QBasicAtomicInteger&lt;int&gt;::loadRelaxed() const ()
#2  0x000000000044c46e in QtPrivate::RefCount::ref() ()
#3  0x000000000044ca67 in QString::QString(QString const&amp;) ()
...
</code></pre>
<p dir="auto">I assumed that our project was doing something unsafe with memory and recompiled with libefence so that I could figure out what was causing the problem.</p>
<pre><code>(gdb) bt
#0  QString::fromLatin1_helper (str=str@entry=0x7ffff5b6562b "float", size=size@entry=5) at text/qstring.cpp:5462
#1  0x00007ffff563ac75 in QString::QString (aLatin1=..., this=0x7ffff5e7d7c0 &lt;typeTab&gt;)
    at ../../include/QtCore/../../src/corelib/text/qstring.h:1067
#2  __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at rhi/qshaderdescription.cpp:666
#3  _GLOBAL__sub_I_qshaderdescription.cpp(void) () at rhi/qshaderdescription.cpp:1513
#4  0x00007ffff7de3e0a in call_init (l=&lt;optimized out&gt;, argc=argc@entry=1, argv=argv@entry=0x7fffffffdbd8, env=env@entry=0x7fffffffdbe8)
    at dl-init.c:72
#5  0x00007ffff7de3f0a in call_init (env=0x7fffffffdbe8, argv=0x7fffffffdbd8, argc=1, l=&lt;optimized out&gt;) at dl-init.c:30
#6  _dl_init (main_map=0x7ffff7ffe1f0, argc=1, argv=0x7fffffffdbd8, env=0x7fffffffdbe8) at dl-init.c:119
#7  0x00007ffff7dd501a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
</code></pre>
<p dir="auto">This suggests that the problem is the result of a static variable in the gui/rhi component using QStrings as static variables before they're ready. Checking git I found that <a href="https://github.com/qt/qtbase/commit/96f16e7487f9a78fdb4059d8f839c552bab8f341" target="_blank" rel="noopener noreferrer nofollow ugc">these keys were changed to const char*</a> and this change/fix should be live in recent versions of Qt 6.</p>
<p dir="auto"><strong>Apart from upgrading our entire software to Qt 6 is there anything I can do to make this work?</strong> I feel like if the issue should be experienced by more Linux developers since as far as I know <strong>we're not actually using any of the features in RHI directly</strong>. We currently have <strong>software working with Qt 5.15.2 on Windows</strong> but struggling with the Linux port.</p>
]]></description><link>https://forum.qt.io/topic/139287/qstring-constructor-segfault-qshaderdescription-cpp-corruption</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 18:00:15 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/139287.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Sep 2022 15:21:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QString constructor segfault. qshaderdescription.cpp corruption on Tue, 13 Sep 2022 18:41:14 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">Can you trigger that with a minimal compilable example ?</p>
]]></description><link>https://forum.qt.io/post/728607</link><guid isPermaLink="true">https://forum.qt.io/post/728607</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 13 Sep 2022 18:41:14 GMT</pubDate></item></channel></rss>