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

"unreachable code: Block(0x20100ae8000) Marked" with Immix #114

Open
wks opened this issue Oct 28, 2024 · 1 comment
Open

"unreachable code: Block(0x20100ae8000) Marked" with Immix #114

wks opened this issue Oct 28, 2024 · 1 comment

Comments

@wks
Copy link
Collaborator

wks commented Oct 28, 2024

The following crash happened when running CI tests with release build and the Immix plan. Link: https://github.com/mmtk/mmtk-ruby/actions/runs/11549564269/job/32142824795?pr=113#step:9:7498

  TestZlibInflate#test_recursive_inflate = 0.64 s = .
  TestGemPackageTarHeader#test_empty = 0.01 s = .
  TestGemPackageTarHeader#test_equals2 = 0.01 s = .
  TestZlibInflate#test_finish_chunked = 0.00 s = .
  thread '<unnamed>' panicked at /home/runner/.cargo/git/checkouts/mmtk-core-3306bdeb8eb4322b/618fde4/src/policy/immix/immixspace.rs:551:26:
  internal error: entered unreachable code: Block(0x20100ae8000) Marked
  stack backtrace:
     0: rust_begin_unwind
     1: core::panicking::panic_fmt
     2: mmtk::policy::immix::immixspace::ImmixSpace<VM>::get_reusable_block
     3: mmtk::util::alloc::immix_allocator::ImmixAllocator<VM>::acquire_recyclable_lines
     4: <mmtk::util::alloc::immix_allocator::ImmixAllocator<VM> as mmtk::util::alloc::allocator::Allocator<VM>>::alloc
  TestCoverage#test_coverage_snapshot = 0.10 s = .
  TestGemPackageTarHeader#test_to_s = 0.02 s = .
     5: rb_mmtk_alloc
               at ./../mmtk_support.c:464:20
     6: rb_mmtk_alloc_obj
               at ./../mmtk_support.c:512:18
     7: rb_mmtk_newobj_of_inner
               at ./../gc/default.c:2620:17
     8: rb_gc_impl_new_obj
               at ./../gc/default.c:2667:15
     9: newobj_of
               at ./../gc.c:919:17
    10: rb_wb_protected_newobj_of
               at ./../gc.c:946:12
    11: rb_ary_tmp_new_from_values
               at ./../array.c:976:11
    12: rb_ary_new_from_values
               at ./../array.c:988:12
    13: iseq_location
               at ./../proc.c:1345:12
    14: rb_proc_location
               at ./../proc.c:1365:12
    15: threadptr_invoke_proc_location
               at ./../thread.c:976:16
    16: threadptr_invoke_proc_location
               at ./../thread.c:973:1
    17: native_set_thread_name
               at ./../thread_pthread.c:2693:21
    18: thread_do_start
               at ./../thread.c:640:5
    19: thread_start_func_2
               at ./../thread.c:708:18
    20: call_thread_start_func_2
               at ./../thread_pthread.c:2180:5
    21: nt_start
               at ./../thread_pthread.c:2225:13
    22: <unknown>
    23: <unknown>
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
  fatal runtime error: failed to initiate panic, error 5
  TestGemPackageTarHeader#test_update_checksum = 0.09 s = .
  TestGemPackageTarHeader#test_initialize_bad = 0.01 s = .
  TestGemPackageTarHeader#test_initialize = 0.01 s = .
  TestGemCommandsUnpackCommand#test_find_in_cache = 0.36 s = .
  TestCoverage#test_oneshot_line_coverage = 0.13 s = .
  running file: /home/runner/work/mmtk-ruby/mmtk-ruby/git/ruby/test/zlib/test_zlib.rb
  
  A test worker crashed. It might be an interpreter bug or
  a bug in test/unit/parallel.rb. Try again without the -j
  option.
  
  make: *** [uncommon.mk:965: yes-test-all] Error 1

In Immix, when a block is added into ImmixSpace::reusable_blocks during Block::sweep(), it is always set to BlockState::Reusable.

So far I have not been able to reproduce this bug locally. It may be related to the PR #113 I will try to restart the CI test to see if it can be reproduced on GitHub CI.

@wks
Copy link
Collaborator Author

wks commented Oct 30, 2024

The same thing can be reproduced in the current master revision without any change, as seen in https://github.com/mmtk/mmtk-ruby/actions/runs/11571460199/job/32209388461?pr=115 So the bug exists in the current code base, and is not introduced by #113.

2024-10-29T10:07:31.7410627Z thread '<unnamed>' panicked at /home/runner/.cargo/git/checkouts/mmtk-core-3306bdeb8eb4322b/618fde4/src/policy/immix/immixspace.rs:551:26:
2024-10-29T10:07:31.7412367Z internal error: entered unreachable code: Block(0x20101af0000) Marked
2024-10-29T10:07:31.7413613Z stack backtrace:
2024-10-29T10:07:31.7414070Z    0: rust_begin_unwind
2024-10-29T10:07:31.7414586Z    1: core::panicking::panic_fmt
2024-10-29T10:07:31.7415374Z    2: mmtk::policy::immix::immixspace::ImmixSpace<VM>::get_reusable_block
2024-10-29T10:07:31.7416471Z    3: mmtk::util::alloc::immix_allocator::ImmixAllocator<VM>::acquire_recyclable_lines
2024-10-29T10:07:31.7417842Z    4: <mmtk::util::alloc::immix_allocator::ImmixAllocator<VM> as mmtk::util::alloc::allocator::Allocator<VM>>::alloc
2024-10-29T10:07:31.7726449Z    5: rb_mmtk_alloc
2024-10-29T10:07:31.7731305Z              at ./../mmtk_support.c:464:20
2024-10-29T10:07:31.7735626Z    6: rb_mmtk_alloc_obj
2024-10-29T10:07:31.7740026Z              at ./../mmtk_support.c:512:18
2024-10-29T10:07:31.7772712Z    7: rb_mmtk_newobj_of_inner
2024-10-29T10:07:31.7777250Z              at ./../gc/default.c:2620:17
2024-10-29T10:07:31.7781457Z    8: rb_gc_impl_new_obj
2024-10-29T10:07:31.7785748Z              at ./../gc/default.c:2667:15
2024-10-29T10:07:31.7789953Z    9: newobj_of
2024-10-29T10:07:31.7794155Z              at ./../gc.c:912:17
2024-10-29T10:07:31.7798215Z   10: rb_wb_protected_newobj_of
2024-10-29T10:07:31.7802491Z              at ./../gc.c:939:12
2024-10-29T10:07:31.7829031Z   11: rb_ary_tmp_new_from_values
2024-10-29T10:07:31.7833454Z              at ./../array.c:976:11
2024-10-29T10:07:31.7837575Z   12: rb_ary_new_from_values
2024-10-29T10:07:31.7841881Z              at ./../array.c:988:12
2024-10-29T10:07:31.7897654Z   13: iseq_location
2024-10-29T10:07:31.7901993Z              at ./../proc.c:1345:12
2024-10-29T10:07:31.7906149Z   14: rb_proc_location
2024-10-29T10:07:31.7910444Z              at ./../proc.c:1365:12
2024-10-29T10:07:31.8056213Z   15: threadptr_invoke_proc_location
2024-10-29T10:07:31.8056886Z              at ./../thread.c:976:16
2024-10-29T10:07:31.8057424Z   16: threadptr_invoke_proc_location
2024-10-29T10:07:31.8058105Z              at ./../thread.c:973:1
2024-10-29T10:07:31.8058601Z   17: native_set_thread_name
2024-10-29T10:07:31.8059349Z              at ./../thread_pthread.c:2693:21
2024-10-29T10:07:31.8059903Z   18: thread_do_start
2024-10-29T10:07:31.8060633Z              at ./../thread.c:640:5
2024-10-29T10:07:31.8061129Z   19: thread_start_func_2
2024-10-29T10:07:31.8061858Z              at ./../thread.c:708:18
2024-10-29T10:07:31.8062862Z   20: call_thread_start_func_2
2024-10-29T10:07:31.8063579Z              at ./../thread_pthread.c:2180:5
2024-10-29T10:07:31.8064084Z   21: nt_start
2024-10-29T10:07:31.8064811Z              at ./../thread_pthread.c:2225:13
2024-10-29T10:07:31.8067840Z   22: <unknown>
2024-10-29T10:07:31.8068369Z   23: <unknown>
2024-10-29T10:07:31.8069091Z note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant