Skip to content

[Bug #21513] Raise on converting endless range to set#13902

Merged
knu merged 1 commit intoruby:masterfrom
viralpraxis:raise-on-endless-range-to-set
Jul 29, 2025
Merged

[Bug #21513] Raise on converting endless range to set#13902
knu merged 1 commit intoruby:masterfrom
viralpraxis:raise-on-endless-range-to-set

Conversation

@viralpraxis
Copy link
Copy Markdown
Contributor

@viralpraxis viralpraxis commented Jul 15, 2025

Before this patch, trying to convert endless range (e.g. (1..) or any other inifinte enumerable) to set (using to_set) would hang

Copy link
Copy Markdown
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this.

@viralpraxis viralpraxis force-pushed the raise-on-endless-range-to-set branch 2 times, most recently from 4b9f122 to 31a3861 Compare July 15, 2025 22:33
@viralpraxis
Copy link
Copy Markdown
Contributor Author

There's a SEGV in the ZJIT test suite: https://github.com/ruby/ruby/actions/runs/16305765996/job/46051383888?pr=13902

Not sure if it's related to my changes

@viralpraxis viralpraxis force-pushed the raise-on-endless-range-to-set branch from 31a3861 to a5a7db6 Compare July 15, 2025 22:52
@tekknolagi
Copy link
Copy Markdown
Contributor

There's a SEGV in the ZJIT test suite: https://github.com/ruby/ruby/actions/runs/16305765996/job/46051383888?pr=13902

Not sure if it's related to my changes

ZJIT error seems entirely unrelated to your change from a quick glance

@tekknolagi
Copy link
Copy Markdown
Contributor

Looks like a weird GC issue related to marking though so paging in @k0kubun for good measure

@viralpraxis viralpraxis force-pushed the raise-on-endless-range-to-set branch from a5a7db6 to e1b6f53 Compare July 15, 2025 23:39
@viralpraxis viralpraxis changed the title [Feature #21513] Raise on converting endless range to set [Bug #21513] Raise on converting endless range to set Jul 15, 2025
@viralpraxis viralpraxis force-pushed the raise-on-endless-range-to-set branch from e1b6f53 to ca35402 Compare July 15, 2025 23:40
@launchable-app

This comment has been minimized.

@k0kubun
Copy link
Copy Markdown
Member

k0kubun commented Jul 16, 2025

I agree that it's probably not related to the changes. We're looking into GC issues with ZJIT.

@viralpraxis viralpraxis force-pushed the raise-on-endless-range-to-set branch 6 times, most recently from 7753557 to 2de1bf0 Compare July 19, 2025 10:47
@viralpraxis
Copy link
Copy Markdown
Contributor Author

Could someone please take a look?

@viralpraxis viralpraxis force-pushed the raise-on-endless-range-to-set branch from 2de1bf0 to 36e3cee Compare July 24, 2025 11:14
@viralpraxis viralpraxis requested review from jeremyevans and nobu July 24, 2025 11:15
@viralpraxis viralpraxis force-pushed the raise-on-endless-range-to-set branch from 36e3cee to f9dce06 Compare July 24, 2025 13:48
@viralpraxis
Copy link
Copy Markdown
Contributor Author

@jeremyevans thank you very much for helping me with that! ❤️

@viralpraxis viralpraxis force-pushed the raise-on-endless-range-to-set branch 2 times, most recently from 77d1e01 to 2241e74 Compare July 27, 2025 13:19
@viralpraxis
Copy link
Copy Markdown
Contributor Author

CI failures are unrelated:

   TestGemRequest#test_verify_certificate_extra_message:
  Test::Unit::ProxyError: X509_dup
      /home/runner/work/ruby/ruby/src/lib/rubygems/request.rb:92:in 'OpenSSL::X509::StoreContext#current_cert'
      /home/runner/work/ruby/ruby/src/lib/rubygems/request.rb:92:in 'Gem::Request.verify_certificate'
      /home/runner/work/ruby/ruby/src/test/rubygems/test_gem_request.rb:373:in 'block in TestGemRequest#test_verify_certificate_extra_message'
      /home/runner/work/ruby/ruby/src/lib/rubygems/user_interaction.rb:46:in 'Gem::DefaultUserInteraction.use_ui'
      /home/runner/work/ruby/ruby/src/lib/rubygems/user_interaction.rb:69:in 'Gem::DefaultUserInteraction#use_ui'
      /home/runner/work/ruby/ruby/src/test/rubygems/test_gem_request.rb:372:in 'TestGemRequest#test_verify_certificate_extra_message'

ref: https://bugs.ruby-lang.org/issues/21513

Before this patch, trying to convert endless range (e.g. `(1..)`) to set
(using `to_set`) would hang
@viralpraxis viralpraxis force-pushed the raise-on-endless-range-to-set branch from 2241e74 to d8acf88 Compare July 27, 2025 14:15
@knu knu merged commit d4020dd into ruby:master Jul 29, 2025
84 checks passed
@viralpraxis viralpraxis deleted the raise-on-endless-range-to-set branch August 4, 2025 04:02
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 this pull request may close these issues.

6 participants