ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "shyouhei (Shyouhei Urabe) via ruby-core" <ruby-core@ml.ruby-lang.org>
To: ruby-core@ml.ruby-lang.org
Cc: "shyouhei (Shyouhei Urabe)" <noreply@ruby-lang.org>
Subject: [ruby-core:117582] [Ruby master Feature#20396] ObjectSpace.dump_all(string_value: false): skip dumping the String contents
Date: Thu, 18 Apr 2024 00:39:36 +0000 (UTC)	[thread overview]
Message-ID: <redmine.journal-107982.20240418003935.7941@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-20396.20240327082934.7941@ruby-lang.org

Issue #20396 has been updated by shyouhei (Shyouhei Urabe).


I'm not sure if I'm in favor of this request then.  ObjectSpace.dump_all is very much analogous to a coredump.  Both are very handy on occasions.  I don't doubt your experience of finding memory leak is real.  But...  People normally don't try to cruft a coredump.  One do often include sensitive info, but being able to access to a coredump is a big threat already.  We normally strictly restrict access to them.  The same thing can go for ObjectSpace.dump_all output.

I wrote "I prefer simple API for ObjectSpace.dump_all" because, I'm pretty sure this is not the last thing you wanted for the output.  People need to filter out some objects fields, order by something, group by something, having a histogram, ... and pretty sure we would end up need an entire SQL engine.  My preference is this method should remain as simple as possible, and let `jq(1)` etc., having that business.

----------------------------------------
Feature #20396: ObjectSpace.dump_all(string_value: false): skip dumping the String contents
https://bugs.ruby-lang.org/issues/20396#change-107982

* 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/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

  parent reply	other threads:[~2024-04-18  0:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27  8:29 [ruby-core:117341] [Ruby master Feature#20396] ObjectSpace.dump_all(string_value: false): skip dumping the String contents byroot (Jean Boussier) via ruby-core
2024-03-27  8:48 ` [ruby-core:117342] " ko1 (Koichi Sasada) via ruby-core
2024-03-27  8:50 ` [ruby-core:117343] " byroot (Jean Boussier) via ruby-core
2024-03-27 16:55 ` [ruby-core:117345] " jhawthorn (John Hawthorn) via ruby-core
2024-04-17  8:38 ` [ruby-core:117551] " shyouhei (Shyouhei Urabe) via ruby-core
2024-04-17  8:41 ` [ruby-core:117552] " byroot (Jean Boussier) via ruby-core
2024-04-18  0:39 ` shyouhei (Shyouhei Urabe) via ruby-core [this message]
2024-04-18  6:56 ` [ruby-core:117592] " byroot (Jean Boussier) via ruby-core

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-107982.20240418003935.7941@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    --cc=noreply@ruby-lang.org \
    --cc=ruby-core@ml.ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).