Project

General

Profile

Actions

Bug #11593

closed

Is it possible that ObjectSpace.dump_all catch dead objects?

Added by gazay (Alex Gaziev) over 8 years ago. Updated over 4 years ago.

Status:
Closed
Target version:
-
[ruby-core:71085]

Description

Koichi, can you please help. There are lines in a dump that are not referenced by anyone else. And these are not ROOTs. For example, I'm looking in my dump by address of object and there is no other objects which have references to this object:

$ ag 0x7fc4adc55a20 dump.json

1812949:{"address":"0x7fc4adc55a20", "type":"DATA", "class":"0xaf6c70", "struct":"proc", "references":["0x7fc4adc55a48", "0x7fc504140390", "0x7fc4adc55a20", "0x7fc5041404d0"], "memsize":104}

How can it be? Is it a dead object who got in a dump or am I missing something?


Files

dead_thread.rb (216 Bytes) dead_thread.rb gazay (Alex Gaziev), 11/19/2015 08:15 AM

Updated by gazay (Alex Gaziev) over 8 years ago

  • Description updated (diff)
  • Assignee set to ko1 (Koichi Sasada)

Updated by ko1 (Koichi Sasada) over 8 years ago

It can be a bug of object traversing API. It is not well tested.
Do you have any script I can try?

@tmm1 (Aman Karmani) do you have any idea?

Thanks,
Koichi

Updated by gazay (Alex Gaziev) over 8 years ago

After running this example (dead_thread.rb) you can grep by printed address of thread and find out that it doesn't have parent

Updated by ko1 (Koichi Sasada) over 8 years ago

  • Status changed from Open to Feedback
  • Assignee changed from ko1 (Koichi Sasada) to tmm1 (Aman Karmani)

Sorry, last comment was my mistake.

ObjectSpace.dump_all() can output garbage (but not collected yet) objects.
This is current implementation.

     /* dump all objects */
    rb_objspace_each_objects(heap_i, &dc);

This code is similar to ObjectSpace.each_object and it iterates uncollected objects. I'm not sure it is enough or not (but maybe it is okay).

Updated by gazay (Alex Gaziev) over 8 years ago

Ok, I understood. This issue can be closed now, thank you

Actions #6

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0