General

Profile

mk (Matthias Käppler)

  • Login: mk
  • Registered on: 08/05/2021
  • Last sign in: 04/04/2024

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 0 2 2

Activity

04/04/2024

05:50 AM Ruby Feature #20408: Add heap_live_slots to GC.stat_heap
peterzhu2118 (Peter Zhu) wrote in #note-2:
> Thank you for this ticket. I opened a PR that implements this feature: https://github.com/ruby/ruby/pull/10439
Thank you so much Peter! <3
mk (Matthias Käppler)

04/03/2024

02:24 PM Ruby Feature #20408 (Closed): Add heap_live_slots to GC.stat_heap
`GC.stat` exposes a `heap_live_slots` metric that returns the number of live objects occupying eden slots.
Because the slot size was fixed to `RVALUE_SIZE`, this allowed for some basic approximations of how many bytes were live/in-use...
mk (Matthias Käppler)

12/02/2022

12:56 PM Ruby Bug #19156: ObjectSpace.dump_all segfault during string inspection
I hope I summarized it correctly: https://gitlab.com/gitlab-org/ruby/gems/prometheus-client-mmap/-/issues/39
I'm not sure if your and my test case crash for precisely the same reason. If they do, then I am missing how unmap fits into ...
mk (Matthias Käppler)
12:32 PM Ruby Bug #19156: ObjectSpace.dump_all segfault during string inspection
Thanks for sharing this; I still don't think this is related to the memory map going away. Not exclusively anyway. My original test case does not close or unmap the counter file, but it still crashes. The counter is still in scope when w... mk (Matthias Käppler)
09:54 AM Ruby Bug #19156: ObjectSpace.dump_all segfault during string inspection
@byroot I wonder if you could help me understand the underlying issue better. I found a minimal, executable test case that reproduces this issue reliably:
```ruby
Prometheus::Client::MmapedValue.new(:counter, :counter, 'ordered_count...
mk (Matthias Käppler)

11/29/2022

03:29 PM Ruby Bug #19156: ObjectSpace.dump_all segfault during string inspection
Thank you, this helps a lot! I will test the patch you suggest and see if that addresses the immediate problem.
If it does, I can take a stab at putting a PR together. I would credit you of course. Really appreciate your time spent on...
mk (Matthias Käppler)
03:13 PM Ruby Bug #19156: ObjectSpace.dump_all segfault during string inspection
byroot (Jean Boussier) wrote in #note-15:
> It's even worse than using `str_new_static`, it's creating a regular string and rewriting the pointer. This is terrible code.
Yikes -- good catch! This library isn't particularly active o...
mk (Matthias Käppler)
03:00 PM Ruby Bug #19156: ObjectSpace.dump_all segfault during string inspection
I'm not sure this makes sense but: we know the address being referenced is somewhere (half-way) into a memory region that is a memory-mapped file using that Prometheus library's binary encoding.
This is the file:
```
xxd gauge_max...
mk (Matthias Käppler)
02:37 PM Ruby Bug #19156: ObjectSpace.dump_all segfault during string inspection
It looks like I can't do anything useful with that address:
```
(gdb) p *0x7fced23f4000
Cannot access memory at address 0x7fced23f4000
```
This is getting mysterious. I looked at process maps to see what kind of memory region th...
mk (Matthias Käppler)
02:18 PM Ruby Bug #19156: ObjectSpace.dump_all segfault during string inspection
byroot (Jean Boussier) wrote in #note-5:
> Also, based on the backtrace I believe that `ObjectSpace.each_object(String, &:valid_encoding?)` should cause the same crash.
Indeed!
```
bundle exec rbtrace -p $(pgrep -f 'worker 1') -e...
mk (Matthias Käppler)

Also available in: Atom