Game Crashes on changing desktops

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
AvovA
Posts: 14
Joined: April 17th, 2011, 9:26 pm

Game Crashes on changing desktops

Post by AvovA »

To reproduce: Start Wesnoth fullscreen, change to a different virtual desktop.
Sometimes it does not crash right way. Repeat until it crashes.

Code: Select all

OS: Linux Debian stable. Wesnoth: 1.14.5, but the latest development version also crashes. Language: English.
Build: The Battle for Wesnoth version 1.14.5
Running on Debian GNU/Linux 10 (buster)

Game paths
==========

Data dir:        /usr/share/games/wesnoth/1.14
User config dir: /home/USER/.config/wesnoth-1.14
User data dir:   /home/USER/.config/wesnoth-1.14
Saves dir:       /home/USER/.config/wesnoth-1.14/saves
Add-ons dir:     /home/USER/.config/wesnoth-1.14/data/add-ons
Cache dir:       /home/USER/.config/wesnoth-1.14/cache

Libraries
=========

Boost:             1.67
OpenSSL/libcrypto: 1.1.1  (runtime 1.1.1d)
Cairo:             1.16.0 (runtime 1.16.0)
Pango:             1.42.3 (runtime 1.42.3)
SDL:               2.0.8  (runtime 2.0.9)
SDL_image:         2.0.3  (runtime 2.0.4)
SDL_mixer:         2.0.2  (runtime 2.0.4)
SDL_ttf:           2.0.14 (runtime 2.0.15)

Features
========

Experimental OpenMP support:    yes
JPG screenshots:                yes
Lua console completion:         yes
Legacy bidirectional rendering: yes
D-Bus notifications back end:   yes

Code: Select all

Game log: wesnoth
Battle for Wesnoth v1.14.5
Started on Thu Jun 10 10:34:50 2021


Data directory:               /usr/share/games/wesnoth/1.14
User configuration directory: /home/USER/.config/wesnoth-1.14
User data directory:          /home/USER/.config/wesnoth-1.14
Cache directory:              /home/USER/.config/wesnoth-1.14/cache

Setting mode to 1920x1080
Checking lua scripts... ok
Segmentation fault


gdb backtrace:Thread 1 "wesnoth" received signal SIGSEGV, Segmentation fault.
0x00007ffff7ee074f in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
(gdb) bt
#0  0x00007ffff7ee074f in  () at /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#1  0x00007ffff7ed4466 in  () at /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#2  0x00007ffff7f011e5 in  () at /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#3  0x0000555555d00ac7 in sdl_blit(surface const&, SDL_Rect*, surface&, SDL_Rect*) (dst_rect=0x7fffffffcb70, dst=..., src_rect=0x0, src=...)
    at ./src/sdl/surface.hpp:73
#4  0x0000555555d00ac7 in gui2::canvas::blit(surface&, SDL_Rect) (this=this@entry=0x555556aa5540, surf=..., rect=...) at ./src/gui/core/canvas.cpp:1451
#5  0x00005555561b1d47 in gui2::panel::impl_draw_background(surface&, int, int) (this=0x555556f0dee0, frame_buffer=..., x_offset=0, y_offset=0)
    at ./src/gui/widgets/styled_widget.hpp:258
#6  0x0000555555a052fd in gui2::widget::draw_background(surface&, int, int)
    (this=0x555556f0dee0, frame_buffer=..., x_offset=x_offset@entry=0, y_offset=y_offset@entry=0) at ./src/gui/widgets/widget.cpp:380
#7  0x00005555561f149f in gui2::window::draw() (this=0x555556f0dee0) at ./src/gui/widgets/window.cpp:751
#8  0x0000555555d0ce21 in std::function<void (gui2::widget&, gui2::event::ui_event, bool&, bool&)>::operator()(gui2::widget&, gui2::event::ui_event, bool&, bool&) const (__args#3=@0x7fffffffceb0: false, __args#2=@0x7fffffffceac: false, __args#1=<optimized out>, __args#0=..., this=0x55555746d840)
    at /usr/include/c++/8/bits/std_function.h:682
#9  0x0000555555d0ce21 in gui2::event::implementation::fire_event<std::function<void (gui2::widget&, gui2::event::ui_event, bool&, bool&)>>(gui2::event::ui_event, std::vector<std::pair<gui2::widget*, gui2::event::ui_event>, std::allocator<std::pair<gui2::widget*, gui2::event::ui_event> > >&, gui2::widget*, gui2::widget*) (w=0x555556f0dee0, dispatcher=0x555556f0dee0, event_chain=std::vector of length 0, capacity 0, event=gui2::event::DRAW)
    at ./src/gui/core/event/dispatcher_private.hpp:434
#10 0x0000555555d0ce21 in gui2::event::fire_event<std::function<void (gui2::widget&, gui2::event::ui_event, bool&, bool&)>>(gui2::event::ui_event, gui2::event::dispatcher*, gui2::widget*) (w=0x555556f0dee0, d=0x555556f0dee0, event=gui2::event::DRAW) at ./src/gui/core/event/dispatcher_private.hpp:506
#11 0x0000555555d0ce21 in gui2::event::dispatcher::fire(gui2::event::ui_event, gui2::widget&)
    (this=this@entry=0x555556f0def0, event=event@entry=gui2::event::DRAW, target=...) at ./src/gui/core/event/dispatcher.cpp:147
#12 0x00005555559a524f in gui2::event::sdl_event_handler::draw() (this=0x5555574132c0) at ./src/gui/core/event/handler.cpp:597
#13 0x00005555559a71f0 in gui2::event::sdl_event_handler::handle_event(SDL_Event const&) (this=0x5555574132c0, event=...)
    at ./src/gui/core/event/handler.cpp:425
#14 0x000055555608915c in events::pump() () at ./src/events.cpp:650
#15 0x00005555561f1a6a in gui2::window::show(bool, unsigned int) (this=0x555556f0dee0, restore=<optimized out>, auto_close_timeout=auto_close_timeout@entry=0)
    at ./src/gui/widgets/window.cpp:550
#16 0x00005555559b64e3 in gui2::dialogs::modal_dialog::show(unsigned int) (this=this@entry=0x7fffffffd6e0, auto_close_time=auto_close_time@entry=0)
    at /usr/include/c++/8/bits/unique_ptr.h:342
#17 0x0000555555926b91 in do_gameloop (args=std::vector of length 1, capacity 1 = {...}) at ./src/wesnoth.cpp:862
#18 0x0000555555926b91 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at ./src/wesnoth.cpp:1153
(gdb)
Last edited by Pentarctagon on June 10th, 2021, 4:42 pm, edited 1 time in total.
Reason: [code]
AvovA
Posts: 14
Joined: April 17th, 2011, 9:26 pm

Re: Game Crashes on changing desktops

Post by AvovA »

User avatar
octalot
General Code Maintainer
Posts: 777
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Game Crashes on changing desktops

Post by octalot »

Which desktop environment and window manager are you using?
AvovA
Posts: 14
Joined: April 17th, 2011, 9:26 pm

Re: Game Crashes on changing desktops

Post by AvovA »

Openbox
white_haired_uncle
Posts: 1093
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: Game Crashes on changing desktops

Post by white_haired_uncle »

I've seen this on 1.14 and 1.15 in multiple environments, and not only when changing desktops or necessarily in full screen.

SL6 with Window Maker, ssh -X to Ubuntu (playing Wesnoth on the Ubuntu machine, directing display to SL6).

SL6 with Window Maker, playing Wesnoth in a Ubuntu VM (libvirtd).

Windows 10. Switch over to a game of Solitare or a VNC connection or whatever and Wesnoth will be hung when I come back.

This does not happen 100% of the time, or anywhere close. The best chance I have to reproduce it is starting a new scenario or loading a saved game, though occasionally when starting a new turn. Basically, there are times when Wesnoth is going to do some things for a bit, and I don't feel like just watching a blank screen, so I go do something else for a bit. If I come back while it's still working, things are generally okay. But if it was ready for me, and didn't have its window actively in focus, it will hang or occasionally crash.

I think the easiest way to see this is probably during a scenario where there's a long delay between turns, like AI factions fighting each other or just a ton of AI units to move. Go to another window and come back to Wesnoth after the turn has changed.

I would GUESStimate that the chance to reproduce is around 1-2%. It's pretty rare, but happens enough to be annoying over a long scenario where you're constantly switching back and forth.
User avatar
octalot
General Code Maintainer
Posts: 777
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Game Crashes on changing desktops

Post by octalot »

white_haired_uncle wrote: June 26th, 2021, 4:56 pm The best chance I have to reproduce it is starting a new scenario or loading a saved game, though occasionally when starting a new turn.
Are you using the keyboard to switch desktops? I ask because #4447 is a race condition with keyboard input on the black loading screen.

That wouldn't explain a crash while starting a new turn, which might point to another bug.
white_haired_uncle
Posts: 1093
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: Game Crashes on changing desktops

Post by white_haired_uncle »

octalot wrote: June 27th, 2021, 5:26 pm
white_haired_uncle wrote: June 26th, 2021, 4:56 pm The best chance I have to reproduce it is starting a new scenario or loading a saved game, though occasionally when starting a new turn.
Are you using the keyboard to switch desktops? I ask because #4447 is a race condition with keyboard input on the black loading screen.

That wouldn't explain a crash while starting a new turn, which might point to another bug.
When I was using ssh with X redirect to play BFW on another machine, yes, I used keyboard shortcuts to leave from and return to the desktop with BFW.

When I would see the issue with BFW running in a VM, I used a keyboard combination to release the mouse/keyboard, then the mouse to bring focus to a different window (or keyboard to switch desktops).

In Windows, I use the taskbar.

BTW, if the OP and I are seeing the same issue, I suspect that while we both noticed it first when changing desktops, the actual issue is BFW not having focus at some critical point, and changing desktops is just one way to achieve this. These days I see the issue most often when I'm playing BFW on Windows 10. On scenarios where turn/scenario changes take a long time, I'll often have Solitare open and switch to that via the taskbar (BFW still open and mostly visible below). Once the new turn is ready, and I'm ready to switch back, I'll bring BFW back to focus and it will often be "not responding"
AvovA
Posts: 14
Joined: April 17th, 2011, 9:26 pm

Re: Game Crashes on changing desktops

Post by AvovA »

With SDL debug packages from Debian there is a little bit more info:

Code: Select all

Data directory:               /usr/share/games/wesnoth/1.14
User configuration directory: /home/USER/.config/wesnoth-1.14
User data directory:          /home/USER/.config/wesnoth-1.14
Cache directory:              /home/USER/.config/wesnoth-1.14/cache

[New Thread 0x7fffdf364640 (LWP 3125005)]
[New Thread 0x7fffdf323640 (LWP 3125006)]
Setting mode to 1920x1080
[New Thread 0x7fffdc95f640 (LWP 3125007)]
[Thread 0x7fffdc95f640 (LWP 3125007) exited]
Checking lua scripts... ok

Thread 1 "wesnoth" received signal SIGSEGV, Segmentation fault.
BlitRGBtoRGBPixelAlphaMMX (info=<optimized out>) at ./src/video/SDL_blit_A.c:352
352	./src/video/SDL_blit_A.c: No such file or directory.
(gdb) bt
#0  BlitRGBtoRGBPixelAlphaMMX (info=<optimized out>) at ./src/video/SDL_blit_A.c:352
#1  0x00007ffff7ea0c01 in SDL_SoftBlit (src=0x55555702e400, srcrect=0x7fffffffc770, dst=0x555556e5f4c0, dstrect=0x7fffffffc7d0) at ./src/video/SDL_blit.c:88
#2  0x00007ffff7ed4bbc in SDL_UpperBlit_REAL (dstrect=0x7fffffffc7d0, dst=0x555556e5f4c0, srcrect=<optimized out>, src=0x55555702e400)
    at ./src/video/SDL_surface.c:733
#3  SDL_UpperBlit_REAL (src=0x55555702e400, srcrect=<optimized out>, dst=0x555556e5f4c0, dstrect=0x7fffffffc7d0) at ./src/video/SDL_surface.c:641
#4  0x0000555555d4a2a7 in sdl_blit(surface const&, SDL_Rect*, surface&, SDL_Rect*) (dst_rect=0x7fffffffc7d0, dst=..., src_rect=0x0, src=...)
    at ./src/sdl/surface.hpp:91
#5  gui2::canvas::blit(surface&, SDL_Rect) (this=0x555556d432f0, surf=..., rect=...) at ./src/gui/core/canvas.cpp:1457
#6  0x00005555562ba89f in gui2::window::draw() (this=0x55555745f7c0) at ./src/gui/widgets/window.cpp:750
#7  0x0000555555d555bb in std::function<void (gui2::widget&, gui2::event::ui_event, bool&, bool&)>::operator()(gui2::widget&, gui2::event::ui_event, bool&, bool&) const (__args#3=@0x7fffffffc917: false, __args#2=@0x7fffffffc916: false, __args#1=gui2::event::DRAW, __args#0=..., this=0x5555575b0890)
    at /usr/include/c++/10/bits/std_function.h:622
#8  gui2::event::implementation::fire_event<std::function<void (gui2::widget&, gui2::event::ui_event, bool&, bool&)>>(gui2::event::ui_event, std::vector<std::pair<gui2::widget*, gui2::event::ui_event>, std::allocator<std::pair<gui2::widget*, gui2::event::ui_event> > >&, gui2::widget*, gui2::widget*)
    (event=event@entry=gui2::event::DRAW, event_chain=std::vector of length 0, capacity 0, dispatcher=dispatcher@entry=0x55555745f7c0, w=w@entry=0x55555745f7c0) at ./src/gui/core/event/dispatcher_private.hpp:434
#9  0x0000555555d559bf in gui2::event::fire_event<std::function<void (gui2::widget&, gui2::event::ui_event, bool&, bool&)>>(gui2::event::ui_event, gui2::event::dispatcher*, gui2::widget*) (event=gui2::event::DRAW, d=<optimized out>, w=0x55555745f7c0) at ./src/gui/core/event/dispatcher_private.hpp:506
#10 0x0000555555988a3f in gui2::event::sdl_event_handler::draw() (this=0x55555756bd80) at ./src/gui/core/event/handler.cpp:597
#11 0x000055555598ac58 in gui2::event::sdl_event_handler::handle_event(SDL_Event const&) (this=0x55555756bd80, event=...)
    at ./src/gui/core/event/handler.cpp:425
#12 0x00005555561452b4 in events::pump() () at ./src/events.cpp:700
#13 0x00005555562baf81 in gui2::window::show(bool, unsigned int) (this=0x55555745f7c0, restore=<optimized out>, auto_close_timeout=auto_close_timeout@entry=0)
    at ./src/gui/widgets/window.cpp:549
#14 0x00005555559982e2 in gui2::dialogs::modal_dialog::show(unsigned int) (this=this@entry=0x7fffffffd490, auto_close_time=auto_close_time@entry=0)
    at /usr/include/c++/10/bits/unique_ptr.h:173
#15 0x000055555590ad40 in do_gameloop (args=std::vector of length 1, capacity 1 = {...}) at ./src/wesnoth.cpp:840
#16 main(int, char**) (argc=<optimized out>, argv=<optimized out>) at ./src/wesnoth.cpp:1068


I am not sure how to get more debug info on SDL without compiling it from scratch myself.
Anyway, it looks exactly like the crash from https://github.com/wesnoth/wesnoth/issues/3716
Post Reply