[ruby-core:121404] [Ruby Bug#21192] Coverage no longer reports coverage information about tracepoint handlers
From:
"mame (Yusuke Endoh) via ruby-core" <ruby-core@...>
Date:
2025-03-19 15:54:36 UTC
List:
ruby-core #121404
Issue #21192 has been updated by mame (Yusuke Endoh).
This is a duplicate of #16776 that you created, isn't it? :-)
----------------------------------------
Bug #21192: Coverage no longer reports coverage information about tracepoin=
t handlers =20
https://bugs.ruby-lang.org/issues/21192#change-112381
* Author: deivid (David Rodr=EDguez)
* 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=3Dbind,source=3D$(pwd),target=3D/foo rub=
y:2.5 ruby /foo/repro.rb
TracePoint handler
Outside
TracePoint handler
{"/foo/a.rb"=3D>[1, 2, nil, nil, 1]}
```
In Ruby 2.6 or higher:
```
$ docker run --rm -it --mount type=3Dbind,source=3D$(pwd),target=3D/foo rub=
y:3.4 ruby /foo/repro.rb
TracePoint handler
Outside
TracePoint handler
{"/foo/a.rb" =3D> [1, 0, nil, nil, 1]}
```
--=20
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- [email protected]
To unsubscribe send an email to [email protected]
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.rub=
y-lang.org/