gemrb / gemrb

GemRB is a portable open-source implementation of Bioware’s Infinity Engine.
https://gemrb.org
GNU General Public License v2.0
991 stars 185 forks source link

[subviews] Opening a bag in HoW broken #395

Closed MarcelHB closed 5 years ago

MarcelHB commented 5 years ago

Describe the bug In IWD HoW, have some kind of bag, let's say BAGH01. Opening the bag causes a script error. Looks related to #370.

[Python]: no control with id=110
[Python/ERROR]: Traceback (most recent call last):
[Python/ERROR]:   File ".\gemrb\GUIScripts\GUISTORE.py", line 218, in OpenStoreWindow
[Python/ERROR]:     store_funcs[store_buttons[0]] ()
[Python/ERROR]:   File ".\gemrb\GUIScripts\GUICommonWindows.py", line 1377, in ret
[Python/ERROR]:     initer(window)
[Python/ERROR]:   File ".\gemrb\GUIScripts\GUISTORE.py", line 383, in InitStoreShoppingWindow
[Python/ERROR]:     IE_FONT_ALIGN_LEFT|IE_FONT_ALIGN_TOP|IE_FONT_SINGLE_LINE)
[Python/ERROR]:   File ".\gemrb\GUIScripts\GUIClasses.py", line 350, in CreateLabel
[Python/ERROR]:     return self.CreateControl(labelid, IE_GUI_LABEL, 0, 0, frame['w'], frame['h'], args)
[Python/ERROR]:   File ".\gemrb\GUIScripts\GUIClasses.py", line 147, in CreateControl
[Python/ERROR]:     return self.CreateSubview(id, type, frame, *args)
[Python/ERROR]:   File ".\gemrb\GUIScripts\GUIClasses.py", line 159, in CreateSubview
[Python/ERROR]:     view = CreateView(id, type, frame, *args)
[Python/ERROR]: SystemError: error return without exception set
bradallred commented 5 years ago

can you re run this with a build after 226b5cf to get a better error?

lynxlynxlynx commented 5 years ago

no control with id=110 <-- this is the same problematic control as in my last store bug report (aliases).

MarcelHB commented 5 years ago

Sure, here you go:

[Python]: no control with id=110
[GUIScript/ERROR]: Runtime Error:
[Python/ERROR]: Traceback (most recent call last):
[Python/ERROR]:   File ".\GUIScripts\GUISTORE.py", line 218, in OpenStoreWindow
[Python/ERROR]:     store_funcs[store_buttons[0]] ()
[Python/ERROR]:   File ".\GUIScripts\GUICommonWindows.py", line 1377, in ret
[Python/ERROR]:     initer(window)
[Python/ERROR]:   File ".\GUIScripts\GUISTORE.py", line 383, in InitStoreShoppingWindow
[Python/ERROR]:     IE_FONT_ALIGN_LEFT|IE_FONT_ALIGN_TOP|IE_FONT_SINGLE_LINE)
[Python/ERROR]:   File ".\GUIScripts\GUIClasses.py", line 350, in CreateLabel
[Python/ERROR]:     return self.CreateControl(labelid, IE_GUI_LABEL, 0, 0, frame['w'], frame['h'], args)
[Python/ERROR]:   File ".\GUIScripts\GUIClasses.py", line 147, in CreateControl
[Python/ERROR]:     return self.CreateSubview(id, type, frame, *args)
[Python/ERROR]:   File ".\GUIScripts\GUIClasses.py", line 159, in CreateSubview
[Python/ERROR]:     view = CreateView(id, type, frame, *args)
[Python/ERROR]: RuntimeError: Cannot construct object with null ref.
bradallred commented 5 years ago

no control with id=110 <-- this is the same problematic control as in my last store bug report (aliases).

but that didn't mater as you can see my fix for that issue still outputs that same message. its just garbage that needs to be cleaned up it wasn't an actual problem in your case at all. I doubt its an issue here either since I see no reference to it in the GUISTORE.

lynxlynxlynx commented 5 years ago

If you mean the CHU, then of course not, it's a temporary ID in master.

bradallred commented 5 years ago

and it's useless garbage here AFICT. You are going to get that message anytime you open up the store. It can't be a problem unless something tries to reference STODONAT and nothing ever does. I mean delete that entry from the map and see that everything still works that works with it and everything that doesn't still doesn't.

bradallred commented 5 years ago

@MarcelHB would you mind trying that now?

MarcelHB commented 5 years ago

Hm, now I get crashes when loading the game:

Thread 1 received signal SIGSEGV, Segmentation fault.
GemRB::Window::RedrawControls (this=0x0, VarName=0x5f2f1d0 "SelectedWindow",
    Sum=0)
    at ./gemrb/core/GUI/Window.cpp:209
209             for (std::set<Control *>::iterator c = Controls.begin(); c != Controls.end(); ++c) {
(gdb) bt
#0  GemRB::Window::RedrawControls (this=0x0,
    VarName=0x5f2f1d0 "SelectedWindow", Sum=0)
    at ./gemrb/core/GUI/Window.cpp:209
#1  0x0000000001068e4d in GemRB_Control_SetVarAssoc (self=<optimized out>,
    args=<optimized out>)
    at ./gemrb/plugins/GUIScript/GUIScript.cpp:1872
#2  0x000000001e0c3de9 in python27!PyCFunction_Call ()
   from C:\Windows\system32\python27.dll
#3  0x000000001e11425a in python27!PyEval_GetGlobals ()
   from C:\Windows\system32\python27.dll
#4  0x000000001e11805f in python27!PyEval_EvalFrameEx ()
   from C:\Windows\system32\python27.dll
#5  0x000000001e119822 in python27!PyEval_EvalCodeEx ()
   from C:\Windows\system32\python27.dll
#6  0x000000001e112e99 in python27!PyEval_GetFuncDesc ()
   from C:\Windows\system32\python27.dll
#7  0x000000001e114804 in python27!PyEval_GetGlobals ()
   from C:\Windows\system32\python27.dll
#8  0x000000001e117f84 in python27!PyEval_EvalFrameEx ()
   from C:\Windows\system32\python27.dll
#9  0x000000001e119822 in python27!PyEval_EvalCodeEx ()
   from C:\Windows\system32\python27.dll
#10 0x000000001e112e99 in python27!PyEval_GetFuncDesc ()
   from C:\Windows\system32\python27.dll
#11 0x000000001e114804 in python27!PyEval_GetGlobals ()
   from C:\Windows\system32\python27.dll
#12 0x000000001e117f84 in python27!PyEval_EvalFrameEx ()
   from C:\Windows\system32\python27.dll
#13 0x000000001e119822 in python27!PyEval_EvalCodeEx ()
   from C:\Windows\system32\python27.dll
#14 0x000000001e112e99 in python27!PyEval_GetFuncDesc ()
   from C:\Windows\system32\python27.dll
#15 0x000000001e114804 in python27!PyEval_GetGlobals ()
   from C:\Windows\system32\python27.dll
#16 0x000000001e117f84 in python27!PyEval_EvalFrameEx ()
   from C:\Windows\system32\python27.dll
#17 0x000000001e119822 in python27!PyEval_EvalCodeEx ()
   from C:\Windows\system32\python27.dll
#18 0x000000001e112e99 in python27!PyEval_GetFuncDesc ()
   from C:\Windows\system32\python27.dll
#19 0x000000001e114804 in python27!PyEval_GetGlobals ()
   from C:\Windows\system32\python27.dll
#20 0x000000001e117f84 in python27!PyEval_EvalFrameEx ()
   from C:\Windows\system32\python27.dll
#21 0x000000001e119822 in python27!PyEval_EvalCodeEx ()
   from C:\Windows\system32\python27.dll
#22 0x000000001e0b58a3 in python27!PyFunction_SetClosure ()
   from C:\Windows\system32\python27.dll
#23 0x000000001e08daf5 in python27!PyObject_Call ()
   from C:\Windows\system32\python27.dll
#24 0x000000001e112c28 in python27!PyEval_CallObjectWithKeywords ()
   from C:\Windows\system32\python27.dll
#25 0x000000000105fcd5 in GemRB::GUIScript::RunFunction (
    this=this@entry=0x794970,
    moduleName=moduleName@entry=0x69f9d16f <GemRB::StatValues+1903> "Game",
    functionName=0x69f9d853 <GemRB::StatValues+3667> "EnterGame",
    pArgs=pArgs@entry=0x0, report_error=report_error@entry=true)
    at ./gemrb/plugins/GUIScript/GUIScript.cpp:13511
#26 0x00000000010603d0 in GemRB::GUIScript::RunFunction (this=0x794970,
    moduleName=0x69f9d16f <GemRB::StatValues+1903> "Game",
    functionName=<optimized out>, report_error=true, intparam=-1)
    at ./gemrb/plugins/GUIScript/GUIScript.cpp:13529
#27 0x0000000069ef43fa in GemRB::Interface::HandleFlags (
    this=this@entry=0x7724b0)
    at ./gemrb/core/Interface.cpp:590
#28 0x0000000069ef81b8 in GemRB::Interface::Main (this=0x7724b0)
    at ./gemrb/core/Interface.cpp:963
#29 0x0000000000402bf8 in main (argc=3, argv=0x752a40)
    at ./gemrb/GemRB.cpp:99
bradallred commented 5 years ago

this now might be another manifestation of the whole #386 at this point. I'll have to dl IWD and get that fixed.

bradallred commented 5 years ago

@MarcelHB the NULL dereference is fixed, but I have no idea if there is something else for IWD1. I'm checking the other games I do have installed.

MarcelHB commented 5 years ago

Can I help by doing something particular, then?

bradallred commented 5 years ago

not at this time. I see something wrong that might fix this.

bradallred commented 5 years ago

ok, I think this should work now.

nah, still something wrong somwhere

bradallred commented 5 years ago

Well, it might work now. It seems the problem I am encountering now is unrelated to this or the changes surrounding this issue.

bradallred commented 5 years ago

ok, it's a master bug. opening a new issue.

bradallred commented 5 years ago

@MarcelHB is this still an issue?

MarcelHB commented 5 years ago

Will test it later.

MarcelHB commented 5 years ago

The script error is gone, yes.

But there is a different issue of functional nature now. I must test how this is related to master first, I'll put it in a new report then.