kwilczynski / ruby-magic

Simple interface to libmagic for Ruby Programming Language
Apache License 2.0
27 stars 8 forks source link

Add a test for GC.compact for Ruby 3.0 #11

Closed stanhu closed 3 years ago

stanhu commented 3 years ago

This helps flag global pointers that have moved via the compacting garbage collector in Ruby 2.7 and up.

kwilczynski commented 3 years ago

Hi @stanhu,

This helps flag global pointers that have moved via the compacting garbage collector in Ruby 2.7 and up.

Nice!

Do we actually have this problem? Well, I suppose, we are going to find out!

Krzysztof

kwilczynski commented 3 years ago

Hi @stanhu,

[...]

This helps flag global pointers that have moved via the compacting garbage collector in Ruby 2.7 and up.

Nice!

Do we actually have this problem? Well, I suppose, we are going to find out!

After having a look at what the test does a question: would a short-lived run during testing be enough to trigger a potential issue? I suppose, the "failure" of this test would be a dangling reference and therefore a Ruby crash. I am just wondering whether there is enough time to trigger any issue. :)

Perhaps finding a way to manually trigger a problem, like what @tenderlove did in few other projects, would be something we could also try.

Krzysztof