Skip to content

Use of uninitialized value in exists at perftools.rb-0.5.6/bin/pprof line 2342 #28

Open

Description

@ghazel

After running the simple example:

require 'perftools'
PerfTools::CpuProfiler.start("/tmp/add_numbers_profile") do
  5_000_000.times{ 1+2+3+4+5 }
end

and trying to process the output:

pprof.rb --text /tmp/add_numbers_profile
Using local file /usr/local/ruby-enterprise-1.8.7-2010.01/bin/ruby.
Using local file /tmp/add_numbers_profile.
Use of uninitialized value in exists at /usr/local/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/perftools.rb-0.5.6/bin/pprof line 2342.
Total: 176 samples
     164  93.2%  93.2%      164  93.2% Integer#times

If it matters, I'm using google-perftools 1.7 not 1.6 as is linked to in the perftools.rb README.

Activity

  1. tmm1 commented on Jul 16, 2011

    @tmm1
    Owner

    Can you provide the lines in question from your patches pprof. This could be an upstream issue, or something introduced by my patches. Likely the latter since my perl skills are quite lacking.

  2. ghazel commented on Jul 16, 2011

    @ghazel
    Author

    Here is line 2342 of perftools.rb-0.5.6/bin/pprof

      if (exists $symbols->{$address}) {

    I did not replace it with the pprof from google-perftools 1.7. Should I?

  3. tmm1 commented on Jul 16, 2011

    @tmm1
    Owner

    It depends how you build the 1.7 version of perftools.rb. If you updated extconf.rb it should have used the 1.7 version and applied the patches on top.

    Aside from the warning, is pprof.rb working as expected. Looks like it produced the right output.

  4. ghazel commented on Jul 16, 2011

    @ghazel
    Author

    I gem installed perftools.rb before I ever downloaded and compiled google-perftools. I see now that perftools.rb comes with its own copy. Oops. The LD_PRELOAD I set in my output above was for the 1.7 .so I compiled. When I set LD_PRELOAD to the 1.6 .so included with perftools.rb I get this incorrect output:

    Total: 179 samples
         169  94.4%  94.4%      169  94.4% 0x0000000001ffc2f9
          10   5.6% 100.0%       10   5.6% 0x0000000002d940c1
           0   0.0% 100.0%      169  94.4% 0x0000000002d940c0
    

    If it's relevant, I'm on x86_64 and I have libunwind for my 1.7 build. Perhaps this output is due to perftool.rb using --enable-frame-pointers instead?

  5. tmm1 commented on Jul 16, 2011

    @tmm1
    Owner

    You should not be using LD_PRELOAD. Simply require 'perftools' and it will bring in the customized version of perftools.

  6. ghazel commented on Jul 16, 2011

    @ghazel
    Author

    Ok. I uninstalled the gem and my build of google-perftools 1.7 and removed my use of LD_PRELOAD. I installed perftools.rb again from scratch. The output appears to be correct, but I still get the Use of uninitialized value. I suppose I could just ignore it.

  7. sinm commented on Feb 11, 2013

    @sinm

    I can't find any circumstances of this error, but wrapped the statement in question with if (defined $address)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions