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 #19319] Fix crash in rb_str_casemap #7080

Merged
merged 1 commit into from
Jan 6, 2023

Conversation

peterzhu2118
Copy link
Member

The following code crashes on my machine:

GC.stress = true

str = "testing testing testing"

puts str.capitalize

We need to ensure that the object buffer_anchor remains on the stack so it does not get GC'd.

@peterzhu2118 peterzhu2118 changed the title [Bug #19318] Fix crash in rb_str_casemap [Bug #19319] Fix crash in rb_str_casemap Jan 6, 2023
The following code crashes on my machine:

```
GC.stress = true

str = "testing testing testing"

puts str.capitalize
```

We need to ensure that the object `buffer_anchor` remains on the stack
so it does not get GC'd.
@peterzhu2118 peterzhu2118 merged commit d8ef0a9 into ruby:master Jan 6, 2023
@peterzhu2118 peterzhu2118 deleted the pz-str-capitalize-crash branch January 6, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants