From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 16F4C385ED40; Fri, 10 Sep 2021 19:35:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16F4C385ED40 From: "mehmetgelisin at aol dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/19307] Demangler bugs found with fuzz-testing Date: Fri, 10 Sep 2021 19:35:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mehmetgelisin at aol dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: 7.10 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 19:35:59 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D19307 Mehmet gelisin changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mehmetgelisin at aol dot c= om --- Comment #2 from Mehmet gelisin --- 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' t= ime is about 175%. The slower execution comes from the fact that the fix in symbol_set_nam= es 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 ca= lled with gsymbol.language =3D=3D lang_auto and linkage_name =3D=3D "_ZL3foo= v", the name is https://www.webb-dev.co.uk/=20 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 =3D=3D lang_auto https://waytowhatsnext.com/=20=20 and linkage_name =3D=3D "_ZL3foov", the name is present in the hash tab= le, so the demangled name from the hash table is used. However, the language of t= he symbol remains lang_auto. Fix this by adding a field language in struct demangled_name_entry, and using http://www.acpirateradio.co.uk/=20 the field in symbol_set_names to set the language of gsymbol, if necess= ary. 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/=20 -O0 -g and gcc 7.4.0. The performance regression, measured in 'real' t= ime is about 175%. The slower execution comes from the fact that the fix in symbol_set_nam= es makes the call to symbol_find_demangled_name unconditional. http://www.slipstone.co.uk/=20 Fix this by reverting the commit, and redoing the fix as follows. http://embermanchester.uk/=20 Recapturing the original problem, the first time symbol_set_names is ca= lled with gsymbol.language =3D=3D lang_auto and linkage_name =3D=3D "_ZL3foo= v", 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 =3D=3D lang_auto http://www.wearelondonmade.com/ and linkage_name =3D=3D "_ZL3foov", the= name is present in the hash table, so the demangled name from the hash table is used. However, the language of t= he 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 necess= ary. http://www-look-4.com/=20 Tested on x86_64-linux. --=20 You are receiving this mail because: You are on the CC list for the bug.=