tim-dlang / dqt

D bindings for the Qt Toolkit
GNU Lesser General Public License v3.0
25 stars 4 forks source link

Windows builds segfaults on start (LDC 1.33, x86_64-windows-msvc) #6

Closed Dadoum closed 10 months ago

Dadoum commented 10 months ago

Probably something in module constructors going wrong.

Backtrace:
=>0 0x000001403f36f5 rawConstructor+0x5() [~/.dub/packages/dqt-5.15.2-alpha.2/dqt/core/qt/core/string.d:324] in test (0x0000000011f9f0)
  1 0x000001403f36f5 qt.helpers::globalInitVarImpl!(QString)::_sharedStaticCtor_L235_C5_1+0x65() [~/.dub/packages/dqt-5.15.2-alpha.2/dqt/core/qt/helpers.d:237] in test (0x0000000011f9f0)
  2 0x000001403f39b9 qt.helpers::_D2qt7helpers13__shared_ctorZ+0x9() [~/.dub/packages/dqt-5.15.2-alpha.2/dqt/core/qt/helpers.d:0] in test (0x0000000011fb00)
 ...
0x000001403f36f5 qt.helpers::globalInitVarImpl!(QString)::_sharedStaticCtor_L235_C5_1+0x65 [~/.dub/packages/dqt-5.15.2-alpha.2/dqt/core/qt/helpers.d:237] in test: mov %rax, 0x00000001404c68a8 ; qt.helpers::globalInitVar in test
237         (*cast(T*)&globalInitVar).rawConstructor;
tim-dlang commented 10 months ago

The code initialized an immutable variable in a static constructor. This worked with DMD, but not with LDC. Commit f58974f8502e4a102500b58689685b1c34bd66a9 solves this by making the variable mutable.

Unfortunately there are still other problems with this library and LDC on Windows. Using DMD works better for now.

Dadoum commented 10 months ago

Thanks for your quick response. I will try to stick with LDC since it's easier in my workflow (with cross compilation) but I will switch to DMD if that's really needed.

tim-dlang commented 10 months ago

I fixed some other problems with LDC on Windows. The examples seem to work now.