[Bug 1338693] [NEW] GCC miscompilation with boost::asio::io_service::work

Jakob Petsovits jpetso at gmx.at
Mon Jul 7 17:27:42 UTC 2014


Public bug reported:

The following program should keep running forever until it's being
killed:

#include <boost/asio.hpp>

int main()
{
    boost::asio::io_service io_service;
    boost::asio::io_service::work work(io_service);

    boost::system::error_code ec;
    io_service.run(ec);

    std::cout << ec.value() << " - " << ec.message() << std::endl;

    return 0;
}

However, on gcc 4.8.2-19ubuntu1 which ships with Ubuntu 14.04 Trusty (amd64 version), it returns right away with output "0 - Success".
Switching to clang++ makes the snippet behave as intended.
Boost.Asio is a header-only library, so compilers matter.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: gcc-4.8 4.8.2-19ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-30.55-generic 3.13.11.2
Uname: Linux 3.13.0-30-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: amd64
CurrentDesktop: KDE
Date: Mon Jul  7 13:03:08 2014
InstallationDate: Installed on 2014-06-26 (10 days ago)
InstallationMedia: Kubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.1)
ProcEnviron:
 LANGUAGE=en_CA:en
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
SourcePackage: gcc-4.8
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: gcc-4.8 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug trusty

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-4.8 in Ubuntu.
https://bugs.launchpad.net/bugs/1338693

Title:
  GCC miscompilation with boost::asio::io_service::work

Status in “gcc-4.8” package in Ubuntu:
  New

Bug description:
  The following program should keep running forever until it's being
  killed:

  #include <boost/asio.hpp>

  int main()
  {
      boost::asio::io_service io_service;
      boost::asio::io_service::work work(io_service);

      boost::system::error_code ec;
      io_service.run(ec);

      std::cout << ec.value() << " - " << ec.message() << std::endl;

      return 0;
  }

  However, on gcc 4.8.2-19ubuntu1 which ships with Ubuntu 14.04 Trusty (amd64 version), it returns right away with output "0 - Success".
  Switching to clang++ makes the snippet behave as intended.
  Boost.Asio is a header-only library, so compilers matter.

  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: gcc-4.8 4.8.2-19ubuntu1
  ProcVersionSignature: Ubuntu 3.13.0-30.55-generic 3.13.11.2
  Uname: Linux 3.13.0-30-generic x86_64
  ApportVersion: 2.14.1-0ubuntu3.2
  Architecture: amd64
  CurrentDesktop: KDE
  Date: Mon Jul  7 13:03:08 2014
  InstallationDate: Installed on 2014-06-26 (10 days ago)
  InstallationMedia: Kubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.1)
  ProcEnviron:
   LANGUAGE=en_CA:en
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_CA.UTF-8
   SHELL=/bin/bash
  SourcePackage: gcc-4.8
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.8/+bug/1338693/+subscriptions



More information about the foundations-bugs mailing list