Opened 11 years ago

Closed 11 years ago

#5759 closed Bugs (worksforme)

Enabling -std=c++0x causes random crashes in ASIO since Boost 1.47.0

Reported by: lubos@… Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

Hello,

to start off, I know that this bug report sucks. But I haven't been able to make a simple test case that would exhibit the bug and wouldn't require you to have other libs installed, so this will have to suffice.

I'm working on a project that uses both Rasterbar libtorrent and Pion Network libraries. They both use Boost ASIO. The problem is that if the following conditions are met, the resulting binary starts crashing randomly inside of the ASIO code:

  1. Boost 1.47.0 is used (previous versions work fine!)
  2. -std=c++0x is used
  3. Pion Network header files are included in any of the compiled source files (just including suffices!)

Please, install Rasterbar libtorrent and Pion Network and try compiling the attached file. First without -std=c++0x and then with -std=c++0x. The latter will make the binary crash.

I suppose this is caused by the newly introduced move constructors. But I'm not sure whether this is an ASIO or a GCC bug.

Attachments (1)

test.cpp (1.1 KB ) - added by lubos@… 11 years ago.
Example program

Download all attachments as: .zip

Change History (2)

by lubos@…, 11 years ago

Attachment: test.cpp added

Example program

comment:1 by chris_kohlhoff, 11 years ago

Resolution: worksforme
Severity: RegressionProblem
Status: newclosed

I suspect from your description that one or more of the components (e.g. libpion) has not been compiled with the -std=c++0x compiler option. You need to make sure everything is compiled with -std=c++0x. If you do so, it works.

Note: See TracTickets for help on using tickets.