Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 595824 - sys-devel/gcc-4.9.3 with "-O3 -march=nocona" miscompiles app-arch/gzip
Summary: sys-devel/gcc-4.9.3 with "-O3 -march=nocona" miscompiles app-arch/gzip
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 915000
  Show dependency tree
 
Reported: 2016-10-01 20:32 UTC by Sumit Khanna
Modified: 2023-10-01 06:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Build output (libosinfo-0.3.1.build-output.txt,6.09 KB, text/plain)
2016-10-01 20:32 UTC, Sumit Khanna
Details
emerge info (emerge.info.txt,6.81 KB, text/plain)
2016-10-01 20:32 UTC, Sumit Khanna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sumit Khanna 2016-10-01 20:32:20 UTC
Created attachment 448720 [details]
Build output

I get this really odd error when I was doing an `emerge -auDNv world`. It looks like an invalid tar file, plus gzip fails with a backtrace. 

I've removed the offending file from /usr/portage/disfiles to force a re-download and also tried another emerge --sync. It doesn't valid on the hash verification, so did an invalid archive get hashed and committed/mirrored? 

I can't find any other bugs on this, which seems like it should be wide reaching.
Comment 1 Sumit Khanna 2016-10-01 20:32:41 UTC
Created attachment 448722 [details]
emerge info
Comment 2 Michał Kępień 2016-10-12 11:05:19 UTC
The tar file is fine.  The problem lies in the CFLAGS with which your
gzip was built ("-O3 -march=nocona").  As proof, the following command
should be enough to reproduce the issue on your machine:

    gzip -d < /usr/portage/distfiles/libosinfo-0.3.1.tar.gz > /dev/null

It seems building gzip with "-O3 -march=nocona" is incompatible with
GCC's Stack Smashing Protector.  Feel free to report this issue
upstream.  As a workaround, change "-march=nocona" to something more
appropriate for your machine or replace "-O3" with "-O2"; then rebuild
gzip.
Comment 3 Sumit Khanna 2016-10-12 17:07:50 UTC
I've been copying this old image for a while and have never adjusted my CFLAGS. :) I switched to -march=native, recompiled gzip and libsosinfo was able to ungzip and install.

I find it interesting this didn't affect any other .gz files. Who should this be reported to upstream? Gzip?
Comment 4 Michał Kępień 2016-10-13 06:37:29 UTC
It is indeed peculiar, though I cannot reproduce this with gzip 1.8 on a
different OS using GCC 6.2.1 and the same compilation flags, so perhaps
this is a bug in older GCC versions or something Gentoo-specific.  If
you really want to investigate further, you can emerge an unstable
version of GCC on your box (e.g. 5.4.0), rebuild gzip and then see if
the bug is still present.  If not, then it is probably a compiler bug
already fixed upstream.  If the error persists, well... keep trying :)
Comment 5 Andreas K. Hüttel archtester gentoo-dev 2017-08-29 20:37:25 UTC
Does this affect any newer versions (4.9.4, 5.4, 6.x)?
Comment 6 Andreas K. Hüttel archtester gentoo-dev 2017-10-03 21:21:30 UTC
(In reply to Andreas K. Hüttel from comment #5)
> Does this affect any newer versions (4.9.4, 5.4, 6.x)?

No reply.