public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/29610] New: support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol
@ 2022-09-25  3:59 dodji at redhat dot com
  2022-10-11 20:19 ` [Bug default/29610] " woodard at redhat dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: dodji at redhat dot com @ 2022-09-25  3:59 UTC (permalink / raw)
  To: libabigail

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

            Bug ID: 29610
           Summary: support reading an ocaml abixml symbol table table
                    where a function symbol aliases a variable symbol
           Product: libabigail
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
          Assignee: dodji at redhat dot com
          Reporter: dodji at redhat dot com
                CC: libabigail at sourceware dot org
  Target Milestone: ---

Created attachment 14357
  --> https://sourceware.org/bugzilla/attachment.cgi?id=14357&action=edit
Shell script reproducer

Apparently in ELF files generated by Ocaml, a function symbol can alias a
variable symbol, at least on s390 and ppc64le.

This is not yet supported by libabigail's abixml reader as it assumes that a
function symbol can only alias another function symbol, and similarly for
variable symbols.

In abg-reader.cc, build_elf_symbol_db is called to build either a variable or
function symbol and return it.  It expects that the resulting function symbol
map or variable symbol map is self-contained.  In other words, if a symbol from
a given map aliases another one, then the aliased symbol is also part of the
same map.

To support having one kind of symbol alias the other kind, build_elf_symbol
should also return a map of symbols aliases that are not yet resolved.

Then, read_symbol_db_from_input (which calls build_elf_symbol_db) would then do
the work of resolving the still-not-resolved aliased symbol, i.e, making a
function symbol potentially alias a variable symbol and vice versa.

A reproducer shell script is attached.  It reproduces the issue on the
usr/bin/virt-get-kernel binary of the guestfs-tools-1.48.2-1.fc36.s390x.rpm
package.
So, it downloads the package from the Fedora Koji build system, unpacks it and
runs abidw --abidiff on it.

The execution violates an assert in build_elf_symbol_db

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug default/29610] support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol
  2022-09-25  3:59 [Bug default/29610] New: support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol dodji at redhat dot com
@ 2022-10-11 20:19 ` woodard at redhat dot com
  2023-01-07  0:43 ` woodard at redhat dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: woodard at redhat dot com @ 2022-10-11 20:19 UTC (permalink / raw)
  To: libabigail

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

--- Comment #1 from Ben Woodard <woodard at redhat dot com> ---
With the latest trunk as of 4c5f44473e9f7c0a561174fdc6cc89f40dd9892a

The ocaml asserts continue to happen. It would be nice if instead of an assert,
it printed out some useful message or something.

In addition to affecting ocaml that assert:
../../../libabigail/src/abg-reader.cc:3400:
abigail::ir::string_elf_symbols_map_sptr
abigail::xml_reader::build_elf_symbol_db(read_context&, xmlNodePtr, bool):
Assertion `__abg_cond__' failed.

Also seems to affect the planets and why3 packages in Fedora 37

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug default/29610] support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol
  2022-09-25  3:59 [Bug default/29610] New: support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol dodji at redhat dot com
  2022-10-11 20:19 ` [Bug default/29610] " woodard at redhat dot com
@ 2023-01-07  0:43 ` woodard at redhat dot com
  2023-03-24 17:41 ` dodji at redhat dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: woodard at redhat dot com @ 2023-01-07  0:43 UTC (permalink / raw)
  To: libabigail

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

--- Comment #2 from Ben Woodard <woodard at redhat dot com> ---
The current location of this problem is:

abipkgdiff: ../../../libabigail/src/abg-reader.cc:3249:
abigail::ir::string_elf_symbols_map_sptr
abigail::abixml::build_elf_symbol_db(reader&, xmlNodePtr, bool): Assertion
`__abg_cond__' failed.

with trunk as of 5d97da97

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug default/29610] support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol
  2022-09-25  3:59 [Bug default/29610] New: support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol dodji at redhat dot com
  2022-10-11 20:19 ` [Bug default/29610] " woodard at redhat dot com
  2023-01-07  0:43 ` woodard at redhat dot com
@ 2023-03-24 17:41 ` dodji at redhat dot com
  2023-03-27 19:13 ` woodard at redhat dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dodji at redhat dot com @ 2023-03-24 17:41 UTC (permalink / raw)
  To: libabigail

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

dodji at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |29687


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=29687
[Bug 29687] coq-core  from F37 asserts when trying to do a self compare,
probably due to lack of ocaml support
-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug default/29610] support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol
  2022-09-25  3:59 [Bug default/29610] New: support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol dodji at redhat dot com
                   ` (2 preceding siblings ...)
  2023-03-24 17:41 ` dodji at redhat dot com
@ 2023-03-27 19:13 ` woodard at redhat dot com
  2023-04-11 14:44 ` dodji at redhat dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: woodard at redhat dot com @ 2023-03-27 19:13 UTC (permalink / raw)
  To: libabigail

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

--- Comment #3 from Ben Woodard <woodard at redhat dot com> ---
Taken together with the one showing up in coq these represent 147/213 of the
assertions:
     60 abipkgdiff: ../../../libabigail/src/abg-reader.cc:3271:
abigail::ir::string_elf_symbols_map_sptr
abigail::abixml::build_elf_symbol_db(reader&, xmlNodePtr, bool): Assertion
`__abg_cond__' failed.
     87 abipkgdiff: ../../../libabigail/src/abg-reader.cc:3271:
abigail::ir::string_elf_symbols_map_sptr
abigail::abixml::build_elf_symbol_db(abigail::abixml::reader&, xmlNodePtr,
bool): Assertion `__abg_cond__' failed.

I would request a more graceful exit than an assert or at least an error
message before the assert that mentions the fact that it is a known unsupported
feature. 

It is fine if the support for these features gets pushed to a later release.

This affects the following 74 packages:
alt-ergo-gui alt-ergo bibtex2html coccinelle coq-coqide coq-core frama-c
freetennis guestfs-tools haxe hevea ocaml-atd ocaml-biniou-devel ocaml-biniou
ocaml-bisect-ppx ocaml-camlp5-devel ocaml-camlp5 ocaml-cil-cilly ocaml-cinaps
ocaml-cppo ocaml-csv ocaml-cudf ocaml-dune ocaml-findlib ocaml-gettext-camomile
ocaml-gettext-devel ocaml-gettext ocamlify ocaml-lablgtk3 ocaml-lambda-term
ocaml-lwt-ppx ocaml-mdx ocaml-menhir ocaml-merlin ocamlmod ocaml-obuild
ocaml-ocamlbuild ocaml-ocamldoc ocaml-ocamlgraph-tools ocaml-ocamlnet
ocaml-ocp-indent ocaml-octavius ocaml-odoc ocaml-omake ocaml ocaml-ppx-assert
ocaml-ppx-base ocaml-ppx-cold ocaml-ppx-custom-printf ocaml-ppx-deriving
ocaml-ppx-expect ocaml-ppx-here ocaml-ppx-import ocaml-ppx-inline-test
ocaml-ppx-js-style ocaml-ppx-let ocaml-ppxlib ocaml-psmt2-frontend ocaml-qtest
ocaml-sedlex ocaml-tplib-tools ocaml-tyxml-jsx ocaml-tyxml-ppx ocaml-xmlm
ocaml-yojson opam-installer opam planets prooftree supermin virt-top virt-v2v
why3 zenon

The following 10 are not obviously part of ocaml or coq:
bibtex2html coccinelle freetennis guestfs-tools haxe hevea planets supermin
virt-top virt-v2v 

They should probably be looked at more closely to figure out if there is some
non-ocaml feature whose support is missing.

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug default/29610] support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol
  2022-09-25  3:59 [Bug default/29610] New: support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol dodji at redhat dot com
                   ` (3 preceding siblings ...)
  2023-03-27 19:13 ` woodard at redhat dot com
@ 2023-04-11 14:44 ` dodji at redhat dot com
  2023-04-11 14:46 ` dodji at redhat dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dodji at redhat dot com @ 2023-04-11 14:44 UTC (permalink / raw)
  To: libabigail

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

dodji at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |29331


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=29331
[Bug 29331] bibtex2html and alt-ergo assert when doing fedabipkgdiff on ppc64le
arch
-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug default/29610] support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol
  2022-09-25  3:59 [Bug default/29610] New: support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol dodji at redhat dot com
                   ` (4 preceding siblings ...)
  2023-04-11 14:44 ` dodji at redhat dot com
@ 2023-04-11 14:46 ` dodji at redhat dot com
  2023-04-11 14:49 ` dodji at redhat dot com
  2023-04-11 15:41 ` dodji at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: dodji at redhat dot com @ 2023-04-11 14:46 UTC (permalink / raw)
  To: libabigail

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

dodji at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|29331                       |
         Depends on|                            |29331


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=29331
[Bug 29331] bibtex2html and alt-ergo assert when doing fedabipkgdiff on ppc64le
arch
-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug default/29610] support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol
  2022-09-25  3:59 [Bug default/29610] New: support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol dodji at redhat dot com
                   ` (5 preceding siblings ...)
  2023-04-11 14:46 ` dodji at redhat dot com
@ 2023-04-11 14:49 ` dodji at redhat dot com
  2023-04-11 15:41 ` dodji at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: dodji at redhat dot com @ 2023-04-11 14:49 UTC (permalink / raw)
  To: libabigail

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

dodji at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|29687                       |
         Depends on|                            |29687


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=29687
[Bug 29687] coq-core  from F37 asserts when trying to do a self compare,
probably due to lack of ocaml support
-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug default/29610] support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol
  2022-09-25  3:59 [Bug default/29610] New: support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol dodji at redhat dot com
                   ` (6 preceding siblings ...)
  2023-04-11 14:49 ` dodji at redhat dot com
@ 2023-04-11 15:41 ` dodji at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: dodji at redhat dot com @ 2023-04-11 15:41 UTC (permalink / raw)
  To: libabigail

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

dodji at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |29412


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=29412
[Bug 29412] libabigail 2.2 Assertion metabug
-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-04-11 15:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-25  3:59 [Bug default/29610] New: support reading an ocaml abixml symbol table table where a function symbol aliases a variable symbol dodji at redhat dot com
2022-10-11 20:19 ` [Bug default/29610] " woodard at redhat dot com
2023-01-07  0:43 ` woodard at redhat dot com
2023-03-24 17:41 ` dodji at redhat dot com
2023-03-27 19:13 ` woodard at redhat dot com
2023-04-11 14:44 ` dodji at redhat dot com
2023-04-11 14:46 ` dodji at redhat dot com
2023-04-11 14:49 ` dodji at redhat dot com
2023-04-11 15:41 ` dodji at redhat dot com

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).