Coder Social home page Coder Social logo

Bad magic number error about pprof HOT 4 CLOSED

tenderlove avatar tenderlove commented on September 26, 2024
Bad magic number error

from pprof.

Comments (4)

rauls5382 avatar rauls5382 commented on September 26, 2024

The symbolization code in pprof currently only supports ELF binaries (Linux).
It should be easy to update it to work on Mac OS. The main issue is examining the binary to identify any adjustments (if any) that need to be applied to stack addresses before passing them to a symbolization tool (eg addr2line or llvm-symbolize).

I do not have cycles to work on this on the immediate term, but patches are welcome.

from pprof.

rauls5382 avatar rauls5382 commented on September 26, 2024

This should be fixed, or at least improved at the current head. Please try it out and reopen if appropriate.

from pprof.

marek-kuzora avatar marek-kuzora commented on September 26, 2024

I'm hitting similar issue on OS X El Capitan 10.11.6:

Local symbolization failed for libsystem_kernel.dylib: unrecognized binary: /usr/lib/system/libsystem_kernel.dylib
Local symbolization failed for libc++.1.dylib: unrecognized binary: /usr/lib/libc++.1.dylib
Local symbolization failed for libsystem_pthread.dylib: unrecognized binary: /usr/lib/system/libsystem_pthread.dylib
Local symbolization failed for libsystem_platform.dylib: unrecognized binary: /usr/lib/system/libsystem_platform.dylib
Local symbolization failed for libsystem_malloc.dylib: unrecognized binary: /usr/lib/system/libsystem_malloc.dylib
Local symbolization failed for libdyld.dylib: unrecognized binary: /usr/lib/system/libdyld.dylib
Local symbolization failed for libsystem_c.dylib: unrecognized binary: /usr/lib/system/libsystem_c.dylib
Local symbolization failed for libsystem_m.dylib: unrecognized binary: /usr/lib/system/libsystem_m.dylib

After a quick change in pprof code I can see the error that's being thrown when trying to open by macho:

Local symbolization failed for libsystem_kernel.dylib: Parsing /usr/lib/system/libsystem_kernel.dylib: invalid magic number in record at byte 0x0
Local symbolization failed for libc++.1.dylib: Parsing /usr/lib/libc++.1.dylib: invalid magic number in record at byte 0x0
Local symbolization failed for libsystem_pthread.dylib: Parsing /usr/lib/system/libsystem_pthread.dylib: invalid magic number in record at byte 0x0
Local symbolization failed for libsystem_platform.dylib: Parsing /usr/lib/system/libsystem_platform.dylib: invalid magic number in record at byte 0x0
Local symbolization failed for libsystem_malloc.dylib: Parsing /usr/lib/system/libsystem_malloc.dylib: invalid magic number in record at byte 0x0
Local symbolization failed for libdyld.dylib: Parsing /usr/lib/system/libdyld.dylib: invalid magic number in record at byte 0x0
Local symbolization failed for libsystem_c.dylib: Parsing /usr/lib/system/libsystem_c.dylib: invalid magic number in record at byte 0x0
Local symbolization failed for libsystem_m.dylib: Parsing /usr/lib/system/libsystem_m.dylib: invalid magic number in record at byte 0x0

from pprof.

singalen avatar singalen commented on September 26, 2024
  1. Reproduced on recent master of gperftools + Go pprof on C++ binary.
  2. Can't get main executable's symbols in the profile either, both with -g or with -ggdb.

from pprof.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.