Tom Copeland's Recent Posts

RSS Feeds

« RubyForge newcaster | Main | Some excellent Ruby metaprogramming screencasts »

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83451d3c069e200e55471d2578834

Listed below are links to weblogs that reference rcov crashing with [BUG] rb_gc_mark():

Comments

Wow. Nicely done! I salute you!

@ryan, many thanks!

Just because cached_array is true doesn't mean cached_array->ptr is true, nor cached_array->ptr[sourceline]. I'm guessing one of those is invalid for one reason or another.

I think it should probably be:

if(cached_file == sourcefile && cached_array->ptr)

You could always inspect the ptr and sourceline individually to make sure they're valid, too.

@dan, yeah, I should email Mauricio, he could probably fix whatever the real problem is in about 5 minutes... the change I made seems to skip using a cached version of the source file contents, so it probably slows things down considerable. I need to dig into that extension a little more.

@dan, yup, that turned up in my Googlings, but seems inconclusive... kind of peters out with everyone saying "yeah, rb_gc_mark()" here too.

@tom - nice find. The crashes were completely random, works now, doesn't in 5 minutes, works again.

Unfortunately I've been too deep into work and severely lacking in C knowledge to try to track it down.

Hopefully a fix gets rolled into the master repo so we can all be anal about our coverage again :-)

Thanks,
Michael

Thanks for digging into this, Tom. Looks like Scott Barron has been busy too:

http://github.com/spicycode/rcov/commit/66909fb17cce40e3cf2e1312b16f7ab97b9fe559

I hope we'll see a new rcov gem soon...

@aslak - hm, I tried Scott's change but am still seeing segfaults; this time with just a "[BUG] Segmentation fault". I need to fire up Valgrind again and try to get to the bottom of those double frees...

@all, I've updated this post with a better fix that does some bounds checking... still not great, but better.

I applied your patch on a rcov fork on GitHub. You can install it as a gem.

Hope this helps:

http://mergulhao.info/2008/8/29/rcov-with-segfault-bug-patched
http://github.com/mergulhao/rcov/tree/master

@sylvestre, cool!

Thank you so much for this!
Just ran into problem, and had no idea how to fix it.

Applied the noted github gem and worked perfectly.

I installed mergulhao-rcov gem. run 'rake spec:rcov' again. it worked good. Thanks guys!

The comments to this entry are closed.