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

[BUG] OP_POP_REPL can cause a segfault #452

Closed
1 task done
Jason2605 opened this issue Oct 3, 2021 · 0 comments · Fixed by #453
Closed
1 task done

[BUG] OP_POP_REPL can cause a segfault #452

Jason2605 opened this issue Oct 3, 2021 · 0 comments · Fixed by #453
Assignees
Labels
bug Something isn't working

Comments

@Jason2605
Copy link
Member

Jason2605 commented Oct 3, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

OP_POP_REPL pops the value off the stack and then attempts to print it if it's a non-nil value. OP_POP_REPL also has a call to tableSet, this can trigger a GC if the table needs to resize. Since the value has been popped off the stack, there is potential that it's not being tracked by the GC so when we attempt to print the value it's attempting to print something thats been free'd causing a segfault to occur.

Expected Behavior

No segfault.

Steps To Reproduce

This was found when testing the following PR with Dictu built in debug: #445

In the repl enter the following

>>> import Path;
>>> Path.join(['/tmp', '/////abcd/////', '/efg/']);
/tmp/abcd/efg/
>>> Path.join(['/tmp', '/////abcd/////', '/efg']);

Anything else?

No response

@Jason2605 Jason2605 added the bug Something isn't working label Oct 3, 2021
@Jason2605 Jason2605 self-assigned this Oct 3, 2021
@Jason2605 Jason2605 linked a pull request Oct 3, 2021 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant