ice799/memprof

Line numbers are doubled

Closed this issue · 2 comments

   2243 /home/onespot/editor-ui/releases/20100223210117/lib/shared/ruby_ext.rb:646:String
    358 /home/onespot/editor-ui/releases/20100223210117/app/models/word_frequency.rb:84:String
    155 /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/multibyte/handlers/utf8_handler.rb:768:Array
    119 /home/onespot/editor-ui/releases/20100223210117/app/models/word_frequency.rb:62:String
     48 /home/onespot/editor-ui/releases/20100223210117/app/models/word_frequency.rb:94:String

All of these line numbers are exactly 2x the actual line number in the source. I assume there's a bitshift bug somewhere. The first one is actually line 323, e.g.

tmm1 commented

hmm, are you sure you recompiled/reinstalled memprof with the ruby version you were using. this usually happens if you re-use a memprof build across ruby builds (ree vs ruby1.8 especially)

also you can try running ruby spec/memprof_spec.rb, which tests line numbers

I installed memprof for ruby 1.8 and then for REE (you can see the version in the output above). Perhaps it used the MRI version somehow but I don't know for sure.