* [Bug c++/19307] Demangler bugs found with fuzz-testing
[not found] <bug-19307-4717@http.sourceware.org/bugzilla/>
@ 2021-09-10 19:35 ` mehmetgelisin at aol dot com
2021-09-22 16:58 ` mervegunesli at aol dot com
` (2 subsequent siblings)
3 siblings, 0 replies; 4+ messages in thread
From: mehmetgelisin at aol dot com @ 2021-09-10 19:35 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=19307
Mehmet gelisin <mehmetgelisin at aol dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mehmetgelisin at aol dot com
--- Comment #2 from Mehmet gelisin <mehmetgelisin at aol dot com> ---
The commit "[gdb/symtab] Fix language of duplicate static minimal symbol"
introduces a performance regression, when loading a cc1 executable build
with https://komiya-dental.com/
-O0 -g and gcc 7.4.0. The performance regression, measured in 'real' time
is
about 175%.
The slower execution comes from the fact that the fix in symbol_set_names
makes the call to symbol_find_demangled_name unconditional.
http://www.iu-bloomington.com/
Fix this by reverting the commit, and redoing the fix as follows.
Recapturing the original problem, the first time symbol_set_names is called
with gsymbol.language == lang_auto and linkage_name == "_ZL3foov", the name
is https://www.webb-dev.co.uk/
not present in the per_bfd->demangled_names_hash hash table, so
symbol_find_demangled_name is called to demangle the name, after which the
mangled/demangled pair is added to the hashtable. The call to
symbol_find_demangled_name also sets gsymbol.language to lang_cplus.
The second time symbol_set_names is called with gsymbol.language ==
lang_auto https://waytowhatsnext.com/
and linkage_name == "_ZL3foov", the name is present in the hash table, so
the
demangled name from the hash table is used. However, the language of the
symbol remains lang_auto.
Fix this by adding a field language in struct demangled_name_entry, and
using http://www.acpirateradio.co.uk/
the field in symbol_set_names to set the language of gsymbol, if necessary.
Tested on x86_64-linux.
The commit "[gdb/symtab] Fix language of duplicate static minimal symbol"
introduces a performance regression, when loading a cc1 executable build
with http://www.logoarts.co.uk/
-O0 -g and gcc 7.4.0. The performance regression, measured in 'real' time
is
about 175%.
The slower execution comes from the fact that the fix in symbol_set_names
makes the call to symbol_find_demangled_name unconditional.
http://www.slipstone.co.uk/
Fix this by reverting the commit, and redoing the fix as follows.
http://embermanchester.uk/
Recapturing the original problem, the first time symbol_set_names is called
with gsymbol.language == lang_auto and linkage_name == "_ZL3foov",
http://connstr.net/ the name is
not present in the per_bfd->demangled_names_hash hash table, so
symbol_find_demangled_name is called to demangle the name, http://joerg.li/
after which the
mangled/demangled pair is added to the hashtable. The call to
symbol_find_demangled_name also sets gsymbol.language to lang_cplus.
http://www.jopspeech.com/
The second time symbol_set_names is called with gsymbol.language ==
lang_auto
http://www.wearelondonmade.com/ and linkage_name == "_ZL3foov", the name is
present in the hash table, so the
demangled name from the hash table is used. However, the language of the
symbol remains lang_auto.
http://www.compilatori.com/
Fix this by adding a field language in struct demangled_name_entry, and
using
the field in symbol_set_names to set the language of gsymbol, if necessary.
http://www-look-4.com/
Tested on x86_64-linux.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread