hiredis-rb: hiredis-rb is not GC-safe
Hi there.
While investigating a GC-related issue (https://github.com/ohler55/oj/issues/265#issuecomment-147554809), @ohler55 mentioned that he looked at the hiredis-rb C code and saw some stuff that wasn’t GC safe and might be the source of the bug I’m investigating (NotImplementedError: method ... called on terminated object). He pointed out that:
Ruby checks the stack for VALUE types which are Ruby object references. Compilers often optimize code by placing variable in registers which are invisible to Ruby as far as checking for wether an object is still being referenced. The work around for this is to make sure all VALUE local variable are volatile. That keeps them out of registers and on the stack.
See the linked-to github issue above, but I’m only seeing this issue a few times per day on an app that gets significant traffic, so it’s tough to reproduce, but all signs point to it being GC-related.
I look forward to your reply here.
About this issue
- Original URL
- State: open
- Created 9 years ago
- Comments: 26 (12 by maintainers)
I’m not working on hiredis-rb anymore.