[Bug,default/26127] New: abidw --annotate emits incomplete function types

Message ID bug-26127-9487@http.sourceware.org/bugzilla/
State Dropped
Headers
Series [Bug,default/26127] New: abidw --annotate emits incomplete function types |

Commit Message

fche at redhat dot com June 17, 2020, 7:43 a.m. UTC
  https://sourceware.org/bugzilla/show_bug.cgi?id=26127

            Bug ID: 26127
           Summary: abidw --annotate emits incomplete function types
           Product: libabigail
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: gprocida+abigail at google dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

This issue is similar to https://sourceware.org/bugzilla/show_bug.cgi?id=25986
in that incorrect function types are being emitted.

For example,
tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi contains

    <!-- void ()* -->
    <pointer-type-def type-id='type-id-342' size-in-bits='64'
id='type-id-343'/>

but this should be

    <!-- std::basic_ostream<char, std::char_traits<char> >&
(std::basic_ostream<char, std::char_traits<char> >&)* -->
    <pointer-type-def type-id='type-id-342' size-in-bits='64'
id='type-id-343'/>

Here's a "fix" which might help determine the root cause.

commit af00b1f690e6a1541be513d50d2c426cb7659fcf (HEAD -> bad-annotation)
Author: Giuliano Procida <gprocida@google.com>
Date:   Tue Jun 16 23:30:09 2020 +0100

    Bodge to fix abidw --annotate function types.

    Signed-off-by: Giuliano Procida <gprocida@google.com>
  

Comments

fche at redhat dot com June 17, 2020, 11:08 a.m. UTC | #1
https://sourceware.org/bugzilla/show_bug.cgi?id=26127

dodji at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-06-17
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
  
fche at redhat dot com June 18, 2020, 2 p.m. UTC | #2
https://sourceware.org/bugzilla/show_bug.cgi?id=26127

dodji at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #1 from dodji at redhat dot com ---
This problem should hopefully be fixed in the master branch by commit
https://sourceware.org/git/?p=libabigail.git;a=commit;h=a5d02b95a673651f2009faeefdc394078c251a7e.

Thank you for reporting this problem and sorry for the inconvenience.
  

Patch

diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index 5e2506a2..2da3f8a5 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -11762,6 +11762,8 @@  type_base::get_canonical_type_for(type_base_sptr t)
   if (!t)
     return t;

+  t->get_pretty_representation();
+
   environment* env = t->get_environment();
   ABG_ASSERT(env);