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

Maybe fix MVM_panic from entering GC during spesh #1308

Conversation

MasterDuke17
Copy link
Contributor

The MVM_gc_mark_thread_(un)blocked(tc) calls were incorrect and caused
MoarVM panic: Must not GC when in the specializer/JIT at random times.

However, just removing them changed to causing MoarVM panic: Invalid owner in item added to GC worklist. Setting MVM_GC_DEBUG to 3 would
reliably trigger the panic when building NQP. Removing overwriting the
spesh facts fixed this, but I'm not 100% that the rest of the code is
100% correct.

NQP builds correctly and passes make m-test and Rakudo builds correcty and passes make m-test m-spectest.

The `MVM_gc_mark_thread_(un)blocked(tc)` calls were incorrect and caused
`MoarVM panic: Must not GC when in the specializer/JIT` at random times.

However, just removing them changed to causing `MoarVM panic: Invalid
owner in item added to GC worklist`. Setting `MVM_GC_DEBUG` to `3` would
reliably trigger the panic when building NQP. Removing overwriting the
spesh facts fixed this, but I'm not 100% that the rest of the code is
100% correct.
@MasterDuke17 MasterDuke17 requested review from timo, jnthn and niner June 8, 2020 16:42
Copy link
Member

@timo timo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe the sym_facts->value.i part was wrong because facts are set on registers, not on literals, so no clue what exactly would happen here. perhaps another part of the code would read the pointer in .i as value.s and try to interpret the MVMHashEntry as an MVMString?

either way, this patch looks correct

Because `ins->info` is what's used to determine how many operands to
access, we don't need to reallocate new operands in the gethllsym case.
@MasterDuke17 MasterDuke17 marked this pull request as ready for review June 8, 2020 20:09
@MasterDuke17 MasterDuke17 merged commit a5df9ea into MoarVM:master Jun 9, 2020
@MasterDuke17 MasterDuke17 deleted the maybe_fix_gethllsym_spesh_optimization branch June 9, 2020 12:41
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

Successfully merging this pull request may close these issues.

None yet

2 participants