Bug 1097272

Summary: Ruby bindings should use RB_GC_GUARD (instead of volatile) for enhanced safety
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: ptoscano
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-10-17 00:10:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard W.M. Jones 2014-05-13 13:06:23 UTC
Description of problem:

libguestfs Ruby bindings currently use volatile to ensure
the compiler spills pointers to live data onto the stack.
Which is probably fine for GCC, maybe not for other compilers.
In any case it could be better to use the RB_GC_GUARD macro
for this purpose.

Version-Release number of selected component (if applicable):

libguestfs, all recent versions

Additional info:

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/60741
https://github.com/libguestfs/libguestfs/blob/6cc521dc4533d10659214cc660f31239de9e28e7/generator/ruby.ml#L62

Thanks: Vít Ondruch

Comment 1 Richard W.M. Jones 2014-05-13 13:08:15 UTC
(BTW before using this macro, we should probably look at what
it actually does to ensure it is sane.)

Comment 2 Red Hat Bugzilla 2025-10-17 00:10:10 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.

Comment 3 Alasdair Kergon 2025-10-17 12:52:13 UTC
Reopening because Virtualization Tools has not been discontinued.