I have received a segmentation fault on app close on version 3.3.3

Erkam Murat Bozkurt <[email protected]> Wed, 15 Jul 2026 18:13:28 +0300
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <CAG1x5-OrF95s=wzxv-qVaNVuLkYta=yA-nOR1AnkwjP3_=+f7g@mail.gmail.com>
--000000000000ae59320656a7c461
Content-Type: text/plain; charset="UTF-8"

I am testing a fully automatic C++ build system generator and the platform
produces the necessary "CMakeLists.txt" and the other configuration files
automatically for both kernel and GUI. Previously, I could not produce an
executable for GUI and there was a linking problem. Now, I can overcome the
linking problem that I have mentioned previously and the app can
successfully generate its own configuration files automatically. On the
current version of the GUI, I have used the wxWidgets version 3.3.1
and MinGW-w64
13.0.0  as compiler and the GUI is closing without any crash.

Every wxWidgets configuration is performed automatically by the CMAKE with
the following CMAKE command.

include(FetchContent)

FetchContent_Declare(
   wxWidgets
   GIT_REPOSITORY https://github.com/wxWidgets/wxWidgets.git
   GIT_TAG v3.3.1
   GIT_PROGRESS TRUE
)

FetchContent_GetProperties(wxwidgets)
FetchContent_MakeAvailable(wxwidgets)

However, when I try to check whether the app can produce the configuration
files without human intervention, the
platform produces "CMakeLists.txt" files for direct linking without
using FetchContent
property. Off course, it is possible to make
availably of wxWidgets library by default and in the future, I will add
this property. But, I am trying to check direct linking
with automatically produced CMakeLists.txt files and therefore, I compile
the app using the same compiler "MinGW-w64 13.0.0"
for wxWidgets version 3.3.3 with direct linking. Unfortunately, the app
crashes on close when I use wxWidgets version 3.3.3 with direct linking .
I have written the configuration codes which are produced automatically by
the platform.

The GUI of the app works successfully and it crashy solely on close.

target_link_libraries(Pcynlitx PUBLIC

        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_adv.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_xrc.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_stc.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_aui.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_core.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxbase33ud.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxpngd.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxlexillad.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_gl.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_richtext.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxscintillad.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxbase33ud_net.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_webview.a
        imm32
        gcc
        stdc++
        wxtiffd
        wxjpegd
        wxpngd
        wxwebpd
        wxzlibd
        wxregexud
        wxexpatd
        kernel32
        user32
        gdi32
        gdiplus
        msimg32
        comdlg32
        winspool
        winmm
        shell32
        shlwapi
        comctl32
        ole32
        oleaut32
        uuid
        rpcrt4
        advapi32
        version
        ws2_32
        wininet
        oleacc
        uxtheme

)

I can not determine the reason why the app crashes. The gdb debugger gives
the following back trace

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ffae64af6a3 in ntdll!RtlInitializeResource () from
C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) bt
#0  0x00007ffae64af6a3 in ntdll!RtlInitializeResource () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffae64c016f in ntdll!RtlSleepConditionVariableCS () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ffae64c13e2 in ntdll!RtlEnterCriticalSection () from
C:\WINDOWS\SYSTEM32\ntdll.dll
#3  0x00007ff70105b986 in wxCriticalSection::Enter (
    this=0x7ff701bc7e00 <(anonymous
namespace)::UntranslatedStringHolder::ms_criticalSection>)
    at ../../src/msw/thread.cpp:143
#4  0x00007ff7014711ca in wxCriticalSectionLocker::wxCriticalSectionLocker
(this=0x5ffd40, cs=...)
    at C:/wxWidgets-3.3.3/include/wx/thread.h:299
#5  0x00007ff70102f251 in (anonymous
namespace)::UntranslatedStringHolder::~UntranslatedStringHolder (
    this=0x29ed8f8) at ../../src/common/translation.cpp:1511
#6  0x00007ff70139b6ee in run_dtor_list ()
#7  0x00007ff70139b850 in tls_atexit_callback ()
#8  0x00007ff7013b6e3d in run_callback ()
#9  0x00007ffae585e88a in msvcrt!_initterm_e () from
C:\WINDOWS\System32\msvcrt.dll
#10 0x00007ff700cd137d in __tmainCRTStartup ()
#11 0x00007ff700cd1038 in WinMainCRTStartup ()

I did not use wxThread anywhere and it still points to wxThread. Most
probably, you don't have the time to check the code but I have
added the related link for the codebase

https://github.com/Erkam-Murat-Bozkurt/pcynlitx.nova/tree/main/SOURCE/GUI.DEVELOPMENT

Even Though I have written a class in order to use wxThread, I used
std::thread on the threading for GUI.

Erkam Murat Bozkurt

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/wx-users/CAG1x5-OrF95s%3Dwzxv-qVaNVuLkYta%3DyA-nOR1AnkwjP3_%3D%2Bf7g%40mail.gmail.com.

--000000000000ae59320656a7c461
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><font face=3D"monospace">I am testing a fully automat=
ic C++ build system generator and the platform produces the necessary &quot=
;CMakeLists.txt&quot; and the other configuration files automatically for b=
oth kernel=C2=A0and GUI. Previously, I could not produce an executable for =
GUI and there was a linking problem. Now, I can overcome the linking proble=
m that I have mentioned=C2=A0previously and the app can successfully=C2=A0g=
enerate its own configuration files automatically. On the current version o=
f the GUI, I have used the=C2=A0<span style=3D"background-color:transparent=
">wxWidgets=C2=A0</span><span style=3D"background-color:transparent">versio=
n=C2=A0</span><span style=3D"background-color:transparent;color:rgb(0,0,0);=
white-space:pre">3.3.1 and </span><span style=3D"background-color:transpare=
nt">MinGW-w64 13.0.0=C2=A0 as compiler and the GUI is closing without any c=
rash.=C2=A0</span></font></div><div><span style=3D"background-color:transpa=
rent"><font face=3D"monospace"><br></font></span></div><div><span style=3D"=
background-color:transparent"><font face=3D"monospace">Every wxWidgets conf=
iguration=C2=A0is performed automatically=C2=A0by the CMAKE with the follow=
ing CMAKE command.</font></span></div><div><span style=3D"background-color:=
transparent"><font face=3D"monospace"><br></font></span></div><div><div sty=
le=3D"color:rgb(0,0,0);line-height:19px;white-space:pre"><div><font face=3D=
"monospace"><span style=3D"color:rgb(0,0,255)">include</span>(FetchContent)=
</font></div><font face=3D"monospace"><br></font><div><font face=3D"monospa=
ce">FetchContent_Declare(</font></div><div><font face=3D"monospace">=C2=A0 =
=C2=A0wxWidgets</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0GIT_=
REPOSITORY <a href=3D"https://github.com/wxWidgets/wxWidgets.git">https://g=
ithub.com/wxWidgets/wxWidgets.git</a></font></div><div><font face=3D"monosp=
ace">=C2=A0 =C2=A0GIT_TAG v3.3.1</font></div><div><font face=3D"monospace">=
=C2=A0 =C2=A0GIT_PROGRESS <span style=3D"color:rgb(0,0,255)">TRUE</span></f=
ont></div><div><font face=3D"monospace">)</font></div><font face=3D"monospa=
ce"><br></font><div><font face=3D"monospace">FetchContent_GetProperties(wxw=
idgets)</font></div><div><font face=3D"monospace">FetchContent_MakeAvailabl=
e(wxwidgets)</font></div><div><font face=3D"monospace"><br></font></div></d=
iv></div><div><font face=3D"monospace">However, when=C2=A0<span style=3D"ba=
ckground-color:transparent">I try to check whether the app can produce the =
configuration files without human intervention, the</span></font></div><div=
><font face=3D"monospace"><span style=3D"background-color:transparent">plat=
form produces &quot;CMakeLists.txt&quot; files for direct linking without u=
sing=C2=A0</span></font><span style=3D"color:rgb(0,0,0);font-family:monospa=
ce;white-space:pre;background-color:transparent">FetchContent property. Off=
 course, it is possible to make </span></div><div><span style=3D"color:rgb(=
0,0,0);font-family:monospace;white-space:pre;background-color:transparent">=
availably of wxWidgets library by default and in the future, I will add thi=
s property. But, I am trying to check direct linking </span></div><div><spa=
n style=3D"color:rgb(0,0,0);font-family:monospace;white-space:pre;backgroun=
d-color:transparent">with automatically produced CMakeLists.txt files and t=
herefore, I </span><span style=3D"font-family:monospace;background-color:tr=
ansparent">compile the app using the same compiler &quot;MinGW-w64 13.0.0&q=
uot;=C2=A0=C2=A0</span></div><div><span style=3D"font-family:monospace;back=
ground-color:transparent">for=C2=A0</span><span style=3D"font-family:monosp=
ace;background-color:transparent">wxWidgets=C2=A0</span><span style=3D"font=
-family:monospace;background-color:transparent">version=C2=A0</span><span s=
tyle=3D"font-family:monospace;background-color:transparent;color:rgb(0,0,0)=
;white-space:pre">3.3.3 with direct linking. Unfortunately, </span><span st=
yle=3D"font-family:monospace;background-color:transparent">the app crashes =
on close when I use=C2=A0</span><span style=3D"background-color:transparent=
;font-family:monospace">wxWidgets=C2=A0</span><span style=3D"background-col=
or:transparent;font-family:monospace">version=C2=A0</span><span style=3D"ba=
ckground-color:transparent;font-family:monospace;color:rgb(0,0,0);white-spa=
ce:pre">3.3.3 with direct linking</span>=C2=A0<span style=3D"font-family:mo=
nospace;background-color:transparent">.=C2=A0</span></div><div><span style=
=3D"font-family:monospace;background-color:transparent">I have written the =
configuration codes=C2=A0</span><span style=3D"background-color:transparent=
;font-family:monospace">which are produced automatically by the platform.</=
span></div><div><span style=3D"background-color:transparent;color:rgb(0,0,0=
);white-space:pre"><font face=3D"monospace"><br></font></span></div><div><s=
pan style=3D"background-color:transparent;color:rgb(0,0,0);white-space:pre"=
><font face=3D"monospace">The GUI of the app works successfully and it cras=
hy solely on close. </font></span></div><div><span style=3D"background-colo=
r:transparent;color:rgb(0,0,0);white-space:pre"><font face=3D"monospace"><b=
r></font></span></div><div><div style=3D"color:rgb(0,0,0);line-height:19px;=
white-space:pre"><div><font face=3D"monospace"><span style=3D"color:rgb(0,0=
,255)">target_link_libraries</span>(Pcynlitx PUBLIC</font></div><div><font =
face=3D"monospace">=C2=A0 =C2=A0 </font></div><div><font face=3D"monospace"=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_ad=
v.a</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 C=
:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_xrc.a</font></div><div><font fac=
e=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 C:/wxWidgets-3.3.3/lib/gcc_lib/=
libwxmsw33ud_stc.a</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_aui.a</font></div=
><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 C:/wxWidgets-3.3=
.3/lib/gcc_lib/libwxmsw33ud_core.a</font></div><div><font face=3D"monospace=
">=C2=A0 =C2=A0 =C2=A0 =C2=A0 C:/wxWidgets-3.3.3/lib/gcc_lib/libwxbase33ud.=
a</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 C:/=
wxWidgets-3.3.3/lib/gcc_lib/libwxpngd.a</font></div><div><font face=3D"mono=
space">=C2=A0 =C2=A0 =C2=A0 =C2=A0 C:/wxWidgets-3.3.3/lib/gcc_lib/libwxlexi=
llad.a</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_gl.a</font></div><div><font=
 face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 C:/wxWidgets-3.3.3/lib/gcc_=
lib/libwxmsw33ud_richtext.a</font></div><div><font face=3D"monospace">=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 C:/wxWidgets-3.3.3/lib/gcc_lib/libwxscintillad.a</=
font></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 C:/wxW=
idgets-3.3.3/lib/gcc_lib/libwxbase33ud_net.a</font></div><div><font face=3D=
"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 C:/wxWidgets-3.3.3/lib/gcc_lib/libw=
xmsw33ud_webview.a</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 imm32</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 gcc</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 stdc++</font></div><div><font face=3D"monospace">=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 wxtiffd</font></div><div><font face=3D"monospace">=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 wxjpegd</font></div><div><font face=3D"monospace">=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 wxpngd</font></div><div><font face=3D"monospace">=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 wxwebpd</font></div><div><font face=3D"monospac=
e">=C2=A0 =C2=A0 =C2=A0 =C2=A0 wxzlibd</font></div><div><font face=3D"monos=
pace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 wxregexud</font></div><div><font face=3D"=
monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 wxexpatd</font></div><div><font face=
=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 kernel32</font></div><div><font =
face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 user32</font></div><div><fon=
t face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 gdi32</font></div><div><fo=
nt face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 gdiplus</font></div><div>=
<font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 msimg32</font></div><d=
iv><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 comdlg32</font></di=
v><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 winspool</font>=
</div><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 winmm</font=
></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 shell32</f=
ont></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 shlwapi=
</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 comc=
tl32</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
ole32</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =C2=A0=
 oleaut32</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 uuid</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 rpcrt4</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 advapi32</font></div><div><font face=3D"monospace">=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 version</font></div><div><font face=3D"monospace">=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 ws2_32</font></div><div><font face=3D"monospace">=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 wininet</font></div><div><font face=3D"monospace">=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 oleacc</font></div><div><font face=3D"monospace">=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 uxtheme</font></div><div><font face=3D"monospac=
e">=C2=A0 =C2=A0 </font></div><div><font face=3D"monospace">)</font></div><=
/div></div><div><font face=3D"monospace"><br></font></div><div><font face=
=3D"monospace">I can not determine the reason=C2=A0why the app crashes. The=
 gdb debugger gives the following back trace</font></div><div><font face=3D=
"monospace"><br></font></div><div><font face=3D"monospace">Thread 1 receive=
d signal SIGSEGV, Segmentation fault.<br>0x00007ffae64af6a3 in ntdll!RtlIni=
tializeResource () from C:\WINDOWS\SYSTEM32\ntdll.dll<br>(gdb) bt<br>#0 =C2=
=A00x00007ffae64af6a3 in ntdll!RtlInitializeResource () from C:\WINDOWS\SYS=
TEM32\ntdll.dll<br>#1 =C2=A00x00007ffae64c016f in ntdll!RtlSleepConditionVa=
riableCS () from C:\WINDOWS\SYSTEM32\ntdll.dll<br>#2 =C2=A00x00007ffae64c13=
e2 in ntdll!RtlEnterCriticalSection () from C:\WINDOWS\SYSTEM32\ntdll.dll<b=
r>#3 =C2=A00x00007ff70105b986 in wxCriticalSection::Enter (<br>=C2=A0 =C2=
=A0 this=3D0x7ff701bc7e00 &lt;(anonymous namespace)::UntranslatedStringHold=
er::ms_criticalSection&gt;)<br>=C2=A0 =C2=A0 at ../../src/msw/thread.cpp:14=
3<br>#4 =C2=A00x00007ff7014711ca in wxCriticalSectionLocker::wxCriticalSect=
ionLocker (this=3D0x5ffd40, cs=3D...)<br>=C2=A0 =C2=A0 at C:/wxWidgets-3.3.=
3/include/wx/thread.h:299<br>#5 =C2=A00x00007ff70102f251 in (anonymous name=
space)::UntranslatedStringHolder::~UntranslatedStringHolder (<br>=C2=A0 =C2=
=A0 this=3D0x29ed8f8) at ../../src/common/translation.cpp:1511<br>#6 =C2=A0=
0x00007ff70139b6ee in run_dtor_list ()<br>#7 =C2=A00x00007ff70139b850 in tl=
s_atexit_callback ()<br>#8 =C2=A00x00007ff7013b6e3d in run_callback ()<br>#=
9 =C2=A00x00007ffae585e88a in msvcrt!_initterm_e () from C:\WINDOWS\System3=
2\msvcrt.dll<br>#10 0x00007ff700cd137d in __tmainCRTStartup ()<br>#11 0x000=
07ff700cd1038 in WinMainCRTStartup ()</font></div><div><font face=3D"monosp=
ace"><br></font></div><div><font face=3D"monospace">I did not use wxThread =
anywhere and it still points to wxThread. Most probably, you don&#39;t have=
 the time to check the code but I have=C2=A0</font></div><div><font face=3D=
"monospace">added the related link=C2=A0for the codebase</font></div><div><=
font face=3D"monospace"><br></font></div><div><a href=3D"https://github.com=
/Erkam-Murat-Bozkurt/pcynlitx.nova/tree/main/SOURCE/GUI.DEVELOPMENT">https:=
//github.com/Erkam-Murat-Bozkurt/pcynlitx.nova/tree/main/SOURCE/GUI.DEVELOP=
MENT</a><font face=3D"monospace"></font></div><div><br></div><div>Even Thou=
gh=C2=A0I have written=C2=A0a class in order to use wxThread, I used std::t=
hread on the threading for GUI.</div><div><font face=3D"monospace"><br></fo=
nt></div><div><font face=3D"monospace">Erkam Murat Bozkurt</font></div><div=
><span style=3D"background-color:transparent"><font face=3D"monospace"><br>=
</font></span></div><div><span style=3D"background-color:transparent"><br><=
/span></div></div>

<p></p>

-- <br />
Please read <a href=3D"https://www.wxwidgets.org/support/mlhowto.htm">https=
://www.wxwidgets.org/support/mlhowto.htm</a> before posting.<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;wx-users&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">wx-users+u=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
wx-users/CAG1x5-OrF95s%3Dwzxv-qVaNVuLkYta%3DyA-nOR1AnkwjP3_%3D%2Bf7g%40mail=
.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.co=
m/d/msgid/wx-users/CAG1x5-OrF95s%3Dwzxv-qVaNVuLkYta%3DyA-nOR1AnkwjP3_%3D%2B=
f7g%40mail.gmail.com</a>.<br />

--000000000000ae59320656a7c461--