Arcbound Ravager and gnomefry's dump
Posted: 16 Jul 2020, 16:12
Referring to the bug reported by gnomefry here (https://www.slightlymagic.net/forum/viewtopic.php?f=86&t=29888) and following drool66's suggestion I had a quick first look. Which left me baffled for the moment but maybe someone else can make something out of it.
Edit: after having a close look I decided to rewrite the post. This little beast comes in a variety of flavours, namely before attacking, after attacking, during the following turn or seemingly never...
The dump (dump and savegame attached) gives the following (based on the git as of 5-July-2020):
get_counter_type_by_id at F:\Manalink-Dev\src/functions/counters.c:30
special_mill at F:\Manalink-Dev\src/functions/deck.c:2023
pump_ability_until_eot_no_repeat at F:\Manalink-Dev\src/functions/functions.c:1258
?? ??:0
After some playing around I got the following dumps where the last one seemed to be stable (i.e. occured more than once):
new_damage_all at F:\Manalink-Dev\src/functions/manipulate_and_damage_all.c:286
calc_initial_attack_rating_by_iid at F:\Manalink-Dev\src/functions/deck.c:67
finalize_activation at F:\Manalink-Dev\src/functions/engine.c:1585
?? ??:0
new_damage_all at F:\Manalink-Dev\src/functions/manipulate_and_damage_all.c:286
calc_initial_attack_rating_by_iid at F:\Manalink-Dev\src/functions/deck.c:51
human_assign_blockers at F:\Manalink-Dev\src/functions/engine.c:1559
?? ??:0
show_backtrace at F:\Manalink-Dev\src/functions/show_backtrace.c:19
get_card_instance at F:\Manalink-Dev\src/functions/deck.c:309
recopy_card_onto_stack at F:\Manalink-Dev\src/functions/engine.c:1683
?? ??:0
The rest of the dumps refers to the exe I guess and I didn't yet follow up on the dmp.pl which should give some addresses.
Doing some tracing yielded the following
If you have any hints more than happy, otherwise I will keep on digging tomorrow.
Edit: after having a close look I decided to rewrite the post. This little beast comes in a variety of flavours, namely before attacking, after attacking, during the following turn or seemingly never...
The dump (dump and savegame attached) gives the following (based on the git as of 5-July-2020):
get_counter_type_by_id at F:\Manalink-Dev\src/functions/counters.c:30
special_mill at F:\Manalink-Dev\src/functions/deck.c:2023
pump_ability_until_eot_no_repeat at F:\Manalink-Dev\src/functions/functions.c:1258
?? ??:0
After some playing around I got the following dumps where the last one seemed to be stable (i.e. occured more than once):
new_damage_all at F:\Manalink-Dev\src/functions/manipulate_and_damage_all.c:286
calc_initial_attack_rating_by_iid at F:\Manalink-Dev\src/functions/deck.c:67
finalize_activation at F:\Manalink-Dev\src/functions/engine.c:1585
?? ??:0
new_damage_all at F:\Manalink-Dev\src/functions/manipulate_and_damage_all.c:286
calc_initial_attack_rating_by_iid at F:\Manalink-Dev\src/functions/deck.c:51
human_assign_blockers at F:\Manalink-Dev\src/functions/engine.c:1559
?? ??:0
show_backtrace at F:\Manalink-Dev\src/functions/show_backtrace.c:19
get_card_instance at F:\Manalink-Dev\src/functions/deck.c:309
recopy_card_onto_stack at F:\Manalink-Dev\src/functions/engine.c:1683
?? ??:0
The rest of the dumps refers to the exe I guess and I didn't yet follow up on the dmp.pl which should give some addresses.
Doing some tracing yielded the following
- Code: Select all
engine.c | finalize_activation:1608 | Before dispatch_trigger2: player = 1, trig = 210
events.c | dispatch_trigger2:521 | Before dispatch_trigger_impl
events.c | dispatch_trigger2:526 | After dispatch_trigger_impl
engine.c | recopy_card_onto_stack:1692 | Entering recopy_card_onto_stack: a1 = 1, pos = -1
- Code: Select all
// finalize_activation: around line 1608
EXE_FN(void, 0x436740, void)(); // resolve_top_card_on_stack()
dispatch_trigger2(current_turn, TRIGGER_TAP_CARD, EXE_STR(0x78fba8), 0, player, card); // PROMPT_SPECIALFEPHASE[7]
// we never get back here
- Code: Select all
// dispatch_trigger2: around line 520
trigger_cause_controller = new_trigger_cause_controller;
trigger_cause = new_trigger_cause;
LOG_DEBUG("Before dispatch_trigger_impl")
dispatch_trigger_impl( player, trig, 0, prompt, TENTATIVE_allow_response);
dispatch_trigger_impl(1-player, trig, 0, prompt, TENTATIVE_allow_response);
LOG_DEBUG("After dispatch_trigger_impl")
trigger_cause = old_trigger_cause;
trigger_cause_controller = old_trigger_cause_controller;
xtrigger_impl_value_dont_use_directly = old_xtrigger;
return 0; // ← I think we leave safely here
- Code: Select all
// recopy_card_onto_stack around line 1692
int pos = stack_size - 1;
LOG_DEBUG("Entering recopy_card_onto_stack: a1 = %d, pos = %d", a1, pos)
card_instance_t* stack_inst = get_card_instance(stack_cards[pos].player, stack_cards[pos].card); // ← pos == -1 which means something hits the fan
If you have any hints more than happy, otherwise I will keep on digging tomorrow.