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

Call trace_object on an empty space #102

Closed
qinsoon opened this issue Feb 25, 2022 · 0 comments · Fixed by mmtk/mmtk-core#555 or #103
Closed

Call trace_object on an empty space #102

qinsoon opened this issue Feb 25, 2022 · 0 comments · Fixed by mmtk/mmtk-core#555 or #103
Labels
C-bug Category: Bug

Comments

@qinsoon
Copy link
Member

qinsoon commented Feb 25, 2022

I started to see this error in #101

This is potentially a bug introduced by MMTk SFT trace object: mmtk/mmtk-core@e85d997

++ ./dist/RFastAdaptiveSemiSpace_x86_64_m32-linux/rvm -Xms200M -Xmx200M -jar /home/runner/work/mmtk-jikesrvm/mmtk-jikesrvm/.github/scripts/../../repos/jikesrvm/dacapo/dacapo-2006-10-MR2.jar hsqldb
===== DaCapo hsqldb starting =====
*********************************************************
* PseudoJDBCBench v1.1                                  *
*********************************************************

Scale factor value: 64
Number of clients: 20
Number of transactions per client: 40

Initializing dataset...DBMS: HSQL Database Engine
In transaction mode
	80000	 records inserted
	160000	 records inserted
	240000	 records inserted
	320000	 records inserted
	400000	 records inserted
	480000	 records inserted
	560000	 records inserted
	640000	 records inserted
done.

* Starting Benchmark Run *
thread '<unnamed>' panicked at 'Call trace_object() on 72400000, which maps to an empty space', /home/runner/.cargo/git/checkouts/mmtk-core-3306bdeb8eb4322b/dbd152b/src/policy/space.rs:156:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
./.github/scripts/ci-test-normal.sh: line 36: 26540 Aborted                 (core dumped) ./dist/RFastAdaptiveSemiSpace_x86_64_m32-linux/rvm $RVM_OPTIONS -Xms200M -Xmx200M -jar $DACAPO_PATH/dacapo-2006-10-MR2.jar hsqldb
@qinsoon qinsoon added the C-bug Category: Bug label Feb 25, 2022
qinsoon added a commit to mmtk/mmtk-core that referenced this issue Mar 10, 2022
If a binding uses `ObjectReference` to point to an address that is not within our allocated memory, the SFT and the side metadata for the `ObjectReference` may not be initialized properly.

This PR introduces a solution by introducing a constant `ObjectModel::OBJECT_REF_OFFSET_BEYOND_CELL`. If a binding may use object reference to point to an address beyond the cell we allocate, they need to provide a `Some` value for the constant. MMTk allocators need to guarantee that the object reference for an allocation won't point to a new chunk (so its metadata is properly initialized and is the same as the allocation result).

This PR fixes mmtk/mmtk-jikesrvm#102.

This PR:
* introduces a constant `ObjectModel::OBJECT_REF_OFFSET_BEYOND_CELL`. By default, it is `None`. If a binding may use `ObjectReference` to point to an address outside a cell, they need to set the constant to a proper `Some` value.
* Introduces a module `util::alloc::object_ref_guard`, which includes a few methods that help allocators to check and avoid breaking the invariant.
* adds a few assertions to check if our allocation addresses and object references have valid SFT entries.
* introduces a space acquire lock so we can guarantee when pages are acquired from a page resource, the SFT for the pages are always initialized.
* removes unnecessary methods in `Map32`.
qinsoon added a commit that referenced this issue Mar 10, 2022
This PR updates MMTk core to mmtk/mmtk-core#555, and fixes #102
tianleq pushed a commit to tianleq/mmtk-core that referenced this issue Apr 4, 2022
If a binding uses `ObjectReference` to point to an address that is not within our allocated memory, the SFT and the side metadata for the `ObjectReference` may not be initialized properly.

This PR introduces a solution by introducing a constant `ObjectModel::OBJECT_REF_OFFSET_BEYOND_CELL`. If a binding may use object reference to point to an address beyond the cell we allocate, they need to provide a `Some` value for the constant. MMTk allocators need to guarantee that the object reference for an allocation won't point to a new chunk (so its metadata is properly initialized and is the same as the allocation result).

This PR fixes mmtk/mmtk-jikesrvm#102.

This PR:
* introduces a constant `ObjectModel::OBJECT_REF_OFFSET_BEYOND_CELL`. By default, it is `None`. If a binding may use `ObjectReference` to point to an address outside a cell, they need to set the constant to a proper `Some` value.
* Introduces a module `util::alloc::object_ref_guard`, which includes a few methods that help allocators to check and avoid breaking the invariant.
* adds a few assertions to check if our allocation addresses and object references have valid SFT entries.
* introduces a space acquire lock so we can guarantee when pages are acquired from a page resource, the SFT for the pages are always initialized.
* removes unnecessary methods in `Map32`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant