GCC miscompilation with boost::asio::io_service::work
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-4.8 (Ubuntu) |
Incomplete
|
Undecided
|
Unassigned | ||
Trusty |
Fix Released
|
Undecided
|
Unassigned | ||
gcc-4.9 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Trusty |
Invalid
|
Undecided
|
Unassigned |
Bug Description
The following program should keep running forever until it's being killed:
#include <boost/asio.hpp>
int main()
{
boost:
boost:
boost:
io_
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
ProcVersionSign
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_
LANG=en_CA.UTF-8
SHELL=/bin/bash
SourcePackage: gcc-4.8
UpgradeStatus: No upgrade log present (probably fresh install)
please recheck with the compiler in the ubuntu- toolchain- r/ppa:
https:/ /launchpad. net/~ubuntu- toolchain- r/+archive/ ubuntu/ ppa