libalog and dbusada ftbfs on s390x with gnat-13

Bug #2058742 reported by Matthias Klose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc
New
Medium
dbusada (Ubuntu)
New
Undecided
Unassigned
gcc-13 (Ubuntu)
New
Undecided
Unassigned
libalog (Ubuntu)
New
Undecided
Unassigned

Bug Description

libalog and dbusada ftbfs on s390x with gnat-13, not seen in Debian, assuming an issue with the different baseline on s390x.

during RTL pass: dwarf2
+===========================GNAT BUG DETECTED==============================+
| 13.2.0 (s390x-linux-gnu) in connect_traces, at dwarf2cfi.cc:3079 |
| Error detected around /<<PKGBUILDDIR>>/src/d_bus-message_dispatcher-proc.adb:90:8|
| Compiling /<<PKGBUILDDIR>>/src/d_bus-message_dispatcher-proc.adb|
| Please submit a bug report; see https://gcc.gnu.org/bugs/ . |
| Use a subject line meaningful to you and us to track the bug. |
| Include the entire contents of this bug box in the report. |
| Include the exact command that you entered. |
| Also include sources listed below. |
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.
Consider also -gnatd.n switch (see debug.adb).

/<<PKGBUILDDIR>>/src/d_bus-message_dispatcher-proc.adb
/<<PKGBUILDDIR>>/src/d_bus-message_dispatcher-proc.ads
/<<PKGBUILDDIR>>/src/d_bus-message_dispatcher.ads
/<<PKGBUILDDIR>>/src/d_bus.ads
/<<PKGBUILDDIR>>/src/d_bus-connection.ads
/<<PKGBUILDDIR>>/thin/dbus_connection_h.ads
/<<PKGBUILDDIR>>/thin/dbus_types_h.ads
/<<PKGBUILDDIR>>/thin/dbus_arch_deps_h.ads
/<<PKGBUILDDIR>>/thin/dbus_shared_h.ads
/<<PKGBUILDDIR>>/thin/dbus_memory_h.ads
/<<PKGBUILDDIR>>/thin/stddef_h.ads
/<<PKGBUILDDIR>>/thin/dbus_message_h.ads
/<<PKGBUILDDIR>>/thin/dbus_errors_h.ads
/<<PKGBUILDDIR>>/thin/dbus_pending_call_h.ads
/<<PKGBUILDDIR>>/src/d_bus-arguments.ads
/<<PKGBUILDDIR>>/src/d_bus-marshaling.ads
/<<PKGBUILDDIR>>/src/d_bus-messages.ads
/<<PKGBUILDDIR>>/src/d_bus-types.ads

raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:414

during RTL pass: dwarf2
+===========================GNAT BUG DETECTED==============================+
| 13.2.0 (s390x-linux-gnu) in connect_traces, at dwarf2cfi.cc:3079 |
| Error detected around /<<PKGBUILDDIR>>/src/alog-protected_containers.adb:69:11|
| Compiling /<<PKGBUILDDIR>>/src/alog-protected_containers.adb|
| Please submit a bug report; see https://gcc.gnu.org/bugs/ . |
| Use a subject line meaningful to you and us to track the bug. |
| Include the entire contents of this bug box in the report. |
| Include the exact command that you entered. |
| Also include sources listed below. |
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.
Consider also -gnatd.n switch (see debug.adb).

/<<PKGBUILDDIR>>/src/alog-protected_containers.adb
/<<PKGBUILDDIR>>/src/alog-protected_containers.ads
/<<PKGBUILDDIR>>/src/alog.ads
/<<PKGBUILDDIR>>/src/alog-log_request.ads

raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:414

   compilation of alog-protected_containers.adb failed

Revision history for this message
In , Doko-v (doko-v) wrote :

seen with the gcc-13 branch on s390x-linux-gnu, didn't try trunk yet, fails in Ubuntu with --with-arch=z13 --with-tune=z16, but succeeds in Debian with --with-arch=z196.

[...]
during RTL pass: dwarf2
+===========================GNAT BUG DETECTED==============================+
| 13.2.0 (s390x-linux-gnu) in connect_traces, at dwarf2cfi.cc:3079 |
| Error detected around /<<PKGBUILDDIR>>/src/alog-protected_containers.adb:69:11|
| Compiling /<<PKGBUILDDIR>>/src/alog-protected_containers.adb|
| Please submit a bug report; see https://gcc.gnu.org/bugs/ . |
| Use a subject line meaningful to you and us to track the bug. |
| Include the entire contents of this bug box in the report. |
| Include the exact command that you entered. |
| Also include sources listed below. |
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.
Consider also -gnatd.n switch (see debug.adb).

/<<PKGBUILDDIR>>/src/alog-protected_containers.adb
/<<PKGBUILDDIR>>/src/alog-protected_containers.ads
/<<PKGBUILDDIR>>/src/alog.ads
/<<PKGBUILDDIR>>/src/alog-log_request.ads

raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:414

   compilation of alog-protected_containers.adb failed

full build log at
https://launchpad.net/ubuntu/+source/libalog/0.6.2-5/+build/27944112

Changed in gcc:
importance: Unknown → Medium
status: Unknown → New
bugproxy (bugproxy)
tags: added: architecture-s39064 bugnameltc-205913 severity-medium targetmilestone-inin---
Revision history for this message
In , Stefansf (stefansf) wrote :

Reproducible via

$ wget https://www.codelabs.ch/download/libalog-0.6.2.tar.bz2
$ tar xf libalog-0.6.2.tar.bz2
$ gcc -c -x ada -gnatA -gnatygAdISuxo -gnatVa -gnatwal -gnatf -fstack-check -gnato -g -O2 -fno-omit-frame-pointer -mbackchain -gnatwe -fPIC libalog-0.6.2/src/alog-active_logger.adb

Started with r12-4926-g79fe28d2c4b785
Confirmed on trunk r14-9999-g9c7cf5d71f0716

@Doko does Debian use -mbackchain? I can reproduce this on Ubuntu even for z196 but -mbackchain and -fstack-check are required in order to fail. For me 12.3 is failing, too, which matches with my bisect. How did you test 12.3?

Revision history for this message
In , Stefansf (stefansf) wrote :

Fails for function alog.active_logger.logging_taskT and trace 2 whose heads are

(gdb) call debug(ti->head)
(code_label 48 573 49 152 (nil) [2 uses])

(gdb) call debug(ti->eh_head)
(insn 57 765 58 (set (reg/f:DI 14 %r14 [orig:74 _39 ] [74])
        (mem/f:DI (reg/f:DI 10 %r10 [orig:123 _task ] [123]) [0 _task_25(D)->parent+0 S8 A64])) "libalog-0.6.2/src/alog-active_logger.adb":252:33 discrim 2 1477 {*movdi_64}
     (expr_list:REG_EH_REGION (const_int 6 [0x6])
        (nil)))

Looking at the trace there exists no insn with a ARGS_SIZE note which is why

gcc_assert (!ti->args_size_undefined || ti->args_size_defined_for_eh);

fails.

Revision history for this message
In , Stefansf (stefansf) wrote :

Created attachment 57971
dwarf2cfi dump for alog-active_logger.adb

Revision history for this message
In , Stefansf (stefansf) wrote :

Ignore the previous comment. With -fstack-check and -mbackchain we have for trace 2 an incoming edge from trace 1 (fallthrough) where cur_trace->end_true_args_size == 48 and from further incoming edges as e.g. from trace 7 where cur_trace->end_true_args_size == 0 which is why the args_size is supposed to be undefined.

Interestingly, trace 2 resides in the function body whereas trace 7 resides in the epilogue, i.e., we have a jump from the epilogue into the function body:

(note 597 810 634 NOTE_INSN_PROLOGUE_END)
...
(insn 635 677 566 (set (reg/f:DI 15 %r15)
        (plus:DI (reg/f:DI 15 %r15)
            (const_int 8216 [0x2018]))) "libalog-0.6.2/src/alog-active_logger.adb":244:4 1481 {*la_64}
     (expr_list:REG_ARGS_SIZE (const_int 48 [0x30])
        (nil)))
...
(code_label 48 573 49 152 (nil) [2 uses])
...
(note 673 768 599 NOTE_INSN_EPILOGUE_BEG)
...
(insn 159 163 160 (set (reg/f:DI 15 %r15)
        (reg/f:DI 6 %r6 [orig:79 saved_stack.186_50 ] [79])) "libalog-0.6.2/src/alog-active_logger.adb":260:0 discrim 10 1477 {*movdi_64}
     (expr_list:REG_DEAD (reg/f:DI 6 %r6 [orig:79 saved_stack.186_50 ] [79])
        (expr_list:REG_ARGS_SIZE (const_int 0 [0])
            (nil))))
...
(jump_insn 645 644 646 (set (pc)
        (label_ref 48)) 2170 {*jump64}
     (nil)
 -> 48)

This is also the case when -fno-shrink-wrap is used.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.