Jump to content

[Solved] Crashing when opening Inventory or Record


Recommended Posts

I just cloned and compiled/installed GemRB from the master branch on git about three days ago, so I believe that's 0.8.4? I have modded BG1 and BG2 together for the Baldur's Gate Trilogy. I am running Debian Linux.


Everything works great through character creation, saving, and playing the beginning of the game. But it crashes as soon as I try to open the Inventory or Player Record (the Map, Mage Spellbook, and Druid Spellbook all open fine). This happens whether I click on the icon or use the hotkey ('I' or 'R', respectively). I have attached my gemrb.log (GemRB.log). You will notice that it ends abruptly in the middle of a line. When I run it from a terminal the only additional output is 'Segmentation Fault'.


Any help in identifying the problem would be much appreciated. Thanks!




Link to comment

Hmm, so initially it worked and only later in the game they started crashing? Sounds like a mod added effect could be the culprit, since those two screens don't have much in common.


Can you rebuild with -DCMAKE_BUILD_TYPE=Debug and reproduce the crashes through gdb? It'll be almost impossible to address without stack traces.

Link to comment

Thanks for the quick reply, lynx!


All of the character creation stuff works fine, and once in Candlekeep I can play the game normally and even save it. But as soon as I try to open either the Inventory or the Player Record it crashes.


I rebuilt gemrb with the 'debug' option you listed. I ran the game and the same thing happened, but the GemRB.log looks exactly like before. How do I run it to get the stack traces and stuff? What do you mean by "through gdb"?




Link to comment

- install gdb

- run gemrb from the command line like before, but prepend gdb (like with nice or strace)

- a new gdb shell will open; type r as in run

- play the game until it crashes

- type bt, which is short for backtrace

- paste it here

Link to comment

Got it. Please find the log file attached (gdb.txt) and pasted below.

Starting program: /usr/local/bin/gemrb 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe8a7d700 (LWP 9989)]
[Thread 0x7fffe8a7d700 (LWP 9989) exited]
[New Thread 0x7fffe8a7d700 (LWP 9990)]
[New Thread 0x7fffe8a7d700 (LWP 9991)]
[Thread 0x7fffe8a7d700 (LWP 9990) exited]
[New Thread 0x7fffe827c700 (LWP 9992)]
[New Thread 0x7fffd37e7700 (LWP 9993)]
[New Thread 0x7fffd1c8c700 (LWP 9999)]

Thread 1 "gemrb" received signal SIGSEGV, Segmentation fault.
0x00007ffff7ad00a5 in GemRB::Label::SetAlignment (this=0x5555563ce7a0, 
    Alignment=33 '!')
    at /home/****/Games/BaldursGate/gemrb/gemrb/core/GUI/Label.cpp:88
88		if (Height <= font->LineHeight) {
#0  0x00007ffff7ad00a5 in GemRB::Label::SetAlignment (this=0x5555563ce7a0, 
    Alignment=33 '!')
    at /home/****/Games/BaldursGate/gemrb/gemrb/core/GUI/Label.cpp:88
#1  0x00007ffff7acfc83 in GemRB::Label::Label (this=0x5555563ce7a0, frame=..., 
    font=0x0, string=L"")
    at /home/****/Games/BaldursGate/gemrb/gemrb/core/GUI/Label.cpp:42
#2  0x00007fffed69280f in GemRB::CHUImporter::GetWindow (this=0x55555589cf50, 
    at /home/****/Games/BaldursGate/gemrb/gemrb/plugins/CHUImporter/CHUImporter.cpp:400
#3  0x00007ffff7a1b783 in GemRB::Interface::LoadWindow (this=0x555555768c80, 
    at /home/****/Games/BaldursGate/gemrb/gemrb/core/Interface.cpp:2658
#4  0x00007fffeb7a2af8 in GemRB_LoadWindow (args=0x7fffe912ba50)
    at /home/****/Games/BaldursGate/gemrb/gemrb/plugins/GUIScript/GUIScript.cpp:953
#5  0x00007fffeb278091 in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#6  0x00007fffeb3df15c in PyEval_EvalCodeEx ()
   from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#7  0x00007fffeb3335b0 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#8  0x00007fffeb2cb543 in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#9  0x00007fffeb3de587 in PyEval_CallObjectWithKeywords ()
   from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#10 0x00007fffeb7c71ad in GemRB::CallPythonObject (Function=0x7fffd2b91b18, 
    at /home/****/Games/BaldursGate/gemrb/gemrb/plugins/GUIScript/PythonHelpers.cpp:120
#11 0x00007fffeb7c7235 in GemRB::CallPython (Function=0x7fffd2b91b18, args=0x0)
    at /home/****/Games/BaldursGate/gemrb/gemrb/plugins/GUIScript/PythonHelpers.cpp:134
#12 0x00007fffeb7c70b4 in GemRB::PythonObjectCallback<GemRB::Control>::operator() (this=0x555555bcdd90, ctrl=0x555555a6ce80)
    at /home/****/Games/BaldursGate/gemrb/gemrb/plugins/GUIScript/PythonHelpers.cpp:98
#13 0x00007ffff7ac5f2e in GemRB::ControlEventHandler::operator() (
    this=0x7fffffffdf68, ctrl=0x555555a6ce80)
    at /home/****/Games/BaldursGate/gemrb/gemrb/core/GUI/Control.h:185
#14 0x00007ffff7ac5abd in GemRB::Control::RunEventHandler (
    this=0x555555a6ce80, handler=...)
    at /home/****/Games/BaldursGate/gemrb/gemrb/core/GUI/Control.cpp:166
#15 0x00007ffff7ac0701 in GemRB::Button::OnMouseUp (this=0x555555a6ce80, x=33, 
    y=14, Button=1, Mod=0)
    at /home/****/Games/BaldursGate/gemrb/gemrb/core/GUI/Button.cpp:531
#16 0x00007ffff7ac7075 in GemRB::EventMgr::MouseUp (this=0x55555577bdc0, x=36, 
    y=157, Button=1, Mod=0)
    at /home/****/Games/BaldursGate/gemrb/gemrb/core/GUI/EventMgr.cpp:338
#17 0x00007ffff5ff1754 in GemRB::SDLVideoDriver::ProcessEvent (
    this=0x5555557ad4e0, event=...)
    at /home/****/Games/BaldursGate/gemrb/gemrb/plugins/SDLVideo/SDLVideo.cpp:357
#18 0x00007ffff6049b80 in GemRB::SDL12VideoDriver::ProcessEvent (
    this=0x5555557ad4e0, event=...)
    at /home/****/Games/BaldursGate/gemrb/gemrb/plugins/SDLVideo/SDL12Video.cpp:276
#19 0x00007ffff5ff0f38 in GemRB::SDLVideoDriver::PollEvents (
    at /home/****/Games/BaldursGate/gemrb/gemrb/plugins/SDLVideo/SDLVideo.cpp:152
#20 0x00007ffff5ff0edc in GemRB::SDLVideoDriver::SwapBuffers (
    at /home/****/Games/BaldursGate/gemrb/gemrb/plugins/SDLVideo/SDLVideo.cpp:143
#21 0x00007ffff604981e in GemRB::SDL12VideoDriver::SwapBuffers (
    at /home/****/Games/BaldursGate/gemrb/gemrb/plugins/SDLVideo/SDL12Video.cpp:201
#22 0x00007ffff7a13f3d in GemRB::Interface::Main (this=0x555555768c80)
    at /home/****/Games/BaldursGate/gemrb/gemrb/core/Interface.cpp:1017
#23 0x000055555555506b in main (argc=1, argv=0x7fffffffe338)
    at /home/****/Games/BaldursGate/gemrb/gemrb/GemRB.cpp:100

Thanks again for your help.




Link to comment

It looks like a gui mod has a reference to an invalid or missing font. You'd need to break in the label's construction in CHUImporter::GetWindow, but it would be an involved process.


You can instead first try just working around it.

Open gemrb/core/GUI/Label.cpp at line 86 and change the first if block to:

    if (!font || Height <= font->LineHeight) {

and run make again (and make install, if you're not running from the build dir)

Link to comment

Success! You did it! lynx, I cannot thank you enough for your patient and detailed help. I recently rebuilt my system from scratch, and I opted not to back up all the fonts I used to have installed, so it makes sense that that could be a hangup.


Out of curiosity, two questions if you don't mind:

  1. How did you figure out a font was the problem?
  2. Is there anyway to tell which font might be missing? I'm not overly concerned, now that the game is running, just curious.

Thanks again!




Link to comment

From the backtrace data and the code. To find which font/gui is the problem, more debugging would be needed as written above. Do note that this is not affected by system fonts and the usual ones were found, so it's quite curious. Maybe one is corrupted.

Link to comment


This topic is now archived and is closed to further replies.

  • Create New...