Bug 1309225 - gcc6 miscompiles lzo on ppc64le when -O2 is used: 'internal error - lzo_init() failed !!!
Summary: gcc6 miscompiles lzo on ppc64le when -O2 is used: 'internal error - lzo_init(...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: lzo
Version: 24
Hardware: ppc64le
OS: Linux
medium
high
Target Milestone: ---
Assignee: Huzaifa S. Sidhpurwala
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PPCTracker F-ExcludeArch-ppc64le, PPC64LETracker
TreeView+ depends on / blocked
 
Reported: 2016-02-17 09:30 UTC by Karsten Hopp
Modified: 2016-06-10 14:06 UTC (History)
11 users (show)

Fixed In Version: lzo-2.08-8.fc24
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-10 14:06:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karsten Hopp 2016-02-17 09:30:45 UTC
Description of problem:
Building lzo-2.08-6.fc24 fails on ppc64le:

+ make check test
make  check-local
make[1]: Entering directory '/builddir/build/BUILD/lzo-2.08'
./lzotest/lzotest -mlzo -n2 -q ./COPYING

LZO real-time data compression library (v2.08, Jun 29 2014).
Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.

internal error - lzo_init() failed !!!
(this usually indicates a compiler bug - try recompiling
without optimizations, and enable `-DLZO_DEBUG' for diagnostics)
Makefile:1456: recipe for target 'check-local' failed



Version-Release number of selected component (if applicable):
lzo-2.08-6.fc24

How reproducible:


Steps to Reproduce:
1. ppc-koji build --scratch f24 --arch-override ppc64le lzo-2.08-6.fc24.src.rpm
2.
3.

Actual results:
http://ppc.koji.fedoraproject.org/koji/buildinfo?buildID=378799

Expected results:


Additional info:
Building with -O1 succeeds

Comment 1 Karsten Hopp 2016-02-17 18:56:53 UTC
build succeeds with -O2 -fno-strict-aliasing

Comment 2 Marek Polacek 2016-02-17 19:01:20 UTC
That usually points to a bug in the program, not in the compiler.  Does -Wstrict-aliasing warn on something?  (This warning has multiple levels, you might want to try e.g. -Wstrict-aliasing=2.)

Comment 3 Jakub Jelinek 2016-02-18 14:31:16 UTC
The build log is full of aliasing warnings everywhere; the lzo_funcs.h seems very much obfuscated, but the important change on the GCC side is that
since http://gcc.gnu.org/PR66110 fix char/unsigned char/signed char fields in structs are no longer considered to alias everything, while lzo clearly assumes that.  Thus, something like:
--- include/lzo/lzodefs.h.jj	2014-06-29 11:38:49.000000000 +0200
+++ include/lzo/lzodefs.h	2016-02-18 15:26:47.952064501 +0100
@@ -1686,6 +1686,10 @@ extern "C" {
 #  define __lzo_byte_struct_ma(s,n)     struct s { unsigned char a[n]; } __lzo_may_alias __attribute__((__packed__));
 #endif
 #endif
+#if (LZO_CC_GNUC >= 0x060000ul) && defined(__lzo_byte_struct_ma)
+#  undef __lzo_byte_struct
+#  define __lzo_byte_struct(s,n)        __lzo_byte_struct_ma(s,n)
+#endif
 #if defined(__lzo_byte_struct) &&  !defined(__lzo_byte_struct_ma)
 #  define __lzo_byte_struct_ma(s,n)     __lzo_byte_struct(s,n)
 #endif
fixes both the warnings and the testcase crash for me.

Comment 4 Jan Kurik 2016-02-24 15:49:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

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

Comment 5 Than Ngo 2016-06-10 14:06:29 UTC
it's fixed in lzo-2.08-8.fc24


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