bloat
bloat copied to clipboard
bloat.py syms doesn't deal well with duplicated symbols in anonymous namespaces
I ran into this error today:
Traceback (most recent call last):
File "./bloat.py", line 408, in <module>
dump_nm(nmfile, strip_prefix=opts.strip_prefix, cppfilt=opts.cppfilt)
File "./bloat.py", line 305, in dump_nm
json.dumps(jsonify_tree(dirs, '[everything]'), indent=2))
File "./bloat.py", line 270, in jsonify_tree
subtree = jsonify_tree(val, key)
File "./bloat.py", line 276, in jsonify_tree
assert len(symbols) == 1, symbols.values()[0] == 1
AssertionError: True
As best I can tell, this is caused by having the following in nm.out:
0000000003de3c00 0000000000000080 d (anonymous namespace)::gHistograms
...
00000000031cf640 000000000000bf20 r (anonymous namespace)::gHistograms
which is legal C++, but problematic for any scheme that assumes that the name equivalency of symbols implies equivalency of the symbols themselves.