After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762835 - assertion failed: (_size > 0) in worm_reduce_tail when eating two bonuses in rapid succession
assertion failed: (_size > 0) in worm_reduce_tail when eating two bonuses in ...
Status: RESOLVED FIXED
Product: gnome-nibbles
Classification: Applications
Component: documentation
3.19.x
Other Linux
: Normal critical
: ---
Assigned To: gnome-nibbles-maint
gnome-nibbles-maint
Depends on:
Blocks:
 
 
Reported: 2016-02-28 21:12 UTC by Michael Catanzaro
Modified: 2016-03-04 00:09 UTC
See Also:
GNOME target: 3.20
GNOME version: ---


Attachments
Apply bonus type HALF based on current length (1.70 KB, patch)
2016-03-03 20:49 UTC, Iulian Radu
committed Details | Review
Apply bonus type HALF based on current length (1.70 KB, patch)
2016-03-03 20:53 UTC, Iulian Radu
committed Details | Review

Description Michael Catanzaro 2016-02-28 21:12:00 UTC
I made it quite far (past the first teleporter level) without any deaths, and picked up two bonus lives as well. Probably my best game so far.

Then it crashed. :(

It spawned an apple and a cherry, the apple looked like it was exactly one spot below the cherry. My worm ate the apple and was surely going to eat the cherry next, but it crashed (while eating the cherry, according to the backtrace).

Thread 1 (Thread 0x7f45875dda80 (LWP 29842))

  • #0 raise
    from /lib64/libc.so.6
  • #1 abort
    from /lib64/libc.so.6
  • #2 g_assertion_message
  • #3 g_assertion_message_expr
    at gtestutils.c line 2452
  • #4 gee_linked_list_last
    at /home/mcatanzaro/src/jhbuild/checkout/libgee/gee/linkedlist.vala line 299
  • #5 worm_reduce_tail
    at /home/mcatanzaro/src/jhbuild/checkout/gnome-nibbles/src/worm.vala line 211
  • #6 nibbles_game_apply_bonus
  • #7 nibbles_game_bonus_found_cb
    at /home/mcatanzaro/src/jhbuild/checkout/gnome-nibbles/src/nibbles-game.vala line 468
  • #8 _nibbles_game_bonus_found_cb_worm_bonus_found
    at /home/mcatanzaro/src/jhbuild/checkout/gnome-nibbles/src/nibbles-game.vala line 211
  • #9 g_cclosure_marshal_VOID__VOIDv
    at gmarshal.c line 905
  • #10 _g_closure_invoke_va
    at gclosure.c line 867
  • #11 g_signal_emit_valist
    at gsignal.c line 3294
  • #12 g_signal_emit_by_name
    at gsignal.c line 3481
  • #13 worm_move
    at /home/mcatanzaro/src/jhbuild/checkout/gnome-nibbles/src/worm.vala line 185
  • #14 nibbles_game_move_worms
    at /home/mcatanzaro/src/jhbuild/checkout/gnome-nibbles/src/nibbles-game.vala line 299
  • #15 nibbles_game_main_loop_cb
    at /home/mcatanzaro/src/jhbuild/checkout/gnome-nibbles/src/nibbles-game.vala---Type <return> to continue, or q <return> to quit--- line 194
  • #16 _nibbles_game_main_loop_cb_gsource_func
    at nibbles-game.c line 471
  • #17 g_timeout_dispatch
    at gmain.c line 4577
  • #18 g_main_dispatch
    at gmain.c line 3154
  • #19 g_main_context_dispatch
    at gmain.c line 3769
  • #20 g_main_context_iterate
    at gmain.c line 3840
  • #21 g_main_context_iteration
    at gmain.c line 3901
  • #22 g_application_run
  • #23 nibbles_main
    at /home/mcatanzaro/src/jhbuild/checkout/gnome-nibbles/src/gnome-nibbles.vala line 1055
  • #24 main
    at /home/mcatanzaro/src/jhbuild/checkout/gnome-nibbles/src/gnome-nibbles.vala line 1048

I see erase_size was 10, and it crashed on the fifth iteration of the loop for (int i = 0; i < erase_size; i++).

I'm not quite sure what is wrong with the code, though....
Comment 1 Matthias Clasen 2016-03-01 19:23:14 UTC
putting crashes on the target list
Comment 2 Iulian Radu 2016-03-03 20:49:52 UTC
Created attachment 323022 [details] [review]
Apply bonus type HALF based on current length

When reducing the worm's length to half, the total length was actually
the sum of the worm's length and the length that was going to be earned/
lost if the worm previously consumed another bonus.

Reduce the worm's length based on the length shown when the HALF
bonus is consumed.

Knowing the exact scenario (eat apple then the cherry) helped a lot. Thanks :)
Comment 3 Iulian Radu 2016-03-03 20:53:19 UTC
The following fix has been pushed:
65ec002 Apply bonus type HALF based on current length
Comment 4 Iulian Radu 2016-03-03 20:53:24 UTC
Created attachment 323023 [details] [review]
Apply bonus type HALF based on current length

When reducing the worm's length to half, the total length was actually
the sum of the worm's length and the length that was going to be earned/
lost if the worm previously consumed another bonus.

Reduce the worm's length based on the length shown when the HALF
bonus is consumed.
Comment 5 Michael Catanzaro 2016-03-04 00:09:56 UTC
Good ;)