This weekend I spent a bit of time trying to discover what causes rcov
to recieve line numbers greater than present in source files. I
suspected some ruby bug. But it turned out to be a small rails buglet.
Dynamic definition of recognize_optimized uses __FILE__ and __LINE__ as
it's context which for sufficiently large routes produces large enough
line numbers. I think that using __FILE__ is not correct, because it
confuses original lines of __FILE__ with generated ones. The fix is here