Bug 1419174 - pspp FTBFS with gcc 7
Summary: pspp FTBFS with gcc 7
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pspp
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Peter Lemenkov
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-03 19:23 UTC by Jakub Jelinek
Modified: 2017-08-09 15:57 UTC (History)
2 users (show)

Fixed In Version: pspp-0.10.2-5.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-09 15:57:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jakub Jelinek 2017-02-03 19:23:50 UTC
pspp-0.10.2-1.fc26 fails to build with GCC 7, the problem is a bug in the exact gnulib version it incorporates.
gcc even warns about the bug:
In file included from xalloc.h:23:0,
                 from basename.c:24:
xalloc.h: In function 'xnmalloc':
xalloc-oversized.h:49:33: warning: null argument where non-null required (argument 3) [-Wnonnull]
 # define xalloc_oversized(n, s) __builtin_mul_overflow (n, s, (size_t *) NULL)
                                 ^
xalloc.h:106:7: note: in expansion of macro 'xalloc_oversized'
   if (xalloc_oversized (n, s))
       ^~~~~~~~~~~~~~~~

__builtin_{add,sub,mul}_overflow builtins never accepted NULL as the last argument, that always crashed, there was only a proposed patch to allow that but it never got accepted, instead __builtin_{add,sub,mul}_overflow_p builtins were added with different behavior.
See e.g. http://repo.or.cz/gnulib/ericb.git/commitdiff_plain/175b4e22f99e00996b72f822f5ae54dca8243d19
and http://repo.or.cz/gnulib/ericb.git/commitdiff_plain/04441fd8156978cfc51d6c203fd43c23b64f95df
Either grab latest gnulib together, or e.g.
--- a/gl/xalloc-oversized.h	2016-07-23 12:47:32.000000000 -0400
+++ b/gl/xalloc-oversized.h	2017-02-03 13:30:48.685164578 -0500
@@ -43,16 +43,9 @@
    nonnegative.  This is a macro, not a function, so that it
    works correctly even when SIZE_MAX < N.  */
 
-/* GCC 7 __builtin_mul_overflow should easily compute this.  See:
-   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68120  */
 #if 7 <= __GNUC__
-# define xalloc_oversized(n, s) __builtin_mul_overflow (n, s, (size_t *) NULL)
+# define xalloc_oversized(n, s) __builtin_mul_overflow_p (n, s, (size_t) 1)
 
-/* GCC 5 and Clang __builtin_mul_overflow needs a temporary, and
-   should be used only for non-constant operands, so that
-   xalloc_oversized is a constant expression if both arguments are.
-   Do not use this if pedantic, since pedantic GCC issues a diagnostic
-   for ({ ... }).  */
 #elif ((5 <= __GNUC__ \
         || (__has_builtin (__builtin_mul_overflow) \
             && __has_builtin (__builtin_constant_p))) \
is enough to fix it.

Comment 1 Fedora End Of Life 2017-02-28 11:10:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 2 Fedora Update System 2017-07-29 07:52:47 UTC
pspp-0.10.2-5.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-03893a3b58

Comment 3 Fedora Update System 2017-07-31 04:23:40 UTC
pspp-0.10.2-5.fc26 has been pushed to the Fedora 26 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-2017-03893a3b58

Comment 4 Fedora Update System 2017-08-09 15:57:46 UTC
pspp-0.10.2-5.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.


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