Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1860854 - gcc segfaults while building dmraid on s390x
Summary: gcc segfaults while building dmraid on s390x
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 33
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1860062 (view as bug list)
Depends On:
Blocks: 1863432
TreeView+ depends on / blocked
 
Reported: 2020-07-27 08:59 UTC by Hans de Goede
Modified: 2021-01-12 12:27 UTC (History)
11 users (show)

Fixed In Version: gcc-10.2.1-2.fc33
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-01-12 12:27:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 96335 0 P2 RESOLVED [10/11 Regression] ICE in maybe_warn_rdwr_sizes since r10-4929 2021-01-12 12:21:03 UTC

Description Hans de Goede 2020-07-27 08:59:24 UTC
Description of problem:

dmraid fails to build with rawhide gcc versions, both with gcc-10.1.1-2.fc33 and with gcc-10.2.1-1.fc33.

The exact same sources did build fine on s390x with 10.0.1-0.13.fc33. So it seems this is a regression introduced in gcc 10.1.x .

I've tried disabling lto as well as disabling annobin, neither helps.

Here is the error with annobin enabled (the default) :

gcc -c -I. -I../include -I../lib -O2 -flto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=zEC12 -mtune=z13 -fasynchronous-unwind-tables -fstack-clash-protection -O2 -DDMRAID_NATIVE_LOG -DDMRAID_LED -DDMRAID_TEST -DDMRAID_LED -DDMRAID_INTEL_LED -DHAVE_GETOPTLONG -fPIC -Wall -Wundef -Wcast-align -Wwrite-strings -Winline -DDMRAID_AUTOREGISTER -g -fno-omit-frame-pointer -DDEBUG -D_LARGEFILE64_SOURCE -O2 -DDMRAID_NATIVE_LOG -DDMRAID_LED -DDMRAID_TEST -DDMRAID_LED -DDMRAID_INTEL_LED -DHAVE_GETOPTLONG -fPIC -Wall -Wundef -Wcast-align -Wwrite-strings -Winline -DDMRAID_AUTOREGISTER -g -fno-omit-frame-pointer -DDEBUG -D_LARGEFILE64_SOURCE misc/file.c -o misc/file.o
*** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_FINISH_UNIT               | annobin: Generate final annotations
PLUGIN_START_UNIT                | annobin: Generate global annotations
PLUGIN_ALL_PASSES_START          | annobin: Generate per-function annotations
PLUGIN_ALL_PASSES_END            | annobin: Register per-function end symbol
during RTL pass: expand
misc/file.c: In function 'read_file':
misc/file.c:80:11: internal compiler error: Segmentation fault
   80 |  else if (rw->func(fd, buffer, size) != size)
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.


I get the exact same error when building without annobin.

Comment 1 Jakub Jelinek 2020-07-27 11:03:00 UTC
Does it go away if you disable LTO (-flto -ffat-lto-objects)?

Comment 2 Hans de Goede 2020-07-27 12:09:31 UTC
No as I already mentioned in the description I've tried both disabling annobin as well as disabling lto. To make sure I have just double checked, here is a s390x scratch-build without lto:

https://koji.fedoraproject.org/koji/taskinfo?taskID=47927557

It fails with the same error as with lto, see:

https://kojipkgs.fedoraproject.org//work/tasks/7894/47927894/build.log

Comment 3 Jakub Jelinek 2020-07-27 12:50:56 UTC
Ah, reproduced now, doesn't seem to be specific to s390x in any way.

Testcase for -O2:

void bar (int, void *) __attribute__((__access__(__read_only__, 2)));

void
foo (void *c)
{
  struct S { void (*fn) (); } f = { bar };
  f.fn (0, c);
}


Started with https://gcc.gnu.org/r10-4929-g54aa6b58fe2fe73bbe67e0485777e0c410a18673

Comment 4 Marian Csontos 2020-07-27 13:39:09 UTC
*** Bug 1860062 has been marked as a duplicate of this bug. ***

Comment 5 Ben Cotton 2020-08-11 13:49:54 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle.
Changing version to 33.

Comment 6 Hans de Goede 2021-01-12 12:27:13 UTC
This was fixed in gcc-10.2.1-2.fc33; and dmraid has been built succesfully after that, so this bug can be closed now, closing.


Note You need to log in before you can comment on or make changes to this bug.