Bug 2074157

Summary: Critical GCC 12 bug causes functions which comprise mostly volatile assembly to be dropped.
Product: [Fedora] Fedora Reporter: Jeremy Linton <jeremy.linton>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 36CC: acaringi, adscvr, airlied, alciregi, aoliva, bskeggs, dmalcolm, fweimer, fzatlouk, hdegoede, hpa, jakub, jarodwilson, jforbes, jglisse, jonathan, josef, jwakely, kernel-maint, law, lgoncalv, linville, masami256, mchehab, mpolacek, msebor, nickc, ptalbert, sipoyare, steved, yann
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: aarch64   
OS: Linux   
Whiteboard: RejectedBlocker AcceptedFreezeException
Fixed In Version: gcc-12.0.1-0.16.fc36 kernel-5.17.3-302.fc36 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-04-19 22:04:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 245418, 1953786    

Description Jeremy Linton 2022-04-11 16:14:22 UTC
Description of problem: GCC 12 fails to call volatile inline assembly routines. 

This is causing failures in the kernel at a minimum. The 
reported failures in BZ 2053729 (RPi4 wired network fails) and likely also BZ 2053214 (early kernel panic on aarch64). The latter isn't 100% but similar to the other one shows up in an a/b gcc 11/12 test.

Version-Release number of selected component (if applicable): 12.0.1


How reproducible: 100% when the code compiles incorrectly and is tracked down to the failing code path.

Actual results: The compiler emits correct code but fails to call it.


Expected results: Volatile assembly code is _always_ called.



Additional info: The bug has been fixed in gcc here:

https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=aabb9a261ef060cf24fd626713f1d7d9df81aa57

Comment 1 Fedora Blocker Bugs Application 2022-04-11 16:20:12 UTC
Proposed as a Blocker for 36-final by Fedora user jlinton using the blocker tracking app because:

 The compiler is failing to call asm volatile routines in the kernel, and likely other places. This is a very serious code generation problem, and its someone amazing that its not more visible at the moment. The rpi network failure is being worked around at the moment, but its quite likely the seattle/xgene and possibly other platforms are failing as well, although tracking down the exact code generation bug in each case is time consuming.

Comment 2 Jeremy Linton 2022-04-11 17:53:52 UTC
Also, I did a gcc scratch build last week with the (at the time) proposed patch https://koji.fedoraproject.org/koji/taskinfo?taskID=85305165 for testing purposes.

Comment 3 František Zatloukal 2022-04-11 18:24:30 UTC
Discussed during the 2022-04-11 blocker review meeting: [1]

The decision to classify this bug as an RejectedBlocker and conditional AcceptedFreezeException was made:

"We are wary of what breakage this could cause this late in the cycle, and we don’t have any reports of major issues that this bug causes. We are willing to accept this as an FE if we slip F36 this week."

[1] https://meetbot-raw.fedoraproject.org/fedora-blocker-review/2022-04-11/f36-blocker-review.2022-04-11-16.00.log.txt

Comment 4 Jakub Jelinek 2022-04-11 19:49:31 UTC
I'm building gcc with that fix among other fixes in
https://koji.fedoraproject.org/koji/taskinfo?taskID=85500093
https://koji.fedoraproject.org/koji/taskinfo?taskID=85504429
but it can take more than a day to finish.

Comment 5 Yann Droneaud 2022-04-13 13:27:32 UTC
Upstream bug is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105160

Comment 6 Fedora Update System 2022-04-15 09:23:41 UTC
FEDORA-2022-80766fc77b has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-80766fc77b

Comment 7 Fedora Update System 2022-04-15 13:03:35 UTC
FEDORA-2022-80766fc77b has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-80766fc77b`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-80766fc77b

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2022-04-16 17:59:00 UTC
FEDORA-2022-80766fc77b has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 František Zatloukal 2022-04-16 23:30:03 UTC
I believe the FE status was granted for kernel rebuild too, so, reopening, re-assigning to kernel.

Justin, fixed gcc ( gcc-12.0.1-0.16.fc36 ) is now in f36 buildroot, can you go ahead and fire off the kernel rebuild please?

Comment 10 Justin M. Forbes 2022-04-18 00:39:57 UTC
The 5.17.3-302 build is a build of 5.17.3 with this patch backed out, but built against the new gcc 12 build. If someone could please verify that it works before I file an update, I would appreciate it.

Comment 11 Fedora Update System 2022-04-19 14:09:42 UTC
FEDORA-2022-c38066128d has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-c38066128d

Comment 12 Fedora Update System 2022-04-19 17:28:10 UTC
FEDORA-2022-c38066128d has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-c38066128d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-c38066128d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2022-04-19 22:04:28 UTC
FEDORA-2022-c38066128d has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.