Bug 29292 - Several CTF tests FAIL on Solaris
Summary: Several CTF tests FAIL on Solaris
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: libctf (show other bugs)
Version: 2.39
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-27 09:23 UTC by Rainer Orth
Modified: 2022-06-27 09:23 UTC (History)
0 users

See Also:
Host:
Target: *-*-solaris2.11
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Orth 2022-06-27 09:23:28 UTC
When building binutils trunk with gcc 12.1.0, several CTF tests FAIL:

FAIL: Arrays (conflicted)
FAIL: Conflicting cycle 1.B-1
FAIL: Conflicting cycle 1.B-2
FAIL: Conflicting cycle 1.parent
FAIL: Conflicting cycle 2.A-1
FAIL: Conflicting cycle 2.A-2
FAIL: Conflicting cycle 2.parent
FAIL: Conflicting cycle 3.C-1
FAIL: Conflicting cycle 3.C-2
FAIL: Conflicting cycle 3
FAIL: Conflicting Enums
FAIL: Conflicting Typedefs
FAIL: cross-TU-cyclic-conflicting
FAIL: cross-TU-into-cycle

FAIL: /vol/src/gnu/binutils/hg/master/dist/libctf/testsuite/libctf-lookup/ambiguous-struct.c
FAIL: /vol/src/gnu/binutils/hg/master/dist/libctf/testsuite/libctf-regression/libctf-repeat-cu.exp
FAIL: /vol/src/gnu/binutils/hg/master/dist/libctf/testsuite/libctf-regression/pptrtab.c

(Btw., the libctf test names shouldn't contain full pathnames: this makes comparing
test results between different builds unnecessarily difficult.)

E.g. for libctf-regression/libctf-repeat-cu.exp I get

$ ../binutils/objdump --ctf tmpdir/libctf-repeat-cu-main.so

tmpdir/libctf-repeat-cu-main.so:     file format elf64-x86-64-sol2

../binutils/objdump: error: ctf_arc_bufopen(): cannot open CTF
../binutils/objdump: CTF open failure: Buffer does not contain CTF data.
../binutils/objdump: tmpdir/libctf-repeat-cu-main.so: file in wrong format

Looking at the .ctf section of the shared object, I find that the header is
missing:

$ od -x dump.ctf |head
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0000100 0000 0000 0000 0000 010c 0000 0000 0000
0000120 dff2 0e04 0000 0000 0000 0000 0000 0000

compared to the same operation on Linux/x86_64:

$  od -x dump.x86_64.ctf |head
0000000 3eeb d762 f2a4 8b47 0002 0000 0000 0000
0000020 0002 0000 0000 0000 0210 0000 0000 0000
0000040 0048 0000 0000 0000 0000 0000 0000 0000
0000060 0000 0000 0000 0000 0005 0000 0000 0000
0000100 0110 0000 0000 0000 010c 0000 0000 0000
0000120 dff2 0e04 0000 0000 0000 0000 0000 0000

On a hunch, I disabled HAVE_MMAP in libctf/ctf-archive.c and with two
exceptions the tests now all PASS:

FAIL: Diagnostics - Invalid CU name offset
FAIL: Diagnostics - Non-zero parlabel in parent

I haven't yet found what's wrong: if the mmap code makes some unportable
assumption or Solaris mmap is weird in some way.