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

Void the instructionPointer systematically when creating a base frame #914

Draft
wants to merge 1 commit into
base: pharo-12
Choose a base branch
from

Conversation

guillep
Copy link
Member

@guillep guillep commented Feb 7, 2025

Void the instructionPointer systematically when creating a base fame.

This stops stack manipulations during potential code compactions since we are creating a base frame, and the new page is not entirely initialized.

Callers must make sure that the instruction pointer is saved/stored in suspended frames.

This PR fixes a crash happening in an extreme case when:

  1. a base frame is created for a context
  2. that context was suspended on machine code
  3. the machine code method was garbage collected (thus the method needs to be recompiled to resume)
  4. there is no more space in the machine code cache, so a code collection happens

See https://ci.inria.fr/pharo-ci-jenkins2/job/pharo-vm/job/pharo-12/64/pipeline-console/?selected-node=897
The stack trace for this case typically shows the following on a crash:

libPharoVMCore.so(isSendReturnPC+0x2)[0x7fe6be25dbe2]
libPharoVMCore.so(+0xb9a2c)[0x7fe6be2b9a2c]
libPharoVMCore.so(doReport+0xbc)[0x7fe6be2b9d1c]
libPharoVMCore.so(sigsegv+0x14)[0x7fe6be2b9da4]
libc.so.6(+0x3c050)[0x7fe6be05b050]
libPharoVMCore.so(isSendReturnPC+0x2)[0x7fe6be25dbe2]
libPharoVMCore.so(+0x822fc)[0x7fe6be2822fc]
libPharoVMCore.so(ceSendsupertonumArgs+0x1ba)[0x7fe6be2acf3a]

This stops stack manipulations during potential code compactions since we are creating a base frame,  and the new page is not entirely initialized.
Callers must make sure that the instruction pointer is saved/stored in suspended frames.
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.

1 participant