From: deivid via ruby-core <ruby-core@...>
Date: 2025-03-19T16:00:34+00:00
Subject: [ruby-core:121405] [Ruby Bug#21192] Coverage no longer reports coverage information about tracepoint handlers

Issue #21192 has been updated by deivid (David Rodr�guez).


Oh my, I had forgotten about it, sorry for the noise!

----------------------------------------
Bug #21192: Coverage no longer reports coverage information about tracepoint handlers  
https://bugs.ruby-lang.org/issues/21192#change-112382

* Author: deivid (David Rodr�guez)
* Status: Open
* ruby -v: 2.6 until now
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
I minimized the issue like this:

### repro.rb

```ruby
require "coverage"

Coverage.start

require_relative "a"

puts Coverage.result
```

### a.rb

```ruby
TracePoint.trace(:line) do |tp|
  puts "TracePoint handler"
end

puts "Outside"
```

In Ruby 2.5, program's out was:

```
$ docker run --rm -it --mount type=bind,source=$(pwd),target=/foo ruby:2.5 ruby /foo/repro.rb
TracePoint handler
Outside
TracePoint handler
{"/foo/a.rb"=>[1, 2, nil, nil, 1]}
```

In Ruby 2.6 or higher:

```
$ docker run --rm -it --mount type=bind,source=$(pwd),target=/foo ruby:3.4 ruby /foo/repro.rb
TracePoint handler
Outside
TracePoint handler
{"/foo/a.rb" => [1, 0, nil, nil, 1]}
```




-- 
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/lists/ruby-core.ml.ruby-lang.org/