开发者

Rspec and Cucumber are causing segmentation dumps on my C extension

I have a part of my project that is heavily using C extensions. At first they were three self contained extensions, call them

  • Foo
  • Bar
  • Baz

When this was the case I could run my Rspec and Cucumber tests and not have any issues. I converted one of my ruby files to another C extension so that I now have a C extension that creates and holds instances of Foo, Bar, and Baz and开发者_JAVA技巧 calls methods on them. The problem is that now when I run Rspec or Cucumber, I get seg faults in unpredictable places.

So I ran debugger and stepped through Rspec to see where the seg fault is being initiated, and it wasn't in a place that was referencing my code so I was a bit lost as to what happened. I ended up just rewriting that rspec file in shoulda, and now the tests run fine. So I've gone to cucumber, and am having a similar problem except that rewriting my cucumber file would be a much bigger commitment.

Note that the C extensions do not interact outside of themselves, there are no database calls, so my database cleaning strategies aren't an issue. The environment settings are also not an issue.

Are there any gotchas that I am missing regarding how Rspec (since I've narrowed the problem down to rspec specifically) would regard loading and testing C extensions that refer to other instances of C extensions?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜