Bug 1109560 - spurious err.h warnings due to build with -O2 and -fpic
Summary: spurious err.h warnings due to build with -O2 and -fpic
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: sparse
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jeff Layton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-15 11:13 UTC by Jeff Layton
Modified: 2016-12-05 11:39 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-05 11:39:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jeff Layton 2014-06-15 11:13:10 UTC
sparse is throwing a very strange set of warnings like this on Linux kernel builds:

    include/linux/err.h:35:16: warning: dereference of noderef expression
    include/linux/err.h:30:23: warning: dereference of noderef expression

...with some experimentation, it seems that the issue is that sparse is built
with CFLAGS that include -O2 and -fpic. With that combo, the modifiers field for the ctype generated in the IS_ERR and PTR_ERR expressions ends up corrupt (maybe uninitialized?)

I suspect that this is sparse relying on some undefined behavior somewhere, but the code is convoluted and I haven't been able to pin down where the difference comes in.

For now, I'm going to remove the -fpic flag, but longer term it would be good to understand what's going wrong here.

Comment 1 Jaroslav Reznik 2015-03-03 16:01:56 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 2 Fedora End Of Life 2016-07-19 11:48:08 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 3 Jeff Layton 2016-11-14 19:19:51 UTC
Reopening this bug. I think I might have found the problem (finally).

Comment 4 Fedora Update System 2016-11-14 20:27:56 UTC
sparse-0.5.0-8.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-905f2517fe

Comment 5 Fedora Update System 2016-11-14 20:28:52 UTC
sparse-0.5.0-8.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-234b480967

Comment 6 Fedora Update System 2016-11-15 13:27:59 UTC
sparse-0.5.0-8.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-905f2517fe

Comment 7 Fedora Update System 2016-11-16 10:24:26 UTC
sparse-0.5.0-8.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-234b480967

Comment 8 Jeff Layton 2016-12-05 11:39:09 UTC
Fixed. The issue was an array in the code that was missing an element. When built with those options, the area beyond the array was no longer zeroed out. so we ended up getting back a nonsensical flags value.


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