Skip to content

Conversation

pull[bot]
Copy link

@pull pull bot commented Oct 17, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

tekknolagi and others added 5 commits October 16, 2025 15:16
We have a lot of patchpoint exits on some applications and this helps
pin down why.
Now methods on singleton classes (for example, `new`) get split up into
`String*#new`, `Array*#new`, ... (where the `*` indicates a singleton
class) instead of all looking like `Class#new`.

before:

```
***ZJIT: Printing ZJIT statistics on exit***
Top-20 not inlined C methods (59.8% of total 10,506,888):
                                  String#<<: 987,752 ( 9.4%)
                               Kernel#is_a?: 755,223 ( 7.2%)
                                   Hash#[]=: 700,802 ( 6.7%)
                              Regexp#match?: 400,129 ( 3.8%)
                              String#empty?: 353,775 ( 3.4%)
                         String#start_with?: 334,961 ( 3.2%)
                                  Hash#key?: 331,080 ( 3.2%)
                 ObjectSpace::WeakKeyMap#[]: 238,978 ( 2.3%)
                              TrueClass#===: 235,771 ( 2.2%)
                             FalseClass#===: 231,144 ( 2.2%)
                             Array#include?: 213,362 ( 2.0%)
                         Kernel#respond_to?: 198,730 ( 1.9%)
                                 Kernel#dup: 178,920 ( 1.7%)
                        Kernel#block_given?: 178,767 ( 1.7%)
                             BasicObject#!=: 170,602 ( 1.6%)
                                  Class#new: 168,079 ( 1.6%)
                            Kernel#kind_of?: 165,600 ( 1.6%)
                                  String#==: 158,036 ( 1.5%)
                       Module#clock_gettime: 144,992 ( 1.4%)
                               NilClass#===: 137,833 ( 1.3%)
```

after:

```
***ZJIT: Printing ZJIT statistics on exit***
Top-20 not inlined C methods (59.8% of total 10,506,906):
                                  String#<<: 987,752 ( 9.4%)
                               Kernel#is_a?: 755,237 ( 7.2%)
                                   Hash#[]=: 700,802 ( 6.7%)
                              Regexp#match?: 400,129 ( 3.8%)
                              String#empty?: 353,775 ( 3.4%)
                         String#start_with?: 334,961 ( 3.2%)
                                  Hash#key?: 331,080 ( 3.2%)
                 ObjectSpace::WeakKeyMap#[]: 238,978 ( 2.3%)
                              TrueClass#===: 235,771 ( 2.2%)
                             FalseClass#===: 231,144 ( 2.2%)
                             Array#include?: 213,362 ( 2.0%)
                         Kernel#respond_to?: 198,730 ( 1.9%)
                                 Kernel#dup: 178,920 ( 1.7%)
                        Kernel#block_given?: 178,767 ( 1.7%)
                             BasicObject#!=: 170,602 ( 1.6%)
                                String*#new: 166,696 ( 1.6%)
                            Kernel#kind_of?: 165,600 ( 1.6%)
                                  String#==: 158,039 ( 1.5%)
                     Process*#clock_gettime: 144,992 ( 1.4%)
                               NilClass#===: 137,833 ( 1.3%)
```
This counts methods that can be folded away to nothing *in addition* to
the already-counted `CCall`.
remove_class_from_subclasses calls st_insert, which mallocs. Malloc is not
allowed in GC. This commit replaces the st_insert with an st_update since
we know that ns_id exists in the st_table.

The following script reproduces the crash:

    require "tempfile"

    Tempfile.create do |file|
      ns = Namespace.new
      ns.require(file)
    end
…e fetcher

The remote fetcher only works with certain schemes (`http`, `https`,
`s3`, and `file`).  It's possible for other schemes to show up in this
code and it can cause bugs.

Before this patch, doing `gem install path:///hello` would result in an
infinite loop because this function would do `send "fetch_path"`,
calling itself forever.  Now we see an exception.

I think we should validate gem names earlier, but it's really best
practice to restrict the possible strings passed to `send`.

ruby/rubygems@54e2781b73
@pull pull bot locked and limited conversation to collaborators Oct 17, 2025
@pull pull bot added the ⤵️ pull label Oct 17, 2025
@pull pull bot merged commit 4f51f62 into turkdevops:master Oct 17, 2025
1 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants