Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freeze when finishing scenario #1992

Closed
Arcanister opened this issue Sep 14, 2017 · 6 comments
Closed

Freeze when finishing scenario #1992

Arcanister opened this issue Sep 14, 2017 · 6 comments
Assignees
Labels
Bug Issues involving unexpected behavior.

Comments

@Arcanister
Copy link
Contributor

Arcanister commented Sep 14, 2017

The bug seem to be reproducible with current wesnoth master and a week old build.

  1. Install Mountain Witch addon campaign, or save won't work.
  2. Load MoWi-Memory_of_the_Queen-Auto-Save37.gz
    (rename to .gz since github won't let upload .gz)
  3. Move elf child into the island on top of the map
  4. Click through dialogs
  5. Wesnoth freezes

#0 std::__shared_ptr<config const, (__gnu_cxx::_Lock_policy)2>::__shared_ptr (this=0x7fffffff93a0) at /usr/include/c++/5.3.0/bits/shared_ptr_base.h:878
#1 0x000000000273125e in std::shared_ptr::shared_ptr (this=0x7fffffff93a0) at /usr/include/c++/5.3.0/bits/shared_ptr.h:105
#2 0x00000000031b4f4a in vconfig::vconfig (this=0x7fffffff93a0) at src/variable.cpp:72
#3 0x00000000031b50f6 in vconfig::unconstructed_vconfig () at src/variable.cpp:118
#4 0x000000000305ec1b in luaW_checkvconfig (L=0x7fffd61e46a8, index=1, allow_missing=false) src/scripting/lua_common.cpp:822
#5 0x000000000305cfbc in lua_common::impl_vconfig_ipairs_iter (L=0x7fffd61e46a8) at src/scripting/lua_common.cpp:331
#6 0x0000000003362c1c in luaD_precall (L=0x7fffd61e46a8, func=0x7fffd9786f20, nresults=2) at src/lua/ldo.cpp:365
#7 0x000000000337ef31 in luaV_execute (L=0x7fffd61e46a8) at src/lua/lvm.cpp:1134
#8 0x0000000003363268 in luaD_call (L=0x7fffd61e46a8, func=0x7fffd9786ef0, nResults=1) at src/lua/ldo.cpp:496
#9 0x000000000337f869 in luaV_execute (L=0x7fffd61e46a8) at src/lua/lvm.cpp:1248
#10 0x0000000003363268 in luaD_call (L=0x7fffd61e46a8, func=0x7fffd4c5a4e0, nResults=0) at src/lua/ldo.cpp:496
#11 0x00000000033632c6 in luaD_callnoyield (L=0x7fffd61e46a8, func=0x7fffd4c5a4e0, nResults=0) at src/lua/ldo.cpp:506
#12 0x000000000335a108 in f_call (L=0x7fffd61e46a8, ud=0x7fffffffa2b0) at src/lua/lapi.cpp:942
#13 0x0000000003362171 in luaD_rawrunprotected (L=0x7fffd61e46a8, f=0x335a0d3 <f_call(lua_State*, void*)>, ud=0x7fffffffa2b0) at lua/ldo.cpp:142
#14 0x0000000003363a75 in luaD_pcall (L=0x7fffd61e46a8, func=0x335a0d3 <f_call(lua_State*, void*)>, u=0x7fffffffa2b0,
old_top=32, ef=16) at src/lua/ldo.cpp:727
#15 0x000000000335a1d7 in lua_pcallk (L=0x7fffd61e46a8, nargs=1, nresults=0, errfunc=-3, ctx=0, k=0x0) at src/lua/lapi.cpp:968

@gfgtdf
Copy link
Contributor

gfgtdf commented Sep 14, 2017

does the stacktrace end at entry 15? A longer strack trace could be helpful here,

Also a lua/wml stacktrace might be helpful, not sure how to get that in your case though.

@gfgtdf
Copy link
Contributor

gfgtdf commented Sep 14, 2017

Also, what makes you think that this is an engine bug and not a bug in the addon (Mountain Witch ) ?

@gfgtdf gfgtdf closed this as completed in 85b36d6 Sep 14, 2017
@Arcanister
Copy link
Contributor Author

Even if there is a bug in add-on, the game interface should not freeze, it should still allow to click menu items for example.

Still freezes after 85b36d6 though

@gfgtdf
Copy link
Contributor

gfgtdf commented Sep 14, 2017

Even if there is a bug in add-on, the game interface should not freeze, it should still allow to click menu items for example.

This would require a massive change to the engine (making wml code run in a seperate process/thread etc.) , which would probably create namy other bugs, as of currently codes like while true do end; will freeze the game and we have curently no plans to change that.

gfgtdf added a commit that referenced this issue Sep 14, 2017
in 1.12 [filter]x="" [/filter] filter machtes no units while in 1.13. it maches all units, this was likely caused by a6decea, this commit should also fix #1992 where this behaviour change caused an infinite [while] loop in an addons wml code.
@gfgtdf gfgtdf assigned gfgtdf and unassigned CelticMinstrel Sep 14, 2017
@CelticMinstrel
Copy link
Member

CelticMinstrel commented Sep 15, 2017

This would require a massive change to the engine (making wml code run in a seperate process/thread etc.) , which would probably create namy other bugs, as of currently codes like while true do end; will freeze the game and we have curently no plans to change that.

I think this would be easier than you'd think (barring loops coded in Lua); simply call out to the UI manager from various places in the logic, just like the AI already does in order to allow you to quit while it's working. (If I recall correctly, the call from AI is in the attack analysis function.)

@Arcanister
Copy link
Contributor Author

Arcanister commented Sep 15, 2017

The second commit fixes the particular problem with scenario.

@CelticMinstrel CelticMinstrel added the Bug Issues involving unexpected behavior. label Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues involving unexpected behavior.
Projects
None yet
Development

No branches or pull requests

3 participants