Rcov with segfault bug patched

Rcov are hurting many people because of a segfault when used with rspec. Fortunately Tom Copeland wrote a patch last week. I patched it against rcov and put on GitHub. You can install it as a gem doing like this:

$ gem sources -a http://gems.github.com (you only have to do this once)
$ sudo gem install mergulhao-rcov

Someone knows how to make GitHub recognizes my README.markdown file?

29.08.2008 01:28 AM

12 Responses to “Rcov with segfault bug patched”

  1. Tapajós Says:

    Sylvestre, use README.mkdn.

  2. Rodrigo Says:

    Sylvestre, funcionou beleza! Muito obrigado, estávamos precisando deste patch!! :)

  3. Chad Says:

    I’ve pulled your changes into my rcov repo on github, and with the forthcoming rcov jruby changes we will have it working on ruby 1.8.6, 1.8.7 and jRuby! Thanks for the great work integrating the patch.

  4. Steven Soroka Says:

    You’re my hero. Totally solved my problem.

  5. tanel Says:

    thank you so much!!

  6. Sheldon Maloff Says:

    The 0.8.1.3 version of rcov still crashes with a nil.+ No MethodError when—aggregate is turned on. At least it’s crash in Ruby now, so it can be patched with the following diff.

    - rcov.rb.old 2008-09-29 12:09:59.000000000 -0600 + rcov.rb 2008-09-29 12:10:15.000000000 -0600 @ -651,7 +651,8 @ def aggregate_data(aggregated_data, delta) delta.each_pair do |file, cov_arr| dest = (aggregated_data[file] ||= Array.new(cov_arr.size, 0)) - cov_arr.each_with_index{|x,i| dest[i] += x} + # Added rescue clause to deal with dest array being smaller than cov_arr. + cov_arr.each_with_index{|x,i| dest[i] += x rescue dest[i] = x } end end

  7. Sheldon Maloff Says:

    Wow, posting that patch surely didn’t work. The offending line is 654 of rcov.rb. The addition of a rescue clause fixes a nil.+ NoMethodError:

    # Added rescue clause to deal with dest array being smaller than cov_arr. cov_arr.each_with_index{|x,i| dest[i] += x rescue dest[i] = x }
  8. Sheldon Maloff Says:

    One last time. Line 654 of rcov.rb should look like this:

    # Added rescue clause to deal with dest array being smaller than cov_arr. cov_arr.each_with_index{|x,i| dest[i] += x rescue dest[i] = x }
  9. Norman Clarke Says:

    Thank you so much for posting this. Works perfectly.

  10. Remi Says:

    Do you have a version already built for win32? I do not have nmake installed.

    Thanks for the fix

  11. Sylvestre Mergulhão Says:

    @Remi

    Sorry I don’t know anything about win32.

    @Sheldon Maloff

    Thanks for your report, I’ll apply it. Try to contact someone from the main project, because mine is only a fork.

  12. Walker Hagius Says:

    Beautiful! This totally fixed my problem. Thanks!!

Deixe seu comentário