Issue #20396 has been updated by byroot (Jean Boussier).
I'm not sure reasoning by analogy with core dumps is sound here. If there was a way to
be sure a core dump is stripped of all personally identifiable informations I'd
definitely use it to share core dumps when it's useful.
because, I'm pretty sure this is not the last
thing you wanted for the output. ... and pretty sure we would end up need an entire SQL
engine.
I think this is a bit of an unfair argument. Yes I requested multiple additions to this
API over the last few years, but in my opinion there is a very long way to go before it
can considered a complex API, especially for an API that is intended for very advanced
debugging. And it's not like I have a long list of feature requests I'm drip
feeding.
Also I don't even need that capability myself, I suggested it because I was trying to
help @zzak fix a memory leak at his company, and the dumps containing string values made
it hard for him to get approval to generate heap dumps from production because of
security concerns, and thought this new option it could be useful for the community.
----------------------------------------
Feature #20396: ObjectSpace.dump_all(string_value: false): skip dumping the String
contents
https://bugs.ruby-lang.org/issues/20396#change-107993
* Author: byroot (Jean Boussier)
* Status: Open
----------------------------------------
`ObjectSpace.dump_all` is a very useful method to debug memory leaks and such, hence is
frequently needed in production. But since all the 7bit strings content is included in the
dump, it incur the risk of leaking personal data, or secrets.
Also, in many case the strings content isn't that helpful and is just making the dump
much bigger for no good reason. And only pure-ASCII strings are dumped this way, which
means all the tools that process these dumps should already be compatible with a dump
without any string content.
### Feature
I propose to add another optional parameter to `dump_all`: `string_value: false`. When
passed, no String content is ever dumped regardless of its coderange.
Implementation:
https://github.com/ruby/ruby/pull/10382
cc @zzak
--
https://bugs.ruby-lang.org/