Skip to content

emsymbolizer failed to parse symbol map from C++ project #24982

@LanderlYoung

Description

@LanderlYoung

Please include the following in your bug report:

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 4.0.13 (2659582941bef14008476903f48941909db1b196)                                                                                                                                                                                                 ─╯
clang version 22.0.0git (https:/github.com/llvm/llvm-project 177f27d22092cb64e871e6cd2f8981d24e823186)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /Users/landerl/Applications/emsdk/upstream/bin

Failing command line in full:

$EMSDK/upstream/emscripten/emsymbolizer -s symbolmap -f cmake-build-wasm/dist/markxx.js.symbols cmake-build-wasm/dist/markxx.wasm 0x15452

emsymbolizer utility failed with the output

Traceback (most recent call last):bolizer -s symbolmap -f cmake-build-wasm/dist/markxx.js.symbols cmake-build-wasm/dist/markxx.wasm 0x15452                                                                                                                                                                              ─╯
  File "/Users/landerl/Applications/emsdk/upstream/emscripten/emsymbolizer.py", line 295, in <module>
    rv = main(get_args())
  File "/Users/landerl/Applications/emsdk/upstream/emscripten/emsymbolizer.py", line 265, in main
    symbolize_address_symbolmap(module, address, args.file)
  File "/Users/landerl/Applications/emsdk/upstream/emscripten/emsymbolizer.py", line 226, in symbolize_address_symbolmap
    index, name = line.split(':')
ValueError: too many values to unpack (expected 2)

Turns out c++ symbol map has the namespace delimtier :: which render the python code index, name = line.split(':') to fail

example symbol map markxx.js.symbols:

12457:std::length_error::~length_error\28\29_12457
12458:std::out_of_range::~out_of_range\28\29
12459:std::overflow_error::~overflow_error\28\29
12460:std::bad_cast::~bad_cast\28\29_12460
12461:std::bad_cast::what\28\29\20const

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