public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: "gprocida at google dot com" <sourceware-bugzilla@sourceware.org>
To: libabigail@sourceware.org
Subject: [Bug default/29441] New: name demangling should not be done on variable names
Date: Wed, 03 Aug 2022 12:28:33 +0000	[thread overview]
Message-ID: <bug-29441-9487@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=29441

            Bug ID: 29441
           Summary: name demangling should not be done on variable names
           Product: libabigail
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: gprocida at google dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

Hi Dodji.

We noticed some odd output with abidw --annotate. Simple C++ code like:

struct A { int x; };
A v;

results in the annotation for A:

<!-- void -->

This is because "v" as a type demangles to "void". There is no way to turn off
this behaviour at the abi::__cxa_demangle level.

The fix is to ensure that *only* mangled names are passed to the function.

All callers to demangle_cplus_mangled_name are at risk of giving incorrect
results, including compare_symbol_name which itself has a few callers.

One issue is that symbol name is copied into linkage_name (if absent) so the
presence of linkage_name cannot be used indicator of a name being mangled.

If linkage_name cannot be relied on, then it may be possible to only attempt to
demangle C++ function linkage names and nothing else.

Giuliano.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2022-08-03 12:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-03 12:28 gprocida at google dot com [this message]
2022-08-03 12:39 ` [Bug default/29441] " gprocida at google dot com
2022-08-03 14:32 ` gprocida at google dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-29441-9487@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).