Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The mark callback for the ruby bindings calls rb_gc_mark on uninitialized data. #28

Open
abic opened this issue Apr 12, 2013 · 1 comment
Assignees

Comments

@abic
Copy link

abic commented Apr 12, 2013

At the following line the rb_sigar_mark call back doesn't check whether logger is pointing to a valid Ruby object or not.

rb_gc_mark(rbsigar->logger);

The following ruby code will segfault without the sigar.logger set:

require 'sigar'
require 'logger'

GC.disable

sigars = []

10.times do
  sigar = Sigar.new
  #sigar.logger = Logger.new(STDOUT)
  sigars << sigar
end

GC.enable
GC.start

sleep 2
@ghost ghost assigned pmenglund May 8, 2013
@kostya
Copy link

kostya commented Sep 5, 2013

got the same bug very often (with logger is ok)

m1093782566 pushed a commit to m1093782566/bosh-cloudstack-cpi that referenced this issue Jan 13, 2014
There is currently a bug in the Sigar Ruby C extension whereupon the
logger attribute of the Sigar class is marked for GC cleanup even if it
was never set. There is a GitHub issue for this bug here:

  hyperic/sigar#28
pjulien pushed a commit to pjulien/sigar that referenced this issue May 14, 2016
conditionally define WbemLocator
kostya added a commit to kostya/sigar that referenced this issue Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants