crystal icon indicating copy to clipboard operation
crystal copied to clipboard

Invalid memory access in Windows CI

Open straight-shoota opened this issue 1 year ago • 1 comments

CI jobs on Windows have been failing with invalid memory access errors. They're not very frequent. The stack traces point to an issue in the concurrency runtime (fiber/channel). It's not clear if all stack traces show the same bug though.

  • https://github.com/crystal-lang/crystal/actions/runs/10786983543/job/29920983860
    Invalid memory access (C0000005) at address 0x40
    [0x7ff6d128186e] cancel_timeout at D:\a\crystal\crystal\src\fiber.cr:244
    [0x7ff6d12e77f2] done! at D:\a\crystal\crystal\src\crystal\system\win32\iocp.cr:115
    [0x7ff6d12ae58b] run at D:\a\crystal\crystal\src\crystal\system\win32\iocp.cr:110
    [0x7ff6d12aafc4] reschedule at D:\a\crystal\crystal\src\crystal\scheduler.cr:166
    [0x7ff6d12ab2ba] reschedule at D:\a\crystal\crystal\src\crystal\scheduler.cr:61
    [0x7ff6d1281909] suspend at D:\a\crystal\crystal\src\fiber.cr:302
    [0x7ff6d1c3d991] receive at D:\a\crystal\crystal\src\channel.cr:221
    [0x7ff6d0c3b238] -> at D:\a\crystal\crystal\spec\std\io\io_spec.cr:1006
    [0x7ff6d14e907b] internal_run at D:\a\crystal\crystal\src\spec\example.cr:50
    [0x7ff6d14e8f7a] run at D:\a\crystal\crystal\src\spec\example.cr:38
    [0x7ff6d14ecf57] internal_run at D:\a\crystal\crystal\src\spec\context.cr:20
    [0x7ff6d14ecde2] run at D:\a\crystal\crystal\src\spec\context.cr:348
    [0x7ff6d14ecf85] internal_run at D:\a\crystal\crystal\src\spec\context.cr:20
    [0x7ff6d14ecde2] run at D:\a\crystal\crystal\src\spec\context.cr:348
    [0x7ff6d1398045] internal_run at D:\a\crystal\crystal\src\spec\context.cr:20
    [0x7ff6d1397f88] run at D:\a\crystal\crystal\src\spec\context.cr:155
    [0x7ff6d13253e4] execute_examples at D:\a\crystal\crystal\src\spec\dsl.cr:237
    [0x7ff6d0348637] -> at D:\a\crystal\crystal\src\spec\dsl.cr:220
    [0x7ff6d128a4d7] run at D:\a\crystal\crystal\src\crystal\at_exit_handlers.cr:14
    [0x7ff6d12c86e1] exit at D:\a\crystal\crystal\src\crystal\main.cr:53
    [0x7ff6d12c85f5] main at D:\a\crystal\crystal\src\crystal\main.cr:48
    [0x7ff6d0292589] main at D:\a\crystal\crystal\src\crystal\main.cr:130
    [0x7ff6d02926a3] wmain at D:\a\crystal\crystal\src\crystal\system\win32\wmain.cr:37
    [0x7ff6d1e035e8] __scrt_common_main_seh at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
    [0x7fffeb8c4cb0] BaseThreadInitThunk +16 in C:\Windows\System32\KERNEL32.DLL
    [0x7fffed0deceb] RtlUserThreadStart +43 in C:\Windows\SYSTEM32\ntdll.dll
    
  • https://github.com/crystal-lang/crystal/actions/runs/11015663372/job/30591934597
    Invalid memory access (C0000005) at address 0x0
    [0x7ff77947e073] previous= at D:\a\crystal\crystal\src\channel.cr:66
    [0x7ff77947d1fa] link at D:\a\crystal\crystal\src\crystal\pointer_linked_list.cr:18
    [0x7ff77947d1ad] delete at D:\a\crystal\crystal\src\crystal\pointer_linked_list.cr:51
    [0x7ff77947d0d2] shift? at D:\a\crystal\crystal\src\crystal\pointer_linked_list.cr:60
    [0x7ff77947c0f9] dequeue_receiver at D:\a\crystal\crystal\src\channel.cr:258
    [0x7ff77947bf7e] send_internal at D:\a\crystal\crystal\src\channel.cr:162
    [0x7ff77947be3b] send at D:\a\crystal\crystal\src\channel.cr:132
    [0x7ff77817bbd9] -> at D:\a\crystal\crystal\spec\std\spec_helper.cr:67
    [0x7ff779036da7] run at D:\a\crystal\crystal\src\fiber.cr:143
    [0x7ff7780b16d9] -> at D:\a\crystal\crystal\src\fiber.cr:95
    make: *** [Makefile.win:108: std_spec] Error 1
    
  • https://github.com/crystal-lang/crystal/actions/runs/10298687997/job/28506139260
    Invalid memory access (C0000005) at address 0x140
    [0x7ff7ac5f501e] cancel_timeout at D:\a\crystal\crystal\src\fiber.cr:244
    [0x7ff7ac62b972] done! at D:\a\crystal\crystal\src\crystal\system\win32\iocp.cr:131
    [0x7ff7ac61b291] run at D:\a\crystal\crystal\src\crystal\system\win32\iocp.cr:126
    [0x7ff7ac611ac4] reschedule at D:\a\crystal\crystal\src\crystal\scheduler.cr:160
    [0x7ff7ac611dba] reschedule at D:\a\crystal\crystal\src\crystal\scheduler.cr:55
    [0x7ff7ac5f5099] suspend at D:\a\crystal\crystal\src\fiber.cr:301
    [0x7ff7ac62b8ea] wait_for_completion at D:\a\crystal\crystal\src\crystal\system\win32\iocp.cr:161
    [0x7ff7ac61fd12] accept at D:\a\crystal\crystal\src\crystal\system\win32\iocp.cr:111
    [0x7ff7ace8c040] system_accept at D:\a\crystal\crystal\src\crystal\system\socket.cr:21
    [0x7ff7ace8bf93] accept? at D:\a\crystal\crystal\src\socket\tcp_server.cr:111
    [0x7ff7ace8efa3] accept at D:\a\crystal\crystal\src\socket.cr:191
    [0x7ff7abf45443] -> at D:\a\crystal\crystal\spec\std\http\client\client_spec.cr:13
    [0x7ff7ac5f5377] run at D:\a\crystal\crystal\src\fiber.cr:143
    [0x7ff7ab6a0f89] -> at D:\a\crystal\crystal\src\fiber.cr:95
    

straight-shoota avatar Sep 24 '24 18:09 straight-shoota

These are probably resolved by #14995, however that PR currently timeouts

HertzDevil avatar Sep 25 '24 00:09 HertzDevil