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

Marshal.dump with frozen string literals differs on --debug flag #7898

Closed
segiddins opened this issue Aug 21, 2023 · 2 comments · Fixed by #7903
Closed

Marshal.dump with frozen string literals differs on --debug flag #7898

segiddins opened this issue Aug 21, 2023 · 2 comments · Fixed by #7903
Milestone

Comments

@segiddins
Copy link

Environment Information

jruby 9.4.3.0 (3.1.4) 2023-06-07 3086960792 OpenJDK 64-Bit Server VM 19.0.1+10-21 on 19.0.1+10-21 +jit [arm64-darwin]

Expected Behavior

❯ chruby-exec jruby-9.4 -- ruby -vwe "$(printf "# frozen_string_literal: true\np Marshal.dump('')")"
jruby 9.4.3.0 (3.1.4) 2023-06-07 3086960792 OpenJDK 64-Bit Server VM 19.0.1+10-21 on 19.0.1+10-21 +jit [arm64-darwin]
"\x04\bI\"\x00\x06:\x06ET"

Actual Behavior

❯ chruby-exec jruby-9.4 -- ruby --debug -vwe "$(printf "# frozen_string_literal: true\np Marshal.dump('')")"
jruby 9.4.3.0 (3.1.4) 2023-06-07 3086960792 OpenJDK 64-Bit Server VM 19.0.1+10-21 on 19.0.1+10-21 +jit [arm64-darwin]
"\x04\bI\"\x00\a:\x06ET:\x18@debug_created_info[\aI\"\a-e\x06;\x00Ti\a"

I would expect --debug not to cause the @debug_created_info ivar to be dumped.

@ahorek
Copy link
Contributor

ahorek commented Aug 21, 2023

@debug_created_info is an internal variable for tracking frozen string literals, see https://bugs.ruby-lang.org/issues/11725 and bfd0b76

MRI just hides it from Marshal.dump since ruby/ruby@6964c06 which isn't really a good approach in the first place, but it shouldn't be hard to replicate it...

@enebo enebo added this to the JRuby 9.4.4.0 milestone Aug 21, 2023
@enebo
Copy link
Member

enebo commented Aug 21, 2023

heh. I don't remember imlpementing this at all. So I guess the FIXME I added was relevant after all.

@headius headius linked a pull request Aug 24, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants