-dumpversion output inconsistent with upstream

Bug #1360404 reported by nega
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-4.6 (Ubuntu)
Won't Fix
Undecided
Unassigned
Trusty
Won't Fix
Undecided
Unassigned
gcc-4.7 (Ubuntu)
Won't Fix
Undecided
Unassigned
Trusty
Won't Fix
Undecided
Unassigned
gcc-4.8 (Ubuntu)
Won't Fix
Undecided
Unassigned
Trusty
Won't Fix
Undecided
Unassigned
gcc-4.9 (Ubuntu)
Fix Released
Undecided
Unassigned
Trusty
Invalid
Undecided
Unassigned
gccgo-4.9 (Ubuntu)
Invalid
Undecided
Unassigned
Trusty
Fix Released
Undecided
Unassigned

Bug Description

Note: this bug also affects gcc-4.6, gcc-4.7, gcc-4.8, and possibly gcc-4.9

Sometime between gcc-4.5.8 and gcc-4.6.3 debian (accidentally) changed the output of the -dumpversion flag; possibly in an attempt to fix this bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=643891

As a result, -dumpversion now reports MAJOR.MINOR version info. This is in contrast to upstream and other distributions of gcc which report MAJOR.MINOR.PATCH version info. This prevents simple machine parsing of gcc/g++/gfortran versions to filter out misbehaving versions. (For instance gcc-4.7.0's and gcc-4.7.1's C++11 ABI incompatibilities.) This bug has trickled down through gcc-4.6, gcc-4.7, gcc-4.8, and possibly gcc-4.9, and affects their binary packages (gcc, g++, gfortran, others?).

This bug can be fixed by applying the attached patch, after "debian patching".

Additional information:

1) Ubuntu version
[maru:~] lsb_release -rd
Description: Ubuntu 14.04.1 LTS
Release: 14.04

2) package version
[maru:~] apt-cache policy gcc-4.8
gcc-4.8:
  Installed: 4.8.2-19ubuntu1
  Candidate: 4.8.2-19ubuntu1
  Version table:
 *** 4.8.2-19ubuntu1 0
        500 http://mirrors.kernel.org/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

3) What do you expect to happen?
[avnas:~] lsb_release -rd
Description: Fedora release 20 (Heisenbug)
Release: 20
[avnas:~] gcc --version
gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[avnas:~] gcc -dumpversion
4.8.2
[avnas:~] g++ -dumpversion
4.8.2
[avnas:~] gfortran -dumpversion
4.8.2

4) What happened instead?
[maru:~] lsb_release -rd
Description: Ubuntu 14.04.1 LTS
Release: 14.04
[maru:~] gcc --version
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[maru:~] gcc -dumpversion
4.8
[maru:~] g++ -dumpversion
4.8
[maru:~] gfortran -dumpversion
4.8

Revision history for this message
nega (nega) wrote :
Revision history for this message
nega (nega) wrote :

In the previously listed debian bug report, the change happend in Source: gcc-4.6, Source-Version: 4.6.1-14

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "dumpversion.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Matthias Klose (doko) wrote :

relying on the version output is not recommended. There are hardly any distro builds of GCC shipping releases, but instead using the FSF branches or vendor branches. So when using a branch you'll see 4.7.1 already shortly after the 4.7.0 release. Then just looking at the version will result in a wrong check on your part. Ubuntu only bumps the version when the point release is made. This is more conservative and avoids checking for things that are not yet there, but doesn't help for feature checking. If you rely on features for branches, don't use version checks but feature checks instead.

I'll change that for 4.9, but not for released versions.

Changed in gcc-4.8 (Ubuntu):
status: New → Won't Fix
Changed in gcc-4.7 (Ubuntu):
status: New → Won't Fix
Changed in gcc-4.6 (Ubuntu):
status: New → Won't Fix
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.9 - 4.9.1-9ubuntu1

---------------
gcc-4.9 (4.9.1-9ubuntu1) utopic; urgency=medium

  * Linaro updates from the linaro/gcc-4_9-branch.

gcc-4.9 (4.9.1-9) unstable; urgency=medium

  * Update to SVN 20140824 (r214405) from the gcc-4_9-branch.
  * Fix -dumpversion output to print the full version number.
    Addresses: #759038. LP: #1360404.
    Use the GCC base version for the D include dir name.
 -- Matthias Klose <email address hidden> Sun, 24 Aug 2014 10:34:56 +0200

Changed in gcc-4.9 (Ubuntu):
status: New → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello nega, or anyone else affected,

Accepted gccgo-4.9 into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gccgo-4.9/4.9.3-0ubuntu4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Revision history for this message
nega (nega) wrote :

Fixed

tags: added: verification-done
removed: verification-needed
Steve Langasek (vorlon)
Changed in gcc-4.6 (Ubuntu Trusty):
status: New → Won't Fix
Changed in gcc-4.7 (Ubuntu Trusty):
status: New → Won't Fix
Steve Langasek (vorlon)
Changed in gcc-4.8 (Ubuntu Trusty):
status: New → Won't Fix
Changed in gcc-4.9 (Ubuntu Trusty):
status: New → Invalid
Changed in gccgo-4.9 (Ubuntu):
status: New → Invalid
Revision history for this message
Steve Langasek (vorlon) wrote :

This is not strictly required to be included in the gccgo-4.9 SRU, but it was and I can confirm that the bug is fixed in the new version of gccgo-4.9 in trusty-proposed.

Changed in gccgo-4.9 (Ubuntu Trusty):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (35.7 KiB)

This bug was fixed in the package gccgo-4.9 - 4.9.3-0ubuntu4

---------------
gccgo-4.9 (4.9.3-0ubuntu4) trusty-proposed; urgency=medium

  * Upload the final GCC 4.9.3 release.
  * Merge changes from gcc-4.9 4.9.3-2ubuntu1, including:
    - Fix PR go/60931, garbage collector issue with non 4kB system page size.
      LP: #1304754.
    - Fix wrong-code issue in the little endian vector API (ppc64el).
      LP: #1311128.
    - Fix ABI incompatibility between POWER and Z HTM builtins and intrinsics.
      LP: #1320292.
    - Fix an ICE with invalid code. PR c++/61046. LP: #1313102.
    - gccgo: Don't overwrite memory if an archive has a bad file name.
    - Fix PR rtl-optimization/61801, sched2 miscompiles syscall sequence with -g.
    - libgo: Fix unexpected GC interfering with closure passing.
    - libgo: Fix PR other/61895, ignore small argv[0] file for backtrace.
    - libgo: Fix unexpected GC interfering with closure passing.
    - Fix ICE in the Go frontend. LP: #1362906.
    - Enable cgo on AArch64 (Michael Hudson). LP: #1361940.
    - libgo: runtime: Use the clone system call on GNU/Linux.
    - libgo: Support arm64 relocations (Michael Hudson).
  * Include the cc1 binary into the gccgo-4.9 package.
  * Do not build-depend on sdt-systemtap for the trusty upload.
  * Warn about ppc ELFv2 ABI issues, which will change in GCC 5.
  * libgo: Fix PR go/67508, rewrite lfstack packing/unpacking to look more
    like that in Go (Michael Hudson). LP: #1472650.

gcc-4.9 (4.9.3-2ubuntu1) wily; urgency=medium

  * Merge with Debian; remaining changes:
    - Build from upstream sources.

gcc-4.9 (4.9.3-2) unstable; urgency=medium

  * Update to SVN 20150714 (r225765) from the gcc-4_9-branch.
  * Update the Linaro support to the 4.9-2015.06 release.

gcc-4.9 (4.9.3-1ubuntu1) wily; urgency=medium

  * Merge with Debian; remaining changes:
    - Build from upstream sources.

gcc-4.9 (4.9.3-1) unstable; urgency=medium

  * GCC 4.9.3 release.
  * Update to SVN 20150629 (r225135) from the gcc-4_9-branch.
  * Refresh patches.

gcc-4.9 (4.9.2-22ubuntu1) wily; urgency=medium

  * Merge with Debian; remaining changes:
    - Build from upstream sources.

gcc-4.9 (4.9.2-22) unstable; urgency=medium

  * Update to SVN 20150623 (r224833) from the gcc-4_9-branch.
  * Fix PR target/66483, taken from the trunk. Closes: #787689.
  * Fix "empty-binary-package" lintian warnings.
  * Fix PR tree-optimization/66233. Closes: #788812.

gcc-4.9 (4.9.2-21) unstable; urgency=medium

  * Update to SVN 20150611 (r224436) from the gcc-4_9-branch.
  * Build libstdc++6 when building the common libraries.

gcc-4.9 (4.9.2-20ubuntu1) wily; urgency=medium

  * Merge with Debian; remaining changes:
    - Build from upstream sources.

gcc-4.9 (4.9.2-20) unstable; urgency=medium

  * Update to SVN 20150531 (r223898) from the gcc-4_9-branch.
  * Fix PR rtl-optimization/63843, taken from the trunk. Closes: #785475.

gcc-4.9 (4.9.2-19ubuntu1) wily; urgency=medium

  * Merge with Debian; remaining changes:
    - Build from upstream sources.

gcc-4.9 (4.9.2-19) unstable; urgency=medium

  * Update to SVN 20150529 (r223861) from the gcc-4_9-branch.
  * Make symbols file symlinking for cross bu...

Changed in gccgo-4.9 (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Update Released

The verification of the Stable Release Update for gccgo-4.9 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.