-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Attempt to fix observed AV in mark_through_cards_for_segments #60617
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
Attempt to fix observed AV in mark_through_cards_for_segments #60617
Conversation
…strumentation to narrow down the issue.
|
Tagging subscribers to this area: @dotnet/gc Issue DetailsThe hypothesis is that when there were no pinned plugs in this GC, saved_pinned_plug_index will be 0, but it's erroneous to refer to pinned_plug_of (saved_pinned_plug_index) in this case. The fix is to initialize saved_pinned_plug_index to an invalid value instead of 0, and to only refer to pinned_plug_of (saved_pinned_plug_index) if saved_pinned_plug_index has indeed been set in this GC. It is yet unclear whether the observed AVs are due to this issue, so add instrumentation to narrow down the issue further.
|
| #endif // MAX_LONGPATH | ||
|
|
||
| //#define TRACE_GC | ||
| #define TRACE_GC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guess this needs to be undone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, this is only for the private build... Peter wanted to log these particular dprintfs for instrumentation in the stress log so we can get them in the dump file.
src/coreclr/gc/gcpriv.h
Outdated
| // to do so. | ||
| //#define dprintf(l, x) | ||
| #define dprintf(l,x) STRESS_LOG_VA(l,x); | ||
| #define dprintf(l,x) {if ((l == 1) || (l == 5555)) {STRESS_LOG_VA(l,x);}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
|
Peter, so I have the following suggestions for instrumentation -
this would include all the places where we need to do this filler object but there'd doubtful be many of these (there could be more than the # of pinned plugs though). but the heap is already >10GB so this kind of mem increase is tolerable. |
- reduce diagnostic output - save pinned queue right when compact_phase starts
|
@Maoni0: I implemented your suggestion 1 and part of your suggestion 2 (saving the pinned plugs). I did not save additional info in adjust_limit, because that is already in the dprintfs and so the additional risk didn't seem justified. I looked at the dumps again and at the time of the crash we are either:
|
that's fine; that was a suggestion for if you want to completely eliminate the dprintfs (since they do require setting some configs). do you want to save the pinned plugs multiple times like I mentioned? might as well since it takes up so little memory. you could do this again after |
…and for multiple GCs.
|
Ok, changed the logic to save before and after compact_phase. While I was at it, I also saved the info for multiple gen 1 GCs because it was easy to do and might turn out to be useful if the problem is not in the very last gen 1 GC after all. |
The hypothesis is that when there were no pinned plugs in this GC, saved_pinned_plug_index will be 0, but it's erroneous to refer to pinned_plug_of (saved_pinned_plug_index) in this case.
The fix is to initialize saved_pinned_plug_index to an invalid value instead of 0, and to only refer to pinned_plug_of (saved_pinned_plug_index) if saved_pinned_plug_index has indeed been set in this GC.
It is yet unclear whether the observed AVs are due to this issue, so add instrumentation to narrow down the issue further.