sdk icon indicating copy to clipboard operation
sdk copied to clipboard

VM crash when evaluating invalid expression

Open FMorschel opened this issue 5 months ago • 0 comments

I've not yet been able to reduce this repro (see my attempt https://github.com/dart-lang/sdk/issues/60907) but:

  1. Clone https://github.com/FMorschel/chess
  2. Open chess_logic inner project and at lib\src\move\pawn_move.dart place a breakpoint on line 142:
  PawnCaptureMove({
    required super.captured,
    required super.from,
    required super.to,
    required super.moving,
    super.check,
    void ambiguous,
  }) : assert(
         moving.captureDirections.map((dir) => from.next(dir)).contains(to),  // Break
         'Pawn move must move one square diagonally '
         '(${from.toAlgebraic()} -> ${to.toAlgebraic()})',
       ),
       super.base(ambiguous: AmbiguousMovementType.file);
  1. Open test\controller\board_state_test.dart and debug only should maintain board consistency during complex sequence
  2. From within the inner closure (the first break point stop), evaluate moving.captureDirections.map((dir) => from.next(dir)) (which I know would not work at all but should not crash)

Output:

===== CRASH =====
ExceptionCode=-1073741819, ExceptionFlags=0, ExceptionAddress=00007FF7EA8A55C2
version=3.9.0-edge.bddcddfe6b0914c7f234cd4400e1e70e8a72d374 (main) (Fri Jun 6 16:00:25 2025 -0700) on "windows_x64"
pid=24064, thread=29828, isolate_group=test_suite:file:///C:/Users/FELIP_~1/AppData/Local/Temp/dart_test.kernel.ce57c922/test.dart_1.dill(000002620FD54380), isolate=test_suite:file:///C:/Users/FELIP_~1/AppData/Local/Temp/dart_test.kernel.ce57c922/test.dart_1.dill(000002620FE15A70)
os=windows, arch=x64, comp=no, sim=no
isolate_instructions=7ff7ea449a60, vm_instructions=7ff7ea449a80
fp=0, sp=72b6efb5b0, pc=7ff7ea8a55c2
Stack dump aborted because GetAndValidateThreadStackBounds failed.
  pc 0x00007ff7ea8a55c2 fp 0x0000000000000000 Dart_DetectNullSafety+0x453452
evaluateInFrame: (-32000) Bad state: The client closed with pending request "evaluateInFrame".

FMorschel avatar Jun 12 '25 22:06 FMorschel