rcov segmentation faults on Debian and Ubuntu (not on OS X)

  • Thread starter Stephen Anderson
  • Start date
S

Stephen Anderson

This has been driving me nuts and I've spent too much time on it.

I'm running rcov under cruisecontrol.rb on OS X just fine.

Both my slices at slicehost fail to do so and report seemingly random
segmentation faults and glibc errors. Those slices are running Debian
Etch, and Ubuntu Hasty Heron.

All the tests pass on all platforms if rcov isn't involved.

Here's a sample output:
==================================================================
/usr/bin/ruby1.8
"/home/stephen/.cruise/projects/nexttesting/work/vendor/plugins/rails_rcov/tasks/rails_rcov.rake"
--run-rake-task=test:functionals --rcov-params=" -x
\"^(?!(app\/controllers))\"" rcov -o
"/home/stephen/.cruise/projects/nexttesting/work/coverage/functionals"
-T -x "rubygems/*,rcov*" --rails -x "^(?!(app\/controllers))" -Ilib:test
"/var/lib/gems/1.8/gems/rake-0.8.1/lib/rake/rake_test_loader.rb"
"test/functional/nti_results_controller_test.rb"
"test/functional/left_nav_bar_test.rb"
"test/functional/skating_results_controller_test.rb"
"test/functional/results_xml_files_controller_test.rb"
"test/functional/events_controller_test.rb"
"test/functional/jerseys_controller_test.rb"
"test/functional/positions_controller_test.rb"
"test/functional/rfids_controller_test.rb"
"test/functional/athletes_controller_test.rb" (in
/home/stephen/.cruise/projects/nexttesting/work) Loaded suite
/usr/bin/rcov Started
...................................................../home/stephen/.cruise/projects/nexttesting/work/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:292:
[BUG] Segmentation fault ruby 1.8.6 (2008-03-03) [x86_64-linux] rake
aborted! Command failed with status (): [rcov -o
"/home/stephen/.cruise/projects/ne...] (See full trace by running task
with --trace) rake aborted! Command failed with status (1):
[/usr/bin/ruby1.8 "/home/stephen/.cruise/pr...]
==================================================================
rcov 0.8.1.2 2007-11-22
Rails 2.0.2
ruby 1.8.6 (2007-09-23 patchlevel 110) [x86_64-linux] (on the Ubuntu
slice)
ruby 1.8.6 (2008-03-03 patchlevel 114) [x86_64-linux] (on the Debian
slice)
ruby 1.8.6 (2007-09-24 patchlevel 111) [universal-darwin9.0] (on OS X)


I've done a number of experiments and believe I've ruled out bad code.
I've also tried different versions of rcov, rails and ruby. Upping the
memory limit on one of the slices from 256 MB to 512 MB did change the
output behavior, but the error came back anyhow.

I see where I should post a bug to http://eigenclass.org/hiki/rcov-0.8.1
but I can't seem to find how to post to that wiki!

Like I said, I've spent too long on this. It's driving me crazy so any
advice is greatly appreciated!

Thanks!
-Steve-
 
S

Stephen Anderson

Now I'm getting [BUG] rb_gc_mark(): unknown data type 0x0(0x2a064b8) non
object
errors on the OS X copy of rcov.

Is rcov stable?
 
S

Stephen Anderson

The variety of different errors I'm getting make me suspect some sort of
C language buffer overrun.

Since I only see these problems when trying to use rcov, I'm swift
approaching the point of tabling attempts to use rcov and just trying it
again as new releases appear.

I'm more inclined to suspect rcov than our code because our project is
still just a simple Rails app that doesn't do anything all that tricky.

The possibility that I might be ignoring a nasty bug in our rails code
does cause me concern though.



Stephen said:
Now I'm getting [BUG] rb_gc_mark(): unknown data type 0x0(0x2a064b8) non
object
errors on the OS X copy of rcov.

Is rcov stable?
 
P

Phillip Gawlowski

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A: Because it makes it difficult to follow the conversation.
Q: Why is top posting bad?

Stephen Anderson wrote:
| The variety of different errors I'm getting make me suspect some sort of
| C language buffer overrun.
|
| Since I only see these problems when trying to use rcov, I'm swift
| approaching the point of tabling attempts to use rcov and just trying it
| again as new releases appear.
|
| I'm more inclined to suspect rcov than our code because our project is
| still just a simple Rails app that doesn't do anything all that tricky.
|
| The possibility that I might be ignoring a nasty bug in our rails code
| does cause me concern though.

What do RCov's tests say? Do they segfault, too?

Have you tried a simple app, with only a handful of tests, that doesn't
use Rails?

Are the slices virtual machines? Are you sure that the VM engine used
(Xen, Virtuozzo, whatever) doesn't introduce artifacts that result in
segfaults?

Are you aware that RCov only runs your tests and shows you,
approximately, which parts of the code get exercised by your tests?

And shouldn't you run coverage on, say, development / build machines, as
doing that in production is rather pointless?

What version of RCov are you using? A 'gem install'ed one, or one
installed via apt-get?

- --
Phillip Gawlowski
Twitter: twitter.com/cynicalryan
Blog: http://justarubyist.blogspot.com

~ - You know you've been hacking too long when...
...you count empty bottles (two at a time) like this:
"2, 4, 8, 16, 32, .... 32?!?"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgiPt8ACgkQbtAgaoJTgL8/EgCfYIoG8JA58mtAXr/SG2bkcBWR
Y9oAoKT1ADcMDeWuBXFBivT+WlvTW7Re
=ftWm
-----END PGP SIGNATURE-----
 
S

Stephen Anderson

Phillip said:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A: Because it makes it difficult to follow the conversation.
Q: Why is top posting bad?
Thanks for the pointer, and thank you for taking the time to respond.

What do RCov's tests say? Do they segfault, too?
Good point. I'm trying to run them, but am encountering problems.
First I was hitting "WIN32 has been removed, use CURRENT instead".
Now I'm running into missing the
/Library/Ruby/Gems/1.8/gems/rcov-0.8.1.2.0/test/expected_coverage
directory.

Is it common for gems installed with "sudo gem install <gem name>" to
not be installed in a way that allows running their tests? Am I
overlooking something?
Have you tried a simple app, with only a handful of tests, that doesn't
use Rails?

Are the slices virtual machines? Are you sure that the VM engine used
(Xen, Virtuozzo, whatever) doesn't introduce artifacts that result in
segfaults?
The slices use Xen. This is a good point. I'm also wondering about the
rather low memory on the slices.
Are you aware that RCov only runs your tests and shows you,
approximately, which parts of the code get exercised by your tests?
This is what confuses and concerns me. I have yet to see any of these
errors when not running rcov.
And shouldn't you run coverage on, say, development / build machines, as
doing that in production is rather pointless?
Those slices aren't production. I was hoping to keep a history of test
results and test coverage visible from anywhere, and not limited to when
a particular developer happens to be running their laptop.
What version of RCov are you using? A 'gem install'ed one, or one
installed via apt-get?
gem installed. rcov 0.8.1.2 2007-11-22
I tried the apt-get installed rcov, and have tried the previous version,
both apt-get installed, as well as gem installed.
 
P

Phillip Gawlowski

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephen Anderson wrote:
| Good point. I'm trying to run them, but am encountering problems.
| First I was hitting "WIN32 has been removed, use CURRENT instead".
| Now I'm running into missing the
| /Library/Ruby/Gems/1.8/gems/rcov-0.8.1.2.0/test/expected_coverage
| directory.
|
| Is it common for gems installed with "sudo gem install <gem name>" to
| not be installed in a way that allows running their tests? Am I
| overlooking something?

Not on the OSes I have used. None of those are Mac OS, though.

| This is what confuses and concerns me. I have yet to see any of these
| errors when not running rcov.

Well, RCov does a bit of introspection. This is probably memory
intensive for a Rails app especially, and coupled with the slics being
virtual machines, that could result in segfaults.

| Those slices aren't production. I was hoping to keep a history of test
| results and test coverage visible from anywhere, and not limited to when
| a particular developer happens to be running their laptop.

Put them into source control? It's only HTML files, after all.

- --
Phillip Gawlowski
Twitter: twitter.com/cynicalryan
Blog: http://justarubyist.blogspot.com

~ - You know you've been hacking too long when...
...you ask someone if they'd like to go get some "TeX-MeX" food.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgi0jkACgkQbtAgaoJTgL9ibACgqRGSBZ1bT99iijPfdQO7RUlR
Ij0AoI7le3pCxLkSQiGlNiG12nbpJSjn
=hv19
-----END PGP SIGNATURE-----
 
S

Stephen Anderson

Thanks again for your time Phillip!


Phillip said:
Not on the OSes I have used. None of those are Mac OS, though.
I'm seeing this same error on all 3 operating systems at this point:

/var/lib/gems/1.8/gems/rcov-0.8.1.2.0$ rake
(in /var/lib/gems/1.8/gems/rcov-0.8.1.2.0)
rake aborted!
WIN32 has been removed, use CURRENT instead
/var/lib/gems/1.8/gems/rcov-0.8.1.2.0/Rakefile:152
(See full trace by running task with --trace)

This makes me think I'm running some pieces of my ruby stack with newer
versions than the developers of rcov.
Well, RCov does a bit of introspection. This is probably memory
intensive for a Rails app especially, and coupled with the slics being
virtual machines, that could result in segfaults.

This is definitely something I want to learn about by running the rcov
tests on all 3 operating systems as newer versions are released.
Put them into source control? It's only HTML files, after all.
Very interesting idea. Thank you.


If I were programming on my own dime, this is where I would dive in and
contribute to the rcov project, or learn more about it to figure what
piece I need to swap out to get it working.

Since other companies are paying for my time, I believe my plan for now
is to table the use of rcov, but revisit it each time pieces of the
Ruby, Rails and Rcov stack change.

Thanks!
-Steve-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,690
Latest member
MacGyver

Latest Threads

Top