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

objspace_dump.c: skip dumping method name if not pure ASCII #6161

Merged
merged 1 commit into from
Jul 21, 2022

Conversation

casperisfine
Copy link
Contributor

Sidekiq has a method named ❨╯°□°❩╯︵┻━┻ which corrupts heap dumps.

Normally we could just dump is as is since it's valid UTF-8 and need no escaping. But our code to escape control characters isn't UTF-8 aware so it's more complicated than it seems.

Ultimately since the overwhelming majority of method names are pure ASCII, it's not a big loss to just skip it.

cc @vahe

Sidekiq has a method named `❨╯°□°❩╯︵┻━┻`which corrupts
heap dumps.

Normally we could just dump is as is since it's valid UTF-8 and need
no escaping. But our code to escape control characters isn't UTF-8
aware so it's more complicated than it seems.

Ultimately since the overwhelming majority of method names are
pure ASCII, it's not a big loss to just skip it.
casperisfine pushed a commit to casperisfine/sidekiq that referenced this pull request Jul 21, 2022
Ruby heap dump has a bug in which it generates invalid JSON
when a method name is non-ASCII: ruby/ruby#6161

It's certainly not Sidekiq's fault, but I think it may be worth
working around it to avoid confusing people trying to debug
memory issues.
casperisfine pushed a commit to casperisfine/sidekiq that referenced this pull request Jul 21, 2022
Ruby heap dump has a bug in which it generates invalid JSON
when a method name is non-ASCII: ruby/ruby#6161

It's certainly not Sidekiq's fault, but I think it may be worth
working around it to avoid confusing people trying to debug
memory issues.
@byroot byroot merged commit 79406e3 into ruby:master Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants