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

almost (?) reproducible complex crash involving the whiteboard (GNA #24020) #1517

Closed
wesnoth-bugs opened this issue May 8, 2017 · 3 comments
Labels
Bug Issues involving unexpected behavior. Confirmed Issues that have been successfully reproduced by at least one developer. Whiteboard Issues with the Planning Mode (a.k.a. Whiteboard) feature.

Comments

@wesnoth-bugs
Copy link

Original submission by anonymissimus on 2015-11-03

  1. Start a networked MP game with 3 clients 1, 2, 3. 3 is host, 1 and 3 are allied.

  2. While it is client 1's turn, plan actions with client 3: 2 recruits and moving the leader to a village.

  3. End client 1's turn so it's now client 2's turn. See attached screenshot for what it looks like from client 3's perspective now. The fighter is the first recruit, archer second.

  4. Switch to client 3 and delete the planned leader move.

  5. Delete the planned fighter recruit.

  6. Plan to recruit a fighter on the same spot the previous fighter had been.

  7. Repeat steps 5 and 6 until the game crashes. It always happened when trying to delete, with a deterministic backtrace, but not always after the same number of repeats I think. Most of the time, I had to do 2 deletes and 1 recruits following step 6.


20151103 22:37:20 error engine: Trying to add  - Elvish Fighter-4294967293 - 4294967293 (5,13) over  - Elvish Archer-4294967293 - 4294967293 (5,12). The new unit will be assigned underlying_id=4 to prevent duplicate id conflicts.

20151103 22:37:20 warning unit: assigning new id to clone of generic unit Elvish Fighter-4294967293



Program received signal SIGSEGV, Segmentation fault.

0x0000000001146a5d in boost::detail::atomic_increment (pw=0x16) at /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:66

66	    );

(gdb) bt

#0  0x0000000001146a5d in boost::detail::atomic_increment (pw=0x16) at /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:66

#1  0x0000000001146b2a in boost::detail::sp_counted_base::add_ref_copy (this=0xe) at /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:134

#2  0x0000000001146c39 in boost::detail::shared_count::shared_count (this#0x7ffffffecac8, r...) at /usr/include/boost/smart_ptr/detail/shared_count.hpp:382

#3  0x0000000001a3393f in boost::shared_ptr<wb::action>::shared_ptr (this=0x7ffffffecac0) at /usr/include/boost/smart_ptr/shared_ptr.hpp:328

#4  0x0000000001a3289a in wb::highlighter::get_delete_target (this=0x6b20df0) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/whiteboard/highlighter.cpp:244

#5  0x0000000001a3e445 in wb::manager::contextual_delete (this=0x7bf6ef0) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/whiteboard/manager.cpp:1017

#6  0x00000000018ec78e in playsingle_controller::whiteboard_delete_action (this=0x7ffffffedfd0) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/playsingle_controller.cpp:247

#7  0x0000000001b92aad in hotkey::command_executor::execute_command (this#0x7ffffffedfd0, cmd...) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/hotkey/command_executor.cpp:234

#8  0x00000000018d4782 in play_controller::execute_command (this#0x7ffffffedfd0, cmd..., index=0) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/play_controller.cpp:885

#9  0x0000000001b94e8e in hotkey::execute_command (disp#..., command..., executor#0x7ffffffedfd0, index0) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/hotkey/command_executor.cpp:583

#10 0x0000000001b93bda in hotkey::command_executor::show_menu (this#0x7ffffffedfd0, items_arg..., xloc#297, yloc378, gui=...)

    at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/hotkey/command_executor.cpp:349

#11 0x00000000018d6f5e in play_controller::show_menu (this#0x7ffffffedfd0, items_arg..., xloc#297, yloc378, context_menu#true, disp...)

    at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/play_controller.cpp:1292

#12 0x0000000001577f9f in controller_base::handle_event (this#0x7ffffffedfd0, event...) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/controller_base.cpp:95

#13 0x0000000001b75148 in events::pump () at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/events.cpp:387

#14 0x0000000001578a7c in controller_base::play_slice (this#0x7ffffffedfd0, is_delay_enabledtrue) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/controller_base.cpp:207

#15 0x00000000018ea382 in playmp_controller::play_network_turn (this=0x7ffffffedfd0) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/playmp_controller.cpp:528

#16 0x00000000018effcb in playsingle_controller::play_side (this=0x7ffffffedfd0) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/playsingle_controller.cpp:740

#17 0x00000000018e8339 in playmp_controller::play_side (this=0x7ffffffedfd0) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/playmp_controller.cpp:103

#18 0x00000000018efa6e in playsingle_controller::play_turn (this=0x7ffffffedfd0) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/playsingle_controller.cpp:640

#19 0x00000000018ee0b9 in playsingle_controller::play_scenario (this#0x7ffffffedfd0, story..., skip_replay=false) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/playsingle_controller.cpp:450

#20 0x00000000018e2e98 in playmp_scenario (game_config#..., level0x7ffffffeed90, disp#..., state_of_game..., story#..., skip_replayfalse, blindfold_replay=false, 

    io_type#@0x7ffffffee834: IO_SERVER, end_level...) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/playcampaign.cpp:292

#21 0x00000000018e42e4 in play_game (disp#..., gamestate..., game_config#..., io_typeIO_SERVER, skip_replay#false, network_gametrue, blindfold_replay=false)

    at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/playcampaign.cpp:455

#22 0x000000000182f7e2 in enter_connect_mode (disp#..., game_config..., state#..., params..., local_players_only=false) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/multiplayer.cpp:507

#23 0x0000000001830051 in enter_configure_mode (disp#..., game_config..., state#..., params..., local_players_only=false) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/multiplayer.cpp:601

#24 0x000000000182fc8a in enter_create_mode (disp#..., game_config..., state#..., local_players_onlyfalse) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/multiplayer.cpp:561

#25 0x0000000001830a87 in enter_lobby_mode (disp#..., game_config..., state=...) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/multiplayer.cpp:715

#26 0x0000000001832c0c in mp::start_client (disp#..., game_config..., state#..., host...) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/multiplayer.cpp:893

#27 0x0000000001645d00 in game_controller::play_multiplayer (this=0x2695a10) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/game_controller.cpp:869

#28 0x00000000011449fa in do_gameloop (args=...) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/game.cpp:631

#29 0x0000000001145360 in main (argc#4, argv0x7fffffffdba8) at /media/HDI3_SOURCE_NTFS/wesnoth-code/src/game.cpp:816

(Reproduced on Lubuntu 14.04)
Release: 1.12.4+dev@2212e7c
Priority: 5 - Normal
Severity: 3 - Normal

@wesnoth-bugs wesnoth-bugs added Bug Issues involving unexpected behavior. Linux OS-specific issues that apply to Linux-based operating systems. Whiteboard Issues with the Planning Mode (a.k.a. Whiteboard) feature. labels May 8, 2017
@wesnoth-bugs
Copy link
Author

Modified on 2015-11-03

anonymissimus wrote:

Screenshot mentioned in opening post is here: http://postimg.org/image/nzll318jz/

@wesnoth-bugs
Copy link
Author

Modified on 2015-11-04

gfgtdf wrote:

I could also reproduce this on 1.13.1+dev with only 2 sides which are not allied (removed side 2 of previous example and let side 1 and 3 be enemies)

I wonder whether the crash is caused by the error from the stderr.

@Wedge009 Wedge009 added Confirmed Issues that have been successfully reproduced by at least one developer. and removed Linux OS-specific issues that apply to Linux-based operating systems. labels May 9, 2017
gfgtdf added a commit that referenced this issue May 5, 2018
the wb recruit actions store temp units with fake ids and live longer
than a turn, so resetting the underlying id counter between turns might
result in dublicate id errors in wb recruit actions ( #1517 ), which
might lead to errors later.

With this it is of course possible to get erros when more than 2^31 (or
2^63 on a 64 bit wesnoth version.) fake units are generated during a
game, but that is less likely.
Vultraz pushed a commit that referenced this issue May 5, 2018
the wb recruit actions store temp units with fake ids and live longer
than a turn, so resetting the underlying id counter between turns might
result in dublicate id errors in wb recruit actions ( #1517 ), which
might lead to errors later.

With this it is of course possible to get erros when more than 2^31 (or
2^63 on a 64 bit wesnoth version.) fake units are generated during a
game, but that is less likely.
@gfgtdf
Copy link
Contributor

gfgtdf commented May 5, 2018

tested to be fixed after 1a135b7

@gfgtdf gfgtdf closed this as completed May 5, 2018
jostephd pushed a commit to jostephd/wesnoth that referenced this issue Oct 6, 2018
the wb recruit actions store temp units with fake ids and live longer
than a turn, so resetting the underlying id counter between turns might
result in dublicate id errors in wb recruit actions ( wesnoth#1517 ), which
might lead to errors later.

With this it is of course possible to get erros when more than 2^31 (or
2^63 on a 64 bit wesnoth version.) fake units are generated during a
game, but that is less likely.
jostephd pushed a commit to jostephd/wesnoth that referenced this issue Oct 7, 2018
the wb recruit actions store temp units with fake ids and live longer
than a turn, so resetting the underlying id counter between turns might
result in dublicate id errors in wb recruit actions ( wesnoth#1517 ), which
might lead to errors later.

With this it is of course possible to get erros when more than 2^31 (or
2^63 on a 64 bit wesnoth version.) fake units are generated during a
game, but that is less likely.

(cherry-picked from commit 775f3ec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues involving unexpected behavior. Confirmed Issues that have been successfully reproduced by at least one developer. Whiteboard Issues with the Planning Mode (a.k.a. Whiteboard) feature.
Projects
None yet
Development

No branches or pull requests

3 participants