-
Notifications
You must be signed in to change notification settings - Fork 73
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
PageAccounting::clear_reserved() called after reset() in GenImmix #734
Comments
This is introduced in #712. Maybe we can have a separate field in |
@k-sareen You said that GenImmix crashes when running fop. Is the crash related with this issue? |
No I don't think so. Think it was something in the binding. But I didn't run in debug build anyway. Let me see if I can reproduce it. |
qinsoon
added a commit
that referenced
this issue
Feb 9, 2023
This PR reverts a change about where to call `pr.clear_request()` in `Space.acquire()` in #712. The change caused issues like #734. This PR reverts the change. We now clear the reserved pages before GC (the same as before, and the same as Java MMTk), and additionally we inform the GC trigger about pending allocation pages. This closes #734.
qinsoon
added a commit
to qinsoon/mmtk-core
that referenced
this issue
Feb 21, 2023
This PR reverts a change about where to call `pr.clear_request()` in `Space.acquire()` in mmtk#712. The change caused issues like mmtk#734. This PR reverts the change. We now clear the reserved pages before GC (the same as before, and the same as Java MMTk), and additionally we inform the GC trigger about pending allocation pages. This closes mmtk#734.
wenyuzhao
pushed a commit
to wenyuzhao/mmtk-core
that referenced
this issue
Mar 20, 2023
This PR reverts a change about where to call `pr.clear_request()` in `Space.acquire()` in mmtk#712. The change caused issues like mmtk#734. This PR reverts the change. We now clear the reserved pages before GC (the same as before, and the same as Java MMTk), and additionally we inform the GC trigger about pending allocation pages. This closes mmtk#734.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GenImmix is very likely to crash. I can reproduce the crash using the following command:
It may crash with both debug and release build alike.
What happened is, the counter
PageAccounting::reserved
underflowed (attempted to subtract from 0).At the end of a GC,
PageAccounting::reset()
is called becauseCopySpace::release()
callsself.pr.reset()
.reserved
is cleared to 0.Then GC finishes. A mutator wakes up, and calls
pr.clear_request(pages_reserved)
with a non-zeropage_reserved
. This will callPageAccounting::clear_reserved(pages)
with a non-zero argument, and it will callself.reserved.fetch_sub
when the current value ofreserved
is zero.The
pr.clear_request
statement is insrc/policy/space.rs
line 72:A stack trace when this happened is shown below. Note that the "attempt to subtract with overflow" happens because I added a logging statement:
// src/util/heap/accounting.rs pub fn clear_reserved(&self, pages: usize) { let result = self.reserved.fetch_sub(pages, Ordering::Relaxed); // `fetch_sub` never crashes when overflowing. + eprintln!("[clear_reserved] {} -> {}", result, result - pages); // `result-pages` will overflow in debug mode. }
The stack trace:
The text was updated successfully, but these errors were encountered: