Jump to content
The Dark Mod Forums

Dark Radiant 3.7.0 crashs when trying to open light inspector


Recommended Posts

Hello!

 

I cannot open the light inspector. Either using dhewm3 or dm engines, the outcome is the same.

Dark Radiant closes.

running on terminal, this is the output:

SIGSEGV signal caught: 11
0: /usr/local/bin/../lib/darkradiant/modules/libradiantcore.so(_ZN6applog15SegFaultHandler14_handleSigSegvEi+0x4ab) [0x7f767721e9eb]
1: /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7f76818fd520]
2: darkradiant(+0x417db3) [0x55c1eb23cdb3]
3: darkradiant(+0x37f828) [0x55c1eb1a4828]
4: /usr/local/bin/../lib/darkradiant/libwxutil.so(_ZN6wxutil19DeclarationSelector26onTreeViewSelectionChangedER15wxDataViewEvent+0xbd5) [0x7f7682f942f5]
5: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_ZN12wxEvtHandler23ProcessEventIfMatchesIdERK21wxEventTableEntryBasePS_R7wxEvent+0x6e) [0x7f7682bc117e]
6: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_ZN12wxEvtHandler23SearchDynamicEventTableER7wxEvent+0x62) [0x7f7682bc4812]
7: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_ZN12wxEvtHandler11TryHereOnlyER7wxEvent+0x24) [0x7f7682bc48a4]
8: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_ZN12wxEvtHandler19ProcessEventLocallyER7wxEvent+0x3f) [0x7f7682bc495f]
9: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0xa1) [0x7f7682bc4a51]
10: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_ZN12wxEvtHandler18SafelyProcessEventER7wxEvent+0xb) [0x7f7682bc139b]
11: /lib/x86_64-linux-gnu/libwx_gtk3u_adv-3.0.so.0(+0x162e47) [0x7f768224ee47]
12: /lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_signal_emit_valist+0x1290) [0x7f7680b14700]
13: /lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_signal_emit+0x93) [0x7f7680b14863]
14: /lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_tree_view_set_model+0x4e3) [0x7f76811aa283]
15: /lib/x86_64-linux-gnu/libwx_gtk3u_adv-3.0.so.0(+0x151121) [0x7f768223d121]
16: /lib/x86_64-linux-gnu/libwx_gtk3u_adv-3.0.so.0(_ZN15wxDataViewModel7ClearedEv+0x2a) [0x7f76821b29da]
17: /usr/local/bin/../lib/darkradiant/libwxutil.so(_ZN6wxutil9TreeModel5ClearEv+0x16c) [0x7f7682f7d08c]
18: /usr/local/bin/../lib/darkradiant/libwxutil.so(_ZN6wxutil16ResourceTreeView5ClearEv+0x9f) [0x7f7682f6cd9f]
19: /usr/local/bin/../lib/darkradiant/libwxutil.so(_ZN6wxutil16ResourceTreeView8PopulateERKSt10shared_ptrINS_22IResourceTreePopulatorEE+0x162) [0x7f7682f71952]
20: darkradiant(+0x418488) [0x55c1eb23d488]
21: darkradiant(+0x4185fb) [0x55c1eb23d5fb]
22: darkradiant(+0x37d04f) [0x55c1eb1a204f]
23: darkradiant(+0x382cfc) [0x55c1eb1a7cfc]
24: darkradiant(+0x5d5345) [0x55c1eb3fa345]
25: darkradiant(+0x38e032) [0x55c1eb1b3032]
26: darkradiant(+0x392006) [0x55c1eb1b7006]
27: darkradiant(+0x39229b) [0x55c1eb1b729b]
28: darkradiant(+0x3976b5) [0x55c1eb1bc6b5]
29: /usr/local/bin/../lib/darkradiant/modules/libradiantcore.so(_ZN3cmd13CommandSystem14executeCommandERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorINS_8ArgumentESaISA_EE+0xa5) [0x7f76770aceb5]
30: /usr/local/bin/../lib/darkradiant/modules/libradiantcore.so(_ZN3cmd13CommandSystem7executeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x53) [0x7f76770b27f3]
31: /usr/local/bin/../lib/darkradiant/modules/libradiantcore.so(_ZN3cmd13CommandSystem14executeCommandERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorINS_8ArgumentESaISA_EE+0xa5) [0x7f76770aceb5]
32: /usr/local/bin/../lib/darkradiant/modules/libradiantcore.so(_ZN3cmd13CommandSystem7executeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x53) [0x7f76770b27f3]
33: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_ZN12wxEvtHandler23ProcessEventIfMatchesIdERK21wxEventTableEntryBasePS_R7wxEvent+0x6e) [0x7f7682bc117e]
34: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_ZN12wxEvtHandler23SearchDynamicEventTableER7wxEvent+0x62) [0x7f7682bc4812]
35: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_ZN12wxEvtHandler11TryHereOnlyER7wxEvent+0x24) [0x7f7682bc48a4]
36: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_ZN12wxEvtHandler19ProcessEventLocallyER7wxEvent+0x3f) [0x7f7682bc495f]
37: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0xa1) [0x7f7682bc4a51]
38: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_ZN12wxEvtHandler18SafelyProcessEventER7wxEvent+0xb) [0x7f7682bc139b]
39: /lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0(_ZN10wxMenuBase9SendEventEii+0x83) [0x7f768280bea3]
40: /lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0(+0x2f31f4) [0x7f768272a1f4]
41: /lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_closure_invoke+0x16f) [0x7f7680af6d2f]
42: /lib/x86_64-linux-gnu/libgobject-2.0.so.0(+0x30c36) [0x7f7680b12c36]
43: /lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_signal_emit_valist+0x11a4) [0x7f7680b14614]
44: /lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_signal_emit+0x93) [0x7f7680b14863]
45: /lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_widget_activate+0x5c) [0x7f76811b4cbc]
46: /lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_menu_shell_activate_item+0x13e) [0x7f76810829ce]
47: /lib/x86_64-linux-gnu/libgtk-3.so.0(+0x266ca3) [0x7f7681082ca3]
48: /lib/x86_64-linux-gnu/libgtk-3.so.0(+0x3e6eb8) [0x7f7681202eb8]
49: /lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_signal_emit_valist+0x1290) [0x7f7680b14700]
50: /lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_signal_emit+0x93) [0x7f7680b14863]
51: /lib/x86_64-linux-gnu/libgtk-3.so.0(+0x3ae724) [0x7f76811ca724]
52: /lib/x86_64-linux-gnu/libgtk-3.so.0(+0x251680) [0x7f768106d680]
53: /lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_main_do_event+0xd3a) [0x7f768106e52a]
54: /lib/x86_64-linux-gnu/libgdk-3.so.0(+0x39743) [0x7f7680d4e743]
55: /lib/x86_64-linux-gnu/libgdk-3.so.0(+0x70f56) [0x7f7680d85f56]
56: /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x26b) [0x7f7682d90d3b]
57: /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0xaa6c8) [0x7f7682de56c8]
58: /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_loop_run+0x73) [0x7f7682d902b3]
59: /lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_main+0x9d) [0x7f7681064cfd]
60: /lib/x86_64-linux-gnu/libwx_gtk3u_core-3.0.so.0(_ZN14wxGUIEventLoop5DoRunEv+0x25) [0x7f76826bb165]
61: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_ZN15wxEventLoopBase3RunEv+0x31) [0x7f7682ae8e21]
62: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_ZN16wxAppConsoleBase8MainLoopEv+0x5a) [0x7f7682ac4b0a]
63: /lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0(_Z7wxEntryRiPPw+0x55) [0x7f7682b26b55]
64: darkradiant(+0x1782f2) [0x55c1eaf9d2f2]
65: /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f76818e4d90]
66: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f76818e4e40]
67: darkradiant(+0x184f95) [0x55c1eafa9f95]

 

I have a rtx 2060, running on Ubuntu 22.04, Kernel 5.15.0-56, Driver Version: 470.161.03.

I updated the driver version and even gave full permission to the engine folders, but the output is the same.

Link to comment
Share on other sites

3 hours ago, greebo said:

Can anybody confirm this crash? If it doesn't happen on other systems, it might be related to the resources/project config.

This happens even if I start a blank project, with both engines. 

Is there something that I can do related to the path where DR was installed? A configuration file perhaps?

Link to comment
Share on other sites

The actual crash occurs on this line of LightInspector.cpp:

   85  	void LightInspector::shaderSelectionChanged()
   86  	{
   87  	    // Get the selected shader
-> 88  	    auto ishader = _texSelector->getSelectedShader();

The _texSelector member is still NULL here, so this is a segfault.

The initialisation of _texSelector happens in setupTextureWidgets(), which is called unconditionally in the LightInspector constructor, so a missing method call is not the issue. However, the value of _texSelector is a newly-constructed MaterialSelector object, and this object takes a function pointer to the shaderSelectionChanged() in its constructor:

    _texSelector = new MaterialSelector(parent,
                                        std::bind(&LightInspector::shaderSelectionChanged, this),
                                        MaterialSelector::TextureFilter::Lights);

It appears that this is creating a race condition: the constructor of MaterialSelector is able to call the shaderSelectionChanged callback (presumably as a result of selection changes during its Populate() method), but it isn't actually safe to call shaderSelectionChanged() until after the MaterialSelector is fully constructed and assigned to the _texSelector member.

I think my preferred solution would be to remove the "selectionChanged" function parameter to the MaterialSelector constructor entirely, and replace it with a public signal_selectionChanged() which client code could connect to. This would have two advantages:

  1. No possibility of race condition, since you would have to construct the MaterialSelector before connecting to the signal.
  2. Signals are more powerful than manual std::function callbacks (e.g. they can auto-disconnect if the target object is destroyed) and are widely used throughout the codebase.

However, if anything currently relies on receiving selectionChanged callbacks during the MaterialSelector construction, this would no longer work. @greebo what do you think?

  • Thanks 1
Link to comment
Share on other sites

Fixed in Git revision a1f0c789f34b4bb11a132aaeb03a380da18fe6b5.

I tested switching light textures in the Light Inspector and switching brush textures on the Media tab, and everything still looks fine so hopefully nothing is broken as a result of switching MaterialSelector to use a sigc::signal instead of an explicit selectionChanged callback.

Link to comment
Share on other sites

I use the Linux 3.7.0 flatpack version, but I cannot reproduce the issue. If I press L the light inspector appears. No crash

Edit: Although the material preview doesn't show. It does show up when the light inspector is docked (after DR restart).

Edited by datiswous
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • MayheM

      Hello, Since this track is originally from TDM,i think it's better to ask here than TTLG. Do you guys have the full version of this ambient track?
      https://sndup.net/z4ty/
      https://sndup.net/qwhy/
      · 2 replies
    • DeTeEff

      Bachelor Mapping Challenge!
      The girlfriend will be away to her mum's place for almost a week, which means more mapping time for me! I'm planning a speed build. Hope it will go my way
      I'm starting by downloading 2.11. Don't know if I'm going to use any fancy new stuff. Just want to crack those itching map muscles that has gone dry and dead since almost a year's worth of no-mapping
      · 4 replies
    • kano

      The cool part of Canonical's Snap, is that my machine can now ray-trace an entire (simple) scene faster than it takes the web browser to start!
      · 5 replies
    • datiswous

      Fm idea (braindump)
      "Experience the life of a mission builder"
      Esentially there are finnished elements placed somewhere in storage in the game and you have to place them in the correct places, build some walls here and there, add guard routes, give them their correct speech lines, etc. Decorate the places.. all in-game. lots of fun.. 😉
      If you do it right in the end you can play the mission.
      (would be even cooler if a thief-ai could play the mission, making it some kind of tower-defence game)
       
      This first started as an idea for an aquarium builder mission where-in you have to fill an empty aquarium with sand, waterplants, castles water and swimming fish. But above idea is more fun.
       
      · 4 replies
    • JackFarmer

      Dear ChatGPT, What are The Builders in the Dark Mod?
       
      The Builders is a popular game mode in the video game community called "Dark Mod," which is a fan-made tribute to the classic "Thief" series of stealth games. In this game mode, players assume the role of builders who construct structures in a dark and ominous environment while trying to avoid detection by patrolling guards.
      The Builders game mode is unique in that it offers players the opportunity to create and design their own levels using the in-game tools and resources provided. Players can experiment with different building materials, construct intricate traps and puzzles, and create their own unique gameplay experiences.
      While The Builders game mode is not an official part of the Dark Mod, it has become one of the most popular and well-loved aspects of the game, thanks to its emphasis on creativity, strategy, and stealth.
       
      You guys did not know that, did you?
      · 2 replies
×
×
  • Create New...