Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-d inlines doesn't work #13

Closed
octoploid opened this issue Nov 9, 2016 · 11 comments
Closed

-d inlines doesn't work #13

octoploid opened this issue Nov 9, 2016 · 11 comments

Comments

@octoploid
Copy link

~ % echo "int main(){}" | g++ -g -x c++ - && bloaty -d inlines ./a.out
bloaty: internal error, specified same DWARF attribute more than once
@haberman
Copy link
Member

haberman commented Nov 10, 2016

Can you attach your a.out? I can't reproduce this. On my system I get:

# uname -a
Linux 2e6f906813a8 4.4.20-moby #1 SMP Thu Sep 15 12:10:20 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
# echo "int main(){}" | g++ -g -x c++ - && ./bloaty -d inlines ./a.out
     VM SIZE                 FILE SIZE
 --------------           --------------
 100.0%  4.00Mi <stdin>:1  1.24Ki  13.7%
   0.0%     996 [None]     7.83Ki  86.3%
 100.0%  4.00Mi TOTAL      9.07Ki 100.0%

Those results are suspect, but it's not the same as the error you got.

@octoploid
Copy link
Author

a.out.gz

@froydnj
Copy link

froydnj commented Nov 10, 2016

I saw the same error after running bloaty for over an hour on Firefox's libxul.so.

@haberman
Copy link
Member

Thanks for the reports -- I've been able to reproduce this now, and am working on a fix as we speak.

@octoploid
Copy link
Author

Thanks for the fix. However it now produces "bogus" output for me:

 % ./bloaty -d inlines bloaty
     VM SIZE                                    FILE SIZE
 --------------                              --------------
   2.4%   111Ki [None]                        8.45Mi  95.7%
  89.4%  4.01Mi ../sysdeps/x86_64start.S:63   14.8Ki   0.2%
   8.1%   373Ki ../sysdeps/x86_64crti.S:69     373Ki   4.1%
   0.0%       7 ../sysdeps/x86_64start.S:107       7   0.0%
   0.0%       7 ../sysdeps/x86_64start.S:108       7   0.0%
   0.0%       7 ../sysdeps/x86_64start.S:110       7   0.0%
   0.0%       6 ../sysdeps/x86_64start.S:120       6   0.0%
   0.0%       4 ../sysdeps/x86_64crti.S:80         4   0.0%
   0.0%       4 ../sysdeps/x86_64crtn.S:44         4   0.0%
   0.0%       4 ../sysdeps/x86_64start.S:90        4   0.0%
   0.0%       3 ../sysdeps/x86_64start.S:79        3   0.0%
   0.0%       3 ../sysdeps/x86_64start.S:88        3   0.0%
   0.0%       1 ../sysdeps/x86_64crtn.S:45         1   0.0%
   0.0%       1 ../sysdeps/x86_64start.S:122       1   0.0%
   0.0%       1 ../sysdeps/x86_64start.S:85        1   0.0%
   0.0%       1 ../sysdeps/x86_64start.S:93        1   0.0%
   0.0%       1 ../sysdeps/x86_64start.S:97        1   0.0%
 100.0%  4.49Mi TOTAL                         8.83Mi 100.0%

@haberman
Copy link
Member

Whoops, clearly I need some better tests for this.

@haberman
Copy link
Member

Hmm, I can't reproduce your results. Here's what I get on my system:

$ ./bloaty bloaty -d inlines
     VM SIZE                                                                                        FILE SIZE
 --------------                                                                                  --------------
  27.1%   124Ki [None]                                                                            7.11Mi  95.6%
  55.1%   254Ki [Other]                                                                            254Ki   3.3%
   1.8%  8.34Ki /usr/include/c++/4.8ostream:535                                                   8.34Ki   0.1%
   1.6%  7.57Ki /usr/include/c++/4.8/bitsbasic_ios.h:456                                          7.57Ki   0.1%
   1.4%  6.66Ki /usr/include/c++/4.8/bitsbasic_string.h:539                                       6.66Ki   0.1%
   1.3%  6.19Ki /usr/include/c++/4.8streambuf:466                                                 6.19Ki   0.1%
   1.2%  5.48Ki /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/extatomicit  5.48Ki   0.1%
   1.0%  4.64Ki /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/extatomicit  4.64Ki   0.1%
   1.0%  4.60Ki /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bitsmove.h:  4.60Ki   0.1%
   0.9%  4.34Ki /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bitsmove.h:  4.34Ki   0.1%
   0.9%  4.28Ki /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bitsbasic_s  4.28Ki   0.1%
   0.8%  3.80Ki /usr/include/c++/4.8/bitsbasic_string.h:249                                       3.80Ki   0.0%
   0.8%  3.58Ki /usr/include/c++/4.8/bitsbasic_ios.h:276                                          3.58Ki   0.0%
   0.7%  3.38Ki /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bitsbasic_s  3.38Ki   0.0%
   0.7%  3.20Ki /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bitsbasic_s  3.20Ki   0.0%
   0.6%  2.92Ki /usr/include/c++/4.8/bitsbasic_string.h:583                                       2.92Ki   0.0%
   0.6%  2.89Ki /usr/include/c++/4.8ostream:385                                                   2.89Ki   0.0%
   0.6%  2.69Ki /usr/include/c++/4.8/bitschar_traits.h:271                                        2.69Ki   0.0%
   0.6%  2.66Ki /usr/include/c++/4.8/bitsbasic_string.h:240                                       2.66Ki   0.0%
   0.6%  2.57Ki /usr/include/c++/4.8ostream:93                                                    2.57Ki   0.0%
   0.5%  2.49Ki /usr/include/c++/4.8sstream:424                                                   2.49Ki   0.0%
 100.0%   461Ki TOTAL                                                                             7.44Mi 100.0%

Can you attach the file that causes this output?

@haberman
Copy link
Member

What system are you working on, by the way?

@octoploid
Copy link
Author

I'm running Linux. And the output of "-d inlines" is always the same no matter what binary is used.
a.out.gz

@octoploid
Copy link
Author

Thanks it work fine now.
One additional nit: There is a missing / in the output, e.g.:

markus@x4 7.0.0 % bloaty -d inlines ./cc1plus
     VM SIZE                                            FILE SIZE
 --------------                                      --------------
  42.8%  12.1Mi [None]                                 181Mi  91.8%
  47.8%  13.6Mi [Other]                               13.6Mi   6.9%
   2.2%   649Ki ../../gcc/gcctree.h:3159               649Ki   0.3%
   1.5%   442Ki ../../gcc/gcctree.h:3158               442Ki   0.2%
   1.2%   353Ki ../../gcc/gcctree.h:3045               353Ki   0.2%
   0.7%   208Ki ../../gcc/gcctree.h:3168               208Ki   0.1%
   0.5%   136Ki ../../gcc/gcctree.h:3167               136Ki   0.1%
   0.5%   130Ki ../../gcc/gcctree.h:3044               130Ki   0.1%
   0.4%   103Ki ../../gcc/gccvec.h:732                 103Ki   0.1%
   0.3%  99.1Ki ../../gcc/gcctree.h:3545              99.1Ki   0.0%
   0.3%  92.2Ki .genrtl.h:29                          92.2Ki   0.0%
   0.3%  80.1Ki ../../gcc/gcctree.h:3245              80.1Ki   0.0%
   0.2%  60.7Ki ../../gcc/gccgimple-match-head.c:780  60.7Ki   0.0%
   0.2%  50.5Ki ../../gcc/gcctree.h:3214              50.5Ki   0.0%
   0.2%  47.6Ki ../../gcc/gcctree.h:3246              47.6Ki   0.0%
   0.2%  47.0Ki ../../gcc/gcctree.h:3248              47.0Ki   0.0%
   0.2%  46.0Ki ../../gcc/gccvec.h:1069               46.0Ki   0.0%
   0.1%  43.2Ki ../../gcc/gcctree.h:3531              43.2Ki   0.0%
   0.1%  39.7Ki ../../gcc/gcctree.h:3244              39.7Ki   0.0%
   0.1%  38.4Ki .genrtl.h:33                          38.4Ki   0.0%
   0.1%  38.3Ki ../../gcc/gccvec.h:288                38.3Ki   0.0%
 100.0%  28.3Mi TOTAL                                  197Mi 100.0%

Should be ../../gcc/gcc/tree.h:3159 not ../../gcc/gcctree.h:3159 .

@haberman
Copy link
Member

Ah yes. I've just pushed a fix for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants