{5} Assigned, Active Tickets by Owner (Full Description) (203 matches)

List tickets assigned, group by ticket owner. This report demonstrates the use of full-row display.

Results (101 - 200 of 203)

1 2 3

Marshall Clow (1 match)

Ticket Summary Component Milestone Type Created
Description
#9577 trim_copy doesn't support string_ref algorithm To Be Determined Feature Requests Jan 15, 2014
boost::string_ref z = "  AA BB  ";
boost::string_ref b = boost::trim_copy(z);

does not compile


mkaravel (1 match)

#10983 box-box distance doesn't seem to work with spherical coordinate systems geometry Boost 1.59.0 Bugs Jan 29, 2015

The "geometry distance matrix" indicates that all geometry-to-geometry distances have been implemented in 1.57. But the box-to-box distance doesn't seem to work with spherical geometries, at least with gcc 4.4.7.

One of the errors seems to be a "not yet implemented" error, so perhaps it hasn't been done yet. It does have some tricky business that a cartesian box wouldn't have, but it's a straightforward exercise in trying different cases.

I'm certainly delighted with boost::geometry's functionality as is, but it would be great if this worked. And many apologies if the mistake is mine.

See example below for problem.


#include <boost/geometry/geometry.hpp>

typedef boost::geometry::model::point<double,2,boost::geometry::cs::cartesian> cartesian_point;
typedef boost::geometry::model::point<double,2,boost::geometry::cs::spherical_equatorial<boost::geometry::degree> > spherical_point;

int main()
{

  // Works...
  boost::geometry::model::box<cartesian_point> c_box1, c_box2;
  boost::geometry::distance(c_box1,c_box2);

  // Doesn't work!
  boost::geometry::model::box<spherical_point> s_box1, s_box2;
  boost::geometry::distance(s_box1,s_box2);

  return 0;
}

Andreas Pokorny (1 match)

#1201 Regexify the syntax highlighter quickbook To Be Determined Feature Requests Aug 22, 2007

What I'd really want is to Regex-ify the syntax highlighter and have them reconfigurable as user-supplied regex strings from configuration files. This would simplify our life a lot. There'll be only one syntax highlighter grammar and code that can accept various lexer files. Our job then is just to churn out various lexer files for different languages.


Neil Groves (16 matches)

#7630 Range adaptors do not play nicely with range-based for loops range To Be Determined Bugs Nov 2, 2012

Consider the following C++11 code, adapted from the Range documentation:

std::vector<int> vec;
for (int val : vec | boost::adaptors::reversed
                   | boost::adaptors::uniqued) {
  // Do stuff with val
}

The behavior of this natural-seeming code is actually undefined, due to a dangling reference: per the C++ standard, it is equivalent to

{
  auto && __range = (vec | boost::adaptors::reversed
                         | boost::adaptors::uniqued);
  for ( auto __begin = __range.begin(),
             __end = __range.end();
        __begin != __end;
        ++__begin ) {
    int val = *__begin;
    // Do stuff with val
  }
}

The problem is that the value returned by the subexpression vec | boost::adaptors::reversed is a temporary, so its lifetime ends at the end of the statement containing it, namely the declaration of __range. Thus, __range is left holding a dangling reference to the range it's adapting.

The fix is for each range adaptor to use an rvalue-reference overload to detect whether the input range is a temporary, and if so, move it into the adaptor (i.e. with std::move) in order to extend its lifetime.


#10142 Range lib type_erased.cpp needs /bigobj option for mcvc and intel-win range To Be Determined Bugs Jun 23, 2014

Build of range lib on debug mode fails with msvc and icl on type_erased.cpp file. /bigobj option should be added to Jamfile.v2

# ../../../bjam --toolset=intel address-model=364 . . . file ..\..\..\bin.v2\libs\range\test\type_erased.test\msvc-12.0\debug\address-model-64\link-static\threading-multi\adaptor_test\type_erased.obj.rsp "adaptor_test\type_erased.cpp" -Fo"..\..\..\bin.v2\libs\range\test\type_erased.test\msvc-12.0\debug\address-model-64\link-static\threading-multi\adaptor_test\type_erased.obj" -TP /Z7 /Od /Ob0 /W3 /GR /MDd /Zc:forScope /Zc:wchar_t /favor:blend /wd4675 /EHs -c -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_NO_AUTO_LINK=1 "-I..\..\.." compile-c-c++ ..\..\..\bin.v2\libs\range\test\type_erased.test\msvc-12.0\debug\address-model-64\link-static\threading-multi\adaptor_test\type_erased.obj

call "C:\Program Files (x86)\microsoft visual studio 12.0\vc\vcvarsall.bat" x86_amd64 >nul

cl /Zm800 -nologo @"..\..\..\bin.v2\libs\range\test\type_erased.test\msvc-12.0\debug\address-model-64\link-static\threading-multi\adaptor_test\type_erased.obj.rsp"

type_erased.cpp C:\Users\. . .\boost_1_55_0\libs\range\test\adaptor_test\type_erased.cpp : fatal error C1128: number of sections exceeded object file format limit : compile with /bigobj

On Intel Windows 13.1, 14,0, 15.0: # ../../../bjam --toolset=intel address-model=64 . . . type_erased.cpp ..\..\..\bin.v2\libs\range\test\type_erased.test\intel-win\debug\link-static\threading-multi\adaptor_test\type_erased.obj": catastrophic error: too many segments in object file

compilation aborted for adaptor_test/type_erased.cpp (code 4)


#10332 »indexed« range adaptor's source-breaking change not mentioned in release notes range To Be Determined Bugs Aug 9, 2014

The »indexed« range adaptor has changed in v1.56.0 in source-breaking ways. I get the change and that it was necessary for range-based for loops, but this means that you now have to #if BOOST_VERSION < … around it. See this example (distilled from actual code).

Why the ticket? Because the change hasn't been mentioned at all in the release notes.


#10336 compilation error in iterator_range and unordered_map range To Be Determined Bugs Aug 10, 2014

I get a compilation error with vc10, iterator_range and a (const) unordered_map (the beta candidate 2 was still ok I think):

#include "stdafx.h"
#include <boost/range/iterator_range.hpp>
#include <boost/unordered_map.hpp>


int _tmain(int /*argc*/, _TCHAR* /*argv*/[])
{
   typedef boost::unordered_map<int, int>            Container;
   typedef Container::const_iterator                 ContainerIterator;
   typedef boost::iterator_range<ContainerIterator>  ContainerIteratorRange;

   const Container cnt;

   ContainerIteratorRange rng(cnt.cbegin(), cnt.cend());
   
   return 0;
}

This gives C2248:

'boost::unordered::iterator_detail::c_iterator<Node,ConstNodePointer>::iterator'

cannot access private typedef declared in class

etc.

Eric: Niebler:

Well, this is unfortunate. It's broken also on msvc-12 and clang trunk, but strangely not on gcc. I thought it might be due to this change in Boost.Range:

github.com/boostorg/range/commit/264017e2a9bdbfcc24517ce05f8ef96df0a8c45b

But reverting that doesn't have any effect. It works on Boost 1.55, so this is definitely a regression.

Can you please file a bug? Neil, can you take a look?

A possible fix: github.com/boostorg/range/pull/19


#10360 Since 1.56, any_range use static cast of reference instead of implicit conversion range To Be Determined Bugs Aug 15, 2014

Since 1.56, when dereferencing, any_range tries to use static cast of reference instead of implicit conversion like in 1.55.

Here is an example that works with 1.55 but fails to compile with 1.56.

#include <boost/range/any_range.hpp>
#include <memory>
#include <vector>

struct A {};

int main() {
    std::vector<std::shared_ptr<A> > v;
    boost::any_range<std::shared_ptr<const A>,
                     boost::forward_traversal_tag,
                     std::shared_ptr<const A>,
                     std::ptrdiff_t> r(v);
}


#10397 compilation error with mfc-iteratior-support: ambiguous symbol range To Be Determined Bugs Aug 25, 2014

Hi,

moving parts of range_const_iterator to the namespace range_detail in file boost/range/const_iterator.hpp leads to ambiguity in /range/detail/mfc.hpp line 747:

(MSVC 11 on Windows Server 2008 R2/x64)

25>..\src\libs\boost\boost\boost/range/mfc.hpp(747): error C2872: 'range_const_iterator' : ambiguous symbol 25> could be '..\src\libs\boost\boost\boost/range/const_iterator.hpp(67) : boost::range_const_iterator' 25> or '..\src\libs\boost\boost\boost/range/const_iterator.hpp(40) : boost::range_detail::range_const_iterator' 25> ..\src\libs\boost\boost\boost/range/detail/microsoft.hpp(135) : see reference to class template instantiation 'boost::range_detail_microsoft::customization<Tag>::meta<X>' being compiled 25> with 25> [ 25> Tag=CEbsValueArray::mfc_range_base_type, 25> X=CTypedPtrArray<CObArray,EbsValue *> 25> ] 25> ..\src\libs\boost\boost\boost/range/begin.hpp(111) : see reference to class template instantiation 'boost::range_detail_microsoft::const_iterator_of<T>' being compiled 25> with 25> [ 25> T=CTypedPtrArray<CObArray,EbsValue *> 25> ] ...

The problem can be resolved by changing the name of

boost::range_detail::range_const_iterator

to

boost::range_detail::range_const_iterator_helper

I expect other begin/end adapters to run into the same problem.

Tobias


#10430 joined_range generates invalid range with recent gcc versions with optimization enabled range To Be Determined Bugs Aug 30, 2014

This came up in tracking down unit-test failures when trying to build a project with newer compiler versions with C++11 enabled. The unit-test in question was compiled with multiple compiler versions:

  • gcc 4.3.4 (without C++11 enabled): working at all optimization levels
  • gcc 4.7.2 (with C++11 enabled): works without optimizations, failed with -O1 or higher
  • gcc 4.8.4 (with C++11 enabled): works without optimizations, failed with -O1 or higher
  • clang 3.5.0 (recent build, with C++11 enabled): works at all optimization levels

The failure was tracked down to a use of boost::range::joined_range (Boost 1.55.0), effectively declared as:

boost::range::joined_range<boost::iterator_range<std::vector<char>::iterator, boost::iterator_range<const char*>>

In this form, the joined_range created from two valid ranges winds up "somewhere else" when the higher optimization level. I've attached a test case that demonstrates the problem. Compiled with:

g++ -std=c++11 -o join_bug join_bug.cpp

works (printing out the expected ASCII values of the joined ranges). Compiled with:

g++ -O1 -std=c++11 -o join_bug join_bug.cpp

fails (printing out zero's in my test, though the correct number of them). This test was run with the same compiler versions as above, on both Boost 1.54.0 and Boost 1.55.0, as well as gcc 4.8.2 and clang 3.4 (both for Ubuntu 14.04), with a slightly modified non-C++11 version for the gcc 4.3.4 compiler, all with the same successes/failures.

The problem goes away in all tests if the joined_range is declared like so (changing from std::vector<char>::iterator to std::vector<char>::const_iterator):

boost::range::joined_range<boost::iterator_range<std::vector<char>::const_iterator, boost::iterator_range<const char*>>

I realize this might be a gcc bug, rather than a Boost bug, but I haven't seen this reported elsewhere and would like to get the behaviour tracked since I'm only seeing problems in relation to joined_range...


#10483 boost::is_sorted docs incorrectly describe predicate range Boost 1.58.0 Bugs Sep 9, 2014

From the documentation

For the non-predicate version the return value is true if and only if for each adjacent elements [x,y] the expression x < y is true

and similarly for the predicate version. This isn't the case however.

From the standard [alg.sorting]

A sequence is sorted with respect to a comparator comp if for any iterator i pointing to the sequence and any non-negative integer n such that i + n is a valid iterator pointing to an element of the sequence, comp(*(i + n), *i) == false.

So the docs should say

the expression y < x is false

I get the following with g++'s underlying is_sorted():

  std::vector<int> v{1, 1};
  std::cout << boost::is_sorted(v) << std::endl; // prints 1

Reference for is_sorted at cplusplus.com [sorry not allowed to post a link] backs this up.


#10493 Since 1.56, any_range with non-reference references can cause UB range Boost 1.64.0 Bugs Sep 11, 2014

This must be related to #10360. This is a regression since 1.55.

When using any_range<T, category, T, ptrdiff_t>, mutable dereference() method returns mutable_reference_type_generator<T>::type, which becomes T&. So dereference() returns a dangling reference to an on-the-fly computed value.

See attached test case, which works with 1.55, and fails with -fsanitize=address on Clang 3.5 with 1.56.

#include <boost/range/any_range.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include <cmath>
#include <iostream>

typedef boost::any_range<
    std::string,
    boost::forward_traversal_tag,
    std::string,
    std::ptrdiff_t
> range_t;

std::string f(std::string a)
{
    return a + "!";
}

int main()
{
    std::vector<std::string> v = {"a", "b"};
    range_t r = v | boost::adaptors::transformed(f);
    for (auto&& a : r)
        std::cout << a << std::endl;
    return 0;
}


#10515 Range: doc: incorrect return type range Boost 1.58.0 Bugs Sep 18, 2014

This page: http://www.boost.org/doc/libs/1_56_0/libs/range/doc/html/range/reference/adaptors/reference/filtered.html

reads:

Range Return Type: boost::filtered_range<decltype(rng)>

But the code shows that it has two template parameters.

namespace boost
{
    namespace range_detail
    {
        template< class P, class R >
        struct filtered_range :

Maybe other similar pages lack parameters, I don't know, but they all seem to have a single one documented.


#10865 boost::iterators::transform_iterator<LambdaType> is not default constructible on Clang range Boost 1.58.0 Bugs Dec 11, 2014

The attached code compiles with GCC 4.9.2 and MSVC 2013, but fails with Clang 3.5.0. I've first reported it against clang, but they explained that it's actually incorrect in Boost, see clang bug #21787 (the bugtracker rejects links here).


#10988 Range filtered adapter incorrectly requires a ForwardRange range To Be Determined Bugs Feb 1, 2015

The filtered Range adapter incorrectly requires a ForwardRange. A SinglePassRange should be sufficient, since it is for the Boost.Iterator filter_iterator.


#10989 strided breaks on impure traversal tags range Boost 1.58.0 Bugs Feb 2, 2015

From http://stackoverflow.com/questions/28280553/boostadaptorsstrided-cannot-be-used-after-boostadaptorstransformed

[...]/boost/1.57.0/include/boost/range/iterator_range_core.hpp:216:20: error: no matching function for call to ‘boost::range_detail::strided_iterator<boost::iterators::transform_iterator<TrivialTrafo, __gnu_cxx::__normal_iterator<int*, std::vector<int> >, boost::iterators::use_default, boost::iterators::use_default>, boost::iterators::detail::iterator_category_with_traversal<std::input_iterator_tag, boost::iterators::random_access_traversal_tag> >::strided_iterator(boost::range_detail::strided_iterator<boost::iterators::transform_iterator<TrivialTrafo, __gnu_cxx::__normal_iterator<int*, std::vector<int> >, boost::iterators::use_default, boost::iterators::use_default>, boost::iterators::random_access_traversal_tag>&)’

, m_End(End)

Problem is that make_begin_strided_iterator et al coerce the returned iterator traversal category/tag to a pure traversal tag, which doesn't necessarily agree with the Category passed to iterator_range for the base type. Fix is to use iterators::pure_iterator_traversal.


#7006 Restricted pointers support. range To Be Determined Feature Requests Jun 21, 2012

Trying to form iterator_ranges with restricted pointers causes compiler errors.


#7742 tie like functionality for ranges range To Be Determined Feature Requests Nov 27, 2012

The Graph library uses std::pair to pass ranges and this allows a nice pattern to use old-fashioned for-loops:

Graph g; boost::graph_traits<Graph>::vertex_iterator b, e; for(boost::tie(b, e) = vertices(g); b != e; ++b) {

}

This works without any modifications with pair.

The functionality would be great for all ranges as it provides users that don't want to use Boost.Range algorithms with a simple way to use their preferred style or algorithms from std.


#12158 boost::size() and friends should use an ADL barrier like boost::begin range To Be Determined Feature Requests Apr 26, 2016

boost::begin() and boost::end() are nicely declared in an ADL barrier namespace to avoid conflicts with code like this:

using std::begin;
auto i = begin(c);

N4280 has been accepted into C++17, which adds std::size, std::empty, and std::data. But if users attempt to use those in the same way:

using std::size;
auto s = size(c);

They may get an error. For example, if c is a std::vector<boost::shared_ptr<int>> or something, boost::size() will be found by ADL, and since it's no more specific than std::size, the call will be ambiguous.


Thorsten Ottosen (1 match)

#3483 non-null requirement in ptr_vector::transfer ptr_container Feature Requests Sep 23, 2009

http://www.boost.org/doc/libs/1_40_0/libs/ptr_container/doc/ptr_vector.html#c-array-support

is it possible to remove non-null requirement for from argument in ptr_vector::transfer method?


niels_dekker (1 match)

#2836 Request boost::optional<T>::optional_assign_to, optional_move_to, optional_swap optional Boost 1.39.0 Feature Requests Mar 7, 2009

I request the three member functions

template< class U > bool boost::optional<T>::optional_assign_to(U& t) const; template< class U > bool boost::optional<T>::optional_move_to(U& t); bool boost::optional<T>::optional_swap(T& t);

which, if !*this, return false, and otherwise return true and are equivalent to

t=this; t=this; and *this may have any value after the move std::swap( t, this );


Noel Belcourt (1 match)

#6954 property map 'put' should support move semantics property_map Boost 1.56.0 Bugs May 30, 2012

The 'put' helper function in the boost property map library should support move semantics. At the moment it takes the value to be put by const reference, I think it would be more appropriate to perfect forward it.


Peter Dimov (1 match)

#12033 Boostdep misses some dependent components Building Boost To Be Determined Feature Requests Feb 29, 2016

In creating a modular boost build for a client I found that boostdep was missing a few smaller libraries when tracing the dependencies. The library msm depends on fusion, which depends on utility, but boostdep does not list "utility" as among the depdencies of msm.

For a test case, try building libs/msm/doc/HTML/examples/SimpleTutorial.cpp using a version of Boost with only the submodules listed as dependencies of msm. It should complain about not finding boost/utility/result_of.hpp


Robert Ramey (8 matches)

#1836 bug in serializing wide character strings serialization To Be Determined Bugs Apr 17, 2008

We've discovered an issue Boost has writing and reading wide character strings (wchar_t* and std::wstrings) to non-wide character file streams (std::ifstream and std::ofstream). The issue stems from the fact that wide characters are written and read as a sequence of characters (in text_oarchive_impl.ipp and text_iarchive_impl.ipp, respectively). For text streams, an EOF character terminates the reading of a file on Windows. Some wide characters have EOF (value = 26 decimal) as one of the bytes so reading that byte causes early termination of the read. We have worked around the issue by deriving our own input and output archives from text_i|oarchive_impl<Archive> and overriding load_override() and save_override for std::wstring and wchar_t*. Our implementation just sequences through the wide characters and writes them 1 by 1 as wchar_t to the archive. This isn't very elegant and is even less readable in the file than the current implementation but does resolve the problem.

Although the test test_simple_class does test wstrings, it only uses characters 'a'-'z' which does not expose this problem.


#2326 Library does not directly support serializing data of type "foo**" serialization Boost 1.37.0 Bugs Sep 15, 2008

The following example fails to compile, trying to find a .serialize() member function in an int*. Clearly the user can program around this, but serializing pointers-to-pointers seems a natural capability that should be in the library.

#include <fstream>

#include "boost/archive/text_oarchive.hpp"

class foo {

friend class boost::serialization::access;

template<class archive>

void serialize(archive& ar, const unsigned int version) {

ar & BOOST_SERIALIZATION_NVP(buff);

ar & BOOST_SERIALIZATION_NVP(ptr);

}

public:

foo() : ptr(&buff[3]) {}

int* buff[10];

int ptr;

};

int main() {

foo f;

std::ofstream serial("serial");

boost::archive::text_oarchive oa(serial);

oa << BOOST_SERIALIZATION_NVP(f);

return 0;

}


#5629 base64 encode/decode for std::istreambuf_iterator/std::ostreambuf_iterator serialization To Be Determined Bugs Jun 22, 2011

MSVS 2008 The code:

#include "boost/archive/iterators/base64_from_binary.hpp"
#include "boost/archive/iterators/binary_from_base64.hpp"
#include "boost/archive/iterators/transform_width.hpp"

//typedefs
typedef  std::istreambuf_iterator<char>    my_istream_iterator;
typedef  std::ostreambuf_iterator<char>    my_ostream_iterator;

typedef boost::archive::iterators::base64_from_binary<
          boost::archive::iterators::transform_width< my_istream_iterator, 6, 8>
> bin_to_base64;

typedef boost::archive::iterators::transform_width<
    boost::archive::iterators::binary_from_base64< my_istream_iterator >, 8, 6
> base64_to_bin;

void test()
{
   {
        //INPUT FILE!!!
    std::ifstream ifs("test.zip", std::ios_base::in|std::ios_base::binary);
    std::ofstream ofs("test.arc", std::ios_base::out|std::ios_base::binary);

    std::copy(
        bin_to_base64( my_istream_iterator(ifs >> std::noskipws) ),
        bin_to_base64( my_istream_iterator() ),
        my_ostream_iterator(ofs)
    );
  }

  {
    std::ifstream ifs("test.arc", std::ios_base::in|std::ios_base::binary);
    std::ofstream ofs("test.rez", std::ios_base::out|std::ios_base::binary);

    std::copy(
        base64_to_bin( my_istream_iterator(ifs >> std::noskipws) ),
        base64_to_bin( my_istream_iterator() ),
        my_ostream_iterator(ofs)
    );
  }
}

Result: 1) If the INPUT FILE will be any of ZIP-file format. The result was:

a) _DEBUG_ERROR("istreambuf_iterator is not dereferencable"); it can be disabled or ignored b) The encoded file "test.rez" will have one superfluous byte than INPUT FILE

2) If the INPUT FILE will any other file (binary or text) all will be OK.


#5876 Serialization - tracking of non-versioned classes serialization To Be Determined Bugs Sep 8, 2011

I quote a case from my workplace. The issue came up for std::vector<int>, but I use a simple struct X to reproduce the problem. See the attached file for detailed instructions.

Opened by Yakov Galka 9/8/2011 (Today) 8:31 AM Edit

The following code:

    struct X { ... };

    X x2;
    BoostLoad("SerializationBug.dat", x2);

#if FLAG
    volatile int x = 0;
    if(x)
    {
        X *x3;
        BoostLoad("this code is never executed", x3);
    }
#endif

Produces different results depending on whether FLAG == 0 or 1, although it's clear that it must not change it's behavior.

After some research it happens that the handling of tracking level is broken in boost since at least boost 1.46.1.

Assigned to Yakov Galka by Yakov Galka 9/8/2011 (Today) 8:31 AM Notified ######.

Edited by Yakov Galka 9/8/2011 (Today) 8:53 AM [Revised 11:44 AM] Edit

It happens for objects with implementation level of object_serializable. That is:

BOOST_CLASS_IMPLEMENTATION(X, boost::serialization::object_serializable)

For greater implementation level, the tracking level is read from the archive. However it still must affect the saving of objects to any archives (binary, xml, text).

If it's not clear enough, the above code reads/writes the the file correctly when FLAG == 0, but tries to load x2 as-if it's tracked when FLAG == 1.

Edited by Yakov Galka 9/8/2011 (Today) 10:38 AM Edit I've successfully reproduced this same bug in boost 1.33.1, although there it's silent (no crash, just wrong data is read). Boost serialization is broken really hard on the low-level:

basic_iserializer::tracking() decides whether the class should be tracked or not based on m_bpis value. However it can't decide this based on the information it has, since it's shared among objects serialized trough a pointer and not through a pointer.

Possible Fix: make basic_iserializer::tracking return the tracking level instead of a boolean value and let the caller decide what this tracking level means. It's a lot of work, and it may break computability with archives serialized incorrectly in 1.33.1, which happens to be possible. We are screwed anyway.

Edited by Yakov Galka 9/8/2011 (Today) 11:44 AM

Revised Yakov Galka's 8:53 AM entry from 9/8/2011


#6515 Serilaization of std::vector<bool> is broken for optimizing archives serialization To Be Determined Bugs Feb 2, 2012

Serializing a vector<bool> causes corruptions in the created archive. The reason is this function (in boost/serialization/vector.hpp):

template<class Archive, class U, class Allocator>
inline void save(
    Archive & ar,
    const std::vector<U, Allocator> &t,
    const unsigned int /* file_version */,
    mpl::true_
){
    const collection_size_type count(t.size());
    ar << BOOST_SERIALIZATION_NVP(count);
    if (!t.empty())
        ar << make_array(detail::get_data(t),t.size());
}

While detail::get_data(t) is not specialized for std::vector<bool> (but it should be), and t.size() returns the number of bits stored in the vector, which is probably not what's expected either.

I'm encountering this problem with MSVC10, 64bit, Windows7.


#12741 Linker error in cross compiling with x86_64-w64-mingw32-g++ serialization To Be Determined Bugs Jan 10, 2017

Using

using gcc : i686 : i686-w64-mingw32-g++ ;
using gcc : x86_64 : x86_64-w64-mingw32-g++ ;

in tools/build/src/user-config.jam

with x86_64-w64-mingw32-g++ (GCC) 5.3.1 20160211 and calling

./b2 toolset=gcc-x86_64 address-model=64 link=shared --stagedir=x64 target-os=windows threading=multi threadapi=win32 variant=release --with-date_time --with-filesystem --with-graph --with-math --with-program_options --with-serialization --with-system --with-thread --with-timer

gives linker errors

gcc.link.dll bin.v2/libs/serialization/build/gcc-mingw-x86_64/release/target-os-windows/threadapi-win32/threading-multi/libboost_wserialization.dll.a
bin.v2/libs/serialization/build/gcc-mingw-x86_64/release/target-os-windows/threadapi-win32/threading-multi/basic_text_wiprimitive.o:basic_text_wiprimitive.cpp:(.rdata$.refptr._ZTVN5boost7archive12codecvt_nullIwEE[.refptr._ZTVN5boost7archive12codecvt_nullIwEE]+0x0): undefined reference to `vtable for boost::archive::codecvt_null<wchar_t>'
bin.v2/libs/serialization/build/gcc-mingw-x86_64/release/target-os-windows/threadapi-win32/threading-multi/xml_wiarchive.o:xml_wiarchive.cpp:(.rdata$.refptr._ZTVN5boost7archive6detail18utf8_codecvt_facetE[.refptr._ZTVN5boost7archive6detail18utf8_codecvt_facetE]+0x0): undefined reference to `vtable for boost::archive::detail::utf8_codecvt_facet'

The 32bit version i686-w64-mingw32-g++ with toolset=gcc-i686 address-model=32 works.


#12837 Binary serialization: crash that may allow jump to attacker-controlled address serialization To Be Determined Bugs Feb 14, 2017

Using afl-fuzz on some simple programs that use boost binary and xml serialization, I have found a number of crashes and assertion failures.

To test the waters, I am beginning by filing a single bug which may allow a jump to an attacker-controlled address (i.e., the most exploitable-looking crash that has turned up so far). On my test system, it crashes on the instruction shown:

=> 0x000000000044849c <+524>:   mov    (%r12),%rax
   0x00000000004484a0 <+528>:   mov    0x20(%rbp),%r15d
   0x00000000004484a4 <+532>:   mov    %r12,%rdi
   0x00000000004484a7 <+535>:   callq  *0x10(%rax)

Notice that the value loaded at instruction <+524> is used to determine the address to call at instruction <+535>. The value of %r12 interpreted as bytes is "\0\0hive\0\0", which makes me strongly suspect that it is data from the input file (part of the 'serialization::archive' signature, masked off). Generally, the whole text of the input file would be considered under the control of the adversary.

I ran my tests on Debian Jessie amd64 with gcc version 4.9.2 (Debian 4.9.2-10). The following revisions of modularized boost were used (the tip of each master branch at the time of writing, as described by 'git describe --tags --always):

config: boost-1.62.0-57-g1abc59c
core: boost-1.61.0-59-gd753d9a
move: boost-1.63.0
serialization: boost-1.61.0-57-g62bf8fc

The commandline to compile the (non-fuzzing) version of the input test program is:

g++-4.9 -std=c++11 -Os -I serialization/include -I core/include -I move/include -I config/include -o pvec_in pvec_in.cc serialization/src/extended_type_info.cpp serialization/src/extended_type_info_typeid.cpp serialization/src/archive_exception.cpp serialization/src/basic_archive.cpp serialization/src/basic_serializer_map.cpp serialization/src/void_cast.cpp serialization/src/singleton.cpp serialization/src/basic_iarchive.cpp serialization/src/binary_iarchive.cpp serialization/src/basic_iserializer.cpp serialization/src/basic_pointer_iserializer.cpp

The breaking input file is (base-64 encoded):

FgAAAAAAAABzZXJpYWxpemF0aW9uOjphcmNoaXZlDwAECAQIAQAAAAAAAAAAAwAAAAAAAAABAAAA
AAEAAAD0/wEAAAAAAAAAAAEAAAACAAEAAAACAAAAAgAAAAAA

The source for the test harness program (pvec_in.cc) is

#include <fstream>
#include <vector>

#include <boost/shared_ptr.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/vector.hpp>

struct boxed_int
{
    boxed_int() : i(0) {}
    boxed_int(int i) : i(i) {}
    int i;
    template<class Archive>
    void serialize(Archive &ar, unsigned version)
    {
        ar & BOOST_SERIALIZATION_NVP(i);
    }
};
typedef boost::shared_ptr<boxed_int> pi;

void go(std::istream &is) {
    std::vector<pi> vv;
    try
    {
        boost::archive::binary_iarchive ia(is);
        ia & vv;
    }
    catch(std::exception &e) {}
}

int main(int argc, char **argv) {
    if(argc > 1) {
        std::ifstream is(argv[1]);
        go(is);
    } else {
        go(std::cin);
    }

    return 0;
}

The test harness program either takes the input file on stdin or the name of the input file as the first positional argument.

I can share details about the fuzzing setup if you like.

Thank you for taking the time to consider this issue.

--Jeff


#12913 Undefined behaviour in serialization library serialization To Be Determined Bugs Mar 19, 2017

Hi Robert,

while testing multiprecision with clang's sanitizers I found some undefined behaviour in the serialization lib. The issue can be seen by running serialization's own tests with undefined-behaviour sanitizer turned on - in fact nearly all the tests fail, but most of the failures look like issues with the tests rather than the library. However building test_binary_xml_archive with clang++ -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=undefined results in:

../../../boost/archive/detail/interface_oarchive.hpp:47:16: runtime error: downcast of address 0x7ffd0a934990 which does not point to an object of type 'boost::archive::xml_oarchive'
0x7ffd0a934990: note: object is of type 'boost::archive::xml_oarchive_impl<boost::archive::xml_oarchive>'
 fd 7f 00 00  78 ae d3 9c d6 7f 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'boost::archive::xml_oarchive_impl<boost::archive::xml_oarchive>'
SUMMARY: AddressSanitizer: undefined-behavior ../../../boost/archive/detail/interface_oarchive.hpp:47:16 in 

Which looks like a genuine issue to me.


Raffi Enficiaud (3 matches)

#13007 When BOOST_BIND_NO_PLACEHOLDERS is defined, framework.ipp seems to be missing an #include test Boost 1.65.0 Bugs May 3, 2017

Like the summary says, I think boost/test/impl/framework.ipp should simply have one additional #include <boost/bind/placeholders.hpp> so it works when BOOST_BIND_NO_PLACEHOLDERS is defined.


#12240 Documentation for data-driven testing should explictly mention std::tuple test To Be Determined Feature Requests May 31, 2016

BOOST_DATA_TEST_CASE() handles ranges of std::tuples differently to ranges of other types, in that it expects to be able to expand the parts of the tuples out to multiple variables. Whether or not this is intended or just a side-effect of the implementation, I think it's a sensible behaviour. Indeed, it's quite useful to be able to supply BOOST_DATA_TEST_CASE() with pre-zipped data rather than always having to use ^.

However at the moment, this special handling of std::tuple is not documented. Hence I suggest that this be included in the documentation (possibly near the "Zips" section) or otherwise that the implementation is changed so that users' ranges of std::tuples are treated like ranges of other types (ie each tuple is expanded to one variable).

Many thanks for your work on this library.


#12902 boost test labels test Boost 1.68.0 Support Requests Mar 13, 2017

there is a tutorial about new boost test feature - the labels. but it is not clear how to run all tests in testsuite except those that are with a specific label. could you help, please?


rsd (1 match)

#8498 cray.jam doesn't build .so files Building Boost To Be Determined Bugs Apr 26, 2013

The current cray.jam file doesn't build dynamic libraries because of the lack of the -fPIC flet ag. On my my system I made the following changes (in attached patch) and was able to get ec.verything to build. I'm not a boostjam expert, I just modelled my changes on the pgi.jam and gcc.jam files. So some of these changes might not be appropriate.


Steven Watanabe (1 match)

#9704 b2: Compiler flavour has no flexibility for cross-compiling projects. build To Be Determined Bugs Feb 24, 2014

Hi,

I've been trying hard, but it is annoying, didn't find it elsewhere and it could really be improved.

I am building my project (i.e. all of my project tree)

on 2 platforms:

  • Windows,
  • Linux,

for 3 different platforms:

  • Windows
  • Linux IA32
  • Linux ARM HF

Now, whilst b2 subsystem is quite flexible in specifying different types of compilers, it is not so much when using the same type of compiler, but using different versions of it.

I have managed to define it somehow, i.e. in my project_config.jam (@ home dir):

if [ os.name ] = NT
{
using gcc : : :
     <cxxflags>-std=c++11 
     <cxxflags>"-include cmath"
     <cxxflags>-Wdeprecated-declarations
    ;

using gcc : armhf : arm-linux-gnueabihf-g++.exe :
     <cxxflags>-std=c++11
     <cxxflags>"-include cmath"
     <cxxflags>-Wdeprecated-declarations
    ;
}

if [ os.name ] = LINUX
{
using gcc : : :
     <cxxflags>-std=c++11 
     <cxxflags>"-include cmath"
    ;

using gcc : armhf : /usr/bin/arm-linux-gnueabihf-g++ :
     <cxxflags>-std=c++11 
     <cxxflags>"-include cmath"
     <cxxflags>-Wdeprecated-declarations
    ;
}

But now, in every sub-project, where I'm moving files to a 'release' location, (* and whenever I need to specify copmiler-flavor specific configuration) I need to perform something like:

install copy_binaries_to_release
  : 
    target_names..
  :
    <target-os>linux:<toolset-gcc:version>4.7:<location>../../release/
    <target-os>windows:<toolset>gcc-4.7.2-mingw:<location>../../release/
    <toolset-gcc:version>armhf:<location>../../release_armhf/
    <toolset>gcc-mingw-armhf:<location>../../release/
  ;

Is there a better way of doing it?

If not, then the problem (and I guess a bug) is that b2 behaves differently on different platforms, somewhat lacks of mechanism to support what I need to do (and it's not really very uncommon).

Problems:

  1. Different toolset names when building on different OSes (and yes, I did try to specify a default flavor, but see Problem 2).
command toolset flavor
gcc XA32(linux) b2 gcc 4.7
gcc XA32(win) b2 gcc-4.7.2-mingw ?
gcc armhf(linux) b2 --toolset=gcc-armhf gcc armhf
gcc armhf(win) b2 --toolset=gcc-armhf target-os=linux gcc-mingw-armhf ?

Only gcc-armhf seems to achieve requested results. BUt the main issue it, that it is all different on different platforms, and both: armhf should produce compatible binaries.

BTW: is there really a need to distinguish between e.g. Cygwin and MinGW flavours if they produce the same target with the same version of compiler? If one builds from Cygwin and MinGW for the same platform: resulting executables should be compatible for the same target, so only in 'bin' build directory they can really be different (if needed), but it is unlikely that one builds both of them (target:gcc version) at the same time (like it is unlikely that I build under windows and linux at the same time).

  1. It is not possible to specify a flavor for GCC (by explicitly giving it a name and compiler location) - because b2 is performing a version check. This check either fails, or if it does not (and default version is used) - automatic build-platform-specific flavor value is created behind the control) - probably because b2 is trying to be too clever at this.

Couldn't it leave it alone, and use flavor that was explicitly specified?

I really wish that I could specify above:

using gcc : 4.7 : <my-path-to-gcc47> ... ;
using gcc : armhf : <my-path-to-gcc47 arm hf>  ... ;

and wouldn't have to create links or worry about the build system changing/ coming up with a flavor by concatenating target name (e.g. on

b2 --toolset=gcc-armhf

with g++ (and having to hack/create symlinks to match this etc.) -

It should just accept what I specify, and use it 'as-is' (and if someone does something stupid - let them fail and fix it).

There could also be a support for something like:

import toolset ;

if [ toolset.name ] == gcc
{
  if [ toolset.flavor ] == flav_1
  {
  }
}

# and my verbosive Jamfiles could be re-written to something like:

local gcc_flavor = [ toolset.flavor ] ;
install copy_binaries_to_release
  : 
    target_names..
  :
    <toolset>gcc,<flavor>4.7:<location>../../release
    <toolset>gcc,<flavor>armhf:<location>../../release_$(gcc_flavor)
    
    # or even to:
    <toolset>gcc:<location>../../release_$(gcc_flavor)
  ;

With a bit of guidance / advice from someone, who knows the build system well - I'm happy to help with implementing the above.

Thanks, LUkasz.

(BTW: what is the best component for build system / tools?)


Kohei Takahashi (2 matches)

#6026 phoenix block statement tries to copy objects instead of references phoenix To Be Determined Bugs Oct 14, 2011

Let's use a simplest class, that can't be copied:

class A {
   A() {}
   A(const A&);
public:
   static A* construct() { return new A(); }
   const A& operator<<(const char *p) const { return *this; }
};

A *pa = A::construct();
A &a = *pa;

The code which use this object one time normally works:

(boost::phoenix::ref(a) << boost::phoenix::placeholders::_1)("aaa");

But when I try to use this object two times, I get an error:

(
   boost::phoenix::ref(a) << boost::phoenix::placeholders::_1
   ,boost::phoenix::ref(a) << boost::phoenix::placeholders::_1
)("aaa");

Result: 'A::A' : cannot access private member declared in class 'A'

Expecting: pass compilation and invoke "A::operator<<" two times.

Note: preprocessing directive "BOOST_SPIRIT_USE_PHOENIX_V3" was defined.


#6911 [Phoenix V3] Add tr1_result_of specialization phoenix Boost 1.67.0 Bugs May 17, 2012

To make result_of and tr1_result_of equivalent, we have to add specialization of tr1_result_of. (Boost.Phoenix V3 already has specialization of result_of.)

Also, it would be nice to avoid specialization of result_of, when we use decltype-based result_of. (As for tr1_result_of, it should be specialized even when decltype-based result_of is used.)

So, instead of

template <...>
struct result_of<F()>
{
    typedef XXXX type;
};

we should write

#if !defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_NO_DECLTYPE)
template <...>
struct result_of<F()>
{
    typedef XXXX type;
};
#endif

template <...>
struct tr1_result_of<F()>
{
    typedef XXXX type;
};

A quick grep said the following files specialize result_of.

  • phoenix/core/actor.hpp
  • phoenix/function/function.hpp

Thomas Heller (1 match)

#5558 Phoenix bind doesn't support bind<type> construct phoenix To Be Determined Bugs May 23, 2011

boost::bind uses bind<type> in situations where it cannot determine the return type. This is useful for situations where you are binding to a method with a variable argument list such as printf.

I'm not so much concerned with the bind<type> construct as I'm unsure how to bind to functions such as printf. Is there a syntax for this when utilizing Phoenix bind that I have missed?

Using boost::bind --

boost::bind<int>( &printf, "%d ", _1 )(42);

Using phoenix::bind --

phx::bind( &printf, "%d ", arg1 )(42);

results in compilation error.


troy d. straszheim (2 matches)

#3450 [fix in git] Bug into boost::python::stl_input_iterator python USE GITHUB Boost 1.41.0 Bugs Sep 15, 2009

I noticed that if you try to traverse more than once the range (begin,end) obtained with the stl_input_iterator, you don't get the expected results.

Please, look at the attached code (rangemodule.cpp) and at the usage from the python console (python_console.txt).

The problem is given by the call to the std::distance function.
If you build with -DWORK_AROUND the problem disappears, but I need to call std::distance, because it is the original class that calls it (and I prefer not to modify it simply for building a python extension).


#3673 boost python and weak_ptr from a shared_ptr argument python USE GITHUB Boost 1.43.0 Feature Requests Nov 26, 2009

if you save a weak_ptr of a shared_ptr passed to you by python, it expires almost immediately (see use of aliasing constructor in shared_ptr_from_python.hpp). See also mail from Jahn Fuchs on c++-sig list subject: boost python and weak_ptr from a shared_ptr argument


Matthias Troyer (2 matches)

#2838 MPI Python bindings not installed correctly mpi Boost 1.46.0 Bugs Mar 9, 2009

I've successfully built and installed boost.MPI and the Python bindings in my home dir.

Unfortunately, the Python module "mpi.so" is installed directly in the lib/-path as all the other Boost libs. When setting the PYTHONPATH to point to this location, the boost.mpi python bindings are accessible only via "import mpi" from within Python, and not via "import boost.mpi", as described in the docs at

http://www.boost.org/doc/libs/1_38_0/doc/html/mpi/python.html

I think that the Python modules should go to a sudirectory "boost" in the lib path, or it should be fixed in the documentation.

Otherwise, the boost.mpi Python bindings are gorgeous!


#4657 Boost.MPI Compile failure with Python 3 mpi To Be Determined Bugs Sep 18, 2010

Boost 1.44 configured to use Python 3.1 fails on two Boost.MPI files. The two fatal error messages are reproduced below, edited (see http://lists.boost.org/Archives/boost/2010/09/170659.php for the full error output).

This failure was discussed in Debian (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=595786) and Andreas Kloeckner provided a patch. See attached.

-Steve

"g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -g -D_REENTRANT -pthread -fPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_MPI_DYN_LINK=1 -DBOOST_MPI_PYTHON_DYN_LINK=1 -DBOOST_PYTHON_DYN_LINK=1 -DNDEBUG -I"." -I"/usr/include/python3.1" -I"/usr/lib/openmpi/include" -I"/usr/lib/openmpi/include/openmpi" -c -o "bin.v2/libs/mpi/build/gcc-4.4.5/release/debug-symbols-on/python-3.1/threading-multi/python/datatypes.o" "libs/mpi/src/python/datatypes.cpp"

libs/mpi/src/python/datatypes.cpp: In function ‘void boost::mpi::python::export_datatypes()’: libs/mpi/src/python/datatypes.cpp:20: error: ‘PyInt_Type’ was not declared in this scope In file included from ./boost/function/detail/prologue.hpp:17,

from ./boost/function/function_template.hpp:13, from ./boost/function/detail/maybe_include.hpp:13, from ./boost/function/function0.hpp:11, from ./boost/python/errors.hpp:13, from ./boost/python/handle.hpp:11, from ./boost/python/converter/arg_to_python_base.hpp:7, from ./boost/python/converter/arg_to_python.hpp:14, from ./boost/python/call.hpp:15, from ./boost/python/object_core.hpp:14, from ./boost/python/object.hpp:9, from ./boost/mpi/python/serialize.hpp:25, from libs/mpi/src/python/datatypes.cpp:13:

...failed gcc.compile.c++ bin.v2/libs/mpi/build/gcc-4.4.5/release/debug-symbols-on/python-3.1/threading-multi/python/datatypes.o...

and

"g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -g -D_REENTRANT -pthread -fPIC -DBOOST_ALL_NO_LIB=1 -DBOOST_MPI_DYN_LINK=1 -DBOOST_MPI_PYTHON_DYN_LINK=1 -DBOOST_PYTHON_DYN_LINK=1 -DNDEBUG -I"." -I"/usr/include/python3.1" -I"/usr/lib/openmpi/include" -I"/usr/lib/openmpi/include/openmpi" -c -o "bin.v2/libs/mpi/build/gcc-4.4.5/release/debug-symbols-on/python-3.1/threading-multi/python/py_environment.o" "libs/mpi/src/python/py_environment.cpp"

libs/mpi/src/python/py_environment.cpp: In function ‘bool boost::mpi::python::mpi_init(boost::python::list, bool)’: libs/mpi/src/python/py_environment.cpp:53: error: cannot convert ‘char’ to ‘wchar_t’ for argument ‘2’ to ‘void PySys_SetArgv(int, wchar_t)’ ...failed gcc.compile.c++ bin.v2/libs/mpi/build/gcc-4.4.5/release/debug-symbols-on/python-3.1/threading-multi/python/py_environment.o...


Jonathan Turkanis (1 match)

#2557 iostreams filtering_stream w/ gzip infinite loop when writing to a full drive iostreams Boost 1.38.0 Bugs Dec 1, 2008

When a filtering_stream with a gzip_compressor is used to write to a full hard drive (i.e. insufficient free space), boost enters an infinite loop in /boost/iostreams/detail/adapter/non_blocking_adapter.hpp:41 because the write function keeps returning zero. This loop happens during the destruction of the stream. I can't seem to find a client-side workaround.

Attached is a test case, point it to a volume with zero space and give some large number of bytes. If there's insufficient space, execution hangs. Tested on mingw/winxp/gcc4.2 but seems to fail on linux/gcc as well.


viboes (53 matches)

#7319 Take care of c++std-lib-32966 issue thread To Be Determined Bugs Sep 2, 2012

Take care of the issue raised by Howard Hinnant in

[c++std-lib-32966] Public service announcement concerning ~condition_variable_any()

"Both condition_variable and condition_variable_any are based on the POSIX pthread_cond_t. One of the very subtle behaviors of pthread_cond_t is that it is ok for a pthread_cond_t to be destroyed after all waiting threads have been signaled (assuming no new threads initiate a wait). There's even an example demonstrating this at http://www.unix.org/online.html under the specification for pthread_cond_destroy.

This subtlety is reflected in the Requires clause for the destructor of both condition_variable and condition_variable_any:

Requires: There shall be no thread blocked on *this. [Note: That is, all threads shall have been notified; they may subsequently block on the lock specified in the wait. This relaxes the usual rules, which would have required all wait calls to happen before destruction. Only the notification to unblock the wait must happen before destruction. The user must take care to ensure that no threads wait on *this once the destructor has been started, especially when the waiting threads are calling the wait functions in a loop or using the overloads of wait, wait_for, or wait_until that take a predicate. — end note ]

To be *perfectly* clear, the following is ok:

  Thread A                    Thread B
   ...                        lk.lock()
   ...                        cv.wait(lk)
  lk.lock()                      ...
  cv.notify_one()                ...
  cv.~condition_variable_any()   ...
  lk.unlock()                    ...
    ...                       finally exits cv.wait  // ok, not a data race

"


#7912 boost:thread documentation for 1.50 does not mention BOOST_THREAD_WAIT_BUG thread To Be Determined Bugs Jan 21, 2013

As I understood from the trac ticket https://svn.boost.org/trac/boost/ticket/7089 and sources for boost 1.50, boost::thread 1.50 implicitly adds 100 ms to the sleep time of boost::this_thread::sleep and boost::thread_sleep on linux. If the fix for 7089 cannot be backported into 1.50, the warning about broken functionality must be present in the documentation for 1.50.


#8600 wait_for_any hangs, if called with multiple copies of shared_future referencing same task thread To Be Determined Bugs May 21, 2013

The following small test program shows the problem:

#include <iostream>
#include <boost/thread.hpp>

int calculate_the_answer_to_life_the_universe_and_everything()
{
    return 42;
}

int main(int argc, char* argv[])
{
   boost::packaged_task<int> pt(calculate_the_answer_to_life_the_universe_and_everything);
   boost::shared_future<int> fi1 = boost::shared_future<int>(pt.get_future());
   boost::shared_future<int> fi2 = fi1;

   boost::thread task(boost::move(pt)); // launch task on a thread

   boost::wait_for_any(fi1, fi2);
   std::cout << "Wait for any returned\n";
   return (0);
}

This program hangs infinitely in the call to boost::wait_for_any. From the docs I would expect this to work, because it's allowed to copy shared_futures. If this is not allowed, a possibility would be needed, to find out, if two shared_futures point to the same task or not. Currently wait_for_any is unusable, if there are chances, that multiple shared_futures point to the same result.


#11091 notify_all_at_thread_exit - ThreadSanitizer: data race thread To Be Determined Bugs Mar 9, 2015
Test output: BenPope x86_64 Ubuntu - thread - notify_all_at_thread_exit_p / clang-linux-3.6~tsan~c14_libc++
Rev 9b68e2eec037cbcb6f96d7d54079e7e1a6a274ab / Mon, 09 Mar 2015 11:14:53 +0000
Compile [2015-03-09 15:31:08 UTC]: succeed


"clang++-3.6" -c -x c++ -Wextra -Wno-long-long -Wno-unused-parameter -Wunused-function -std=c++1y -stdlib=libc++ -fsanitize=thread -O0 -fno-inline -Wall -pthread -fPIC -Wextra -Wno-long-long -Wno-unused-parameter -Wunused-function -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED -DBOOST_THREAD_USE_DLL=1 -I".." -o "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/test/notify_all_at_thread_exit_p.test/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi/sync/conditions/notify_all_at_thread_exit_pass.o" "../libs/thread/test/sync/conditions/notify_all_at_thread_exit_pass.cpp"

            

Link [2015-03-09 15:31:08 UTC]: succeed


"clang++-3.6"  -Wl,-R -Wl,"/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/chrono/build/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi" -Wl,-R -Wl,"/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/system/build/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi" -Wl,-R -Wl,"/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/build/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi" -Wl,-rpath-link -Wl,"/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/chrono/build/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi" -Wl,-rpath-link -Wl,"/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/system/build/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi" -Wl,-rpath-link -Wl,"/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/build/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi" -o "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/test/notify_all_at_thread_exit_p.test/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi/notify_all_at_thread_exit_p" -Wl,--start-group "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/test/notify_all_at_thread_exit_p.test/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi/sync/conditions/notify_all_at_thread_exit_pass.o" "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/test/notify_all_at_thread_exit_p.test/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi/winrt_init.o" "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/build/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi/libboost_thread.so.1.58.0" "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/chrono/build/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi/libboost_chrono.so.1.58.0" "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/system/build/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi/libboost_system.so.1.58.0"  -Wl,-Bstatic  -Wl,-Bdynamic -lrt -Wl,--end-group -fsanitize=thread -lc++ -lc++abi -pthread 

RmTemps /home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/test/notify_all_at_thread_exit_p.test/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi/notify_all_at_thread_exit_p

    rm -f "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/test/notify_all_at_thread_exit_p.test/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi/sync/conditions/notify_all_at_thread_exit_pass.o" "/home/ben/development/boost/test/build/develop/results/boost/bin.v2/libs/thread/test/notify_all_at_thread_exit_p.test/clang-linux-3.6~tsan~c14_libc++/debug/debug-symbols-off/threading-multi/winrt_init.o"

            

Run [2015-03-09 15:31:08 UTC]: fail


==================
WARNING: ThreadSanitizer: data race (pid=14082)
  Write of size 8 at 0x7fd7f9795c48 by thread T1:
    #0 boost::(anonymous namespace)::thread_proxy(void*) <null> (libboost_thread.so.1.58.0+0x00000002567a)

  Previous write of size 8 at 0x7fd7f9795c48 by main thread:
    #0 <null> <null> (0x000000000001)

  Location is stack of thread T1.

  Thread T1 (tid=14087, running) created by main thread at:
    #0 pthread_create /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:896:3 (notify_all_at_thread_exit_p+0x00000045e361)
    #1 boost::thread::start_thread_noexcept() <null> (libboost_thread.so.1.58.0+0x0000000255b0)
    #2 boost::thread::start_thread() <null> (notify_all_at_thread_exit_p+0x0000004c3ba3)
    #3 boost::thread::thread<void (&)()>(void (&)()) <null> (notify_all_at_thread_exit_p+0x0000004c2f8b)
    #4 main <null> (notify_all_at_thread_exit_p+0x0000004c0903)

SUMMARY: ThreadSanitizer: data race ??:0 boost::(anonymous namespace)::thread_proxy(void*)
==================
==================
WARNING: ThreadSanitizer: data race (pid=14082)
  Read of size 8 at 0x7d4c0000de58 by thread T1:
    #0 boost::shared_ptr<boost::detail::thread_data_base>::shared_ptr(boost::shared_ptr<boost::detail::thread_data_base> const&) <null> (libboost_thread.so.1.58.0+0x0000000318e5)
    #1 boost::(anonymous namespace)::thread_proxy(void*) <null> (libboost_thread.so.1.58.0+0x0000000256a3)

  Previous write of size 8 at 0x7d4c0000de58 by main thread (mutexes: write M24):
    #0 boost::shared_ptr<boost::detail::thread_data_base>::swap(boost::shared_ptr<boost::detail::thread_data_base>&) <null> (libboost_thread.so.1.58.0+0x000000031796)
    #1 boost::shared_ptr<boost::detail::thread_data_base>::operator=(boost::shared_ptr<boost::detail::thread_data_base> const&) <null> (libboost_thread.so.1.58.0+0x00000003142d)
    #2 boost::thread::start_thread_noexcept() <null> (libboost_thread.so.1.58.0+0x000000025579)
    #3 boost::thread::start_thread() <null> (notify_all_at_thread_exit_p+0x0000004c3ba3)
    #4 boost::thread::thread<void (&)()>(void (&)()) <null> (notify_all_at_thread_exit_p+0x0000004c2f8b)
    #5 main <null> (notify_all_at_thread_exit_p+0x0000004c0903)

  Location is heap block of size 424 at 0x7d4c0000de40 allocated by main thread:
    #0 operator new(unsigned long) /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:571:3 (notify_all_at_thread_exit_p+0x00000045aebd)
    #1 boost::detail::thread_data<void (*)()>* boost::detail::heap_new<boost::detail::thread_data<void (*)()>, void (*)()>(void (*&&)()) <null> (notify_all_at_thread_exit_p+0x0000004c6acb)
    #2 boost::thread::make_thread_info(void (*)()) <null> (notify_all_at_thread_exit_p+0x0000004c3a87)
    #3 boost::thread::thread<void (&)()>(void (&)()) <null> (notify_all_at_thread_exit_p+0x0000004c2f82)
    #4 main <null> (notify_all_at_thread_exit_p+0x0000004c0903)

  Mutex M24 (0x0000014d9438) created at:
    #0 pthread_mutex_init /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1082:3 (notify_all_at_thread_exit_p+0x00000045f790)
    #1 boost::mutex::mutex() <null> (notify_all_at_thread_exit_p+0x0000004c27d7)
    #2 __cxx_global_var_init10 <null> (notify_all_at_thread_exit_p+0x0000004439cc)
    #3 _GLOBAL__sub_I_notify_all_at_thread_exit_pass.cpp <null> (notify_all_at_thread_exit_p+0x000000443a43)
    #4 __libc_csu_init <null> (notify_all_at_thread_exit_p+0x0000004d538c)

  Thread T1 (tid=14087, running) created by main thread at:
    #0 pthread_create /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:896:3 (notify_all_at_thread_exit_p+0x00000045e361)
    #1 boost::thread::start_thread_noexcept() <null> (libboost_thread.so.1.58.0+0x0000000255b0)
    #2 boost::thread::start_thread() <null> (notify_all_at_thread_exit_p+0x0000004c3ba3)
    #3 boost::thread::thread<void (&)()>(void (&)()) <null> (notify_all_at_thread_exit_p+0x0000004c2f8b)
    #4 main <null> (notify_all_at_thread_exit_p+0x0000004c0903)

SUMMARY: ThreadSanitizer: data race ??:0 boost::shared_ptr<boost::detail::thread_data_base>::shared_ptr(boost::shared_ptr<boost::detail::thread_data_base> const&)
==================
==================
WARNING: ThreadSanitizer: data race (pid=14082)
  Write of size 8 at 0x7fd7f9795c38 by thread T1:
    #0 boost::shared_ptr<boost::detail::thread_data_base>::shared_ptr(boost::shared_ptr<boost::detail::thread_data_base> const&) <null> (libboost_thread.so.1.58.0+0x0000000318f9)
    #1 boost::(anonymous namespace)::thread_proxy(void*) <null> (libboost_thread.so.1.58.0+0x0000000256a3)

  Previous write of size 8 at 0x7fd7f9795c38 by main thread:
    #0 <null> <null> (0x000000000001)

  Location is stack of thread T1.

  Thread T1 (tid=14087, running) created by main thread at:
    #0 pthread_create /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:896:3 (notify_all_at_thread_exit_p+0x00000045e361)
    #1 boost::thread::start_thread_noexcept() <null> (libboost_thread.so.1.58.0+0x0000000255b0)
    #2 boost::thread::start_thread() <null> (notify_all_at_thread_exit_p+0x0000004c3ba3)
    #3 boost::thread::thread<void (&)()>(void (&)()) <null> (notify_all_at_thread_exit_p+0x0000004c2f8b)
    #4 main <null> (notify_all_at_thread_exit_p+0x0000004c0903)

SUMMARY: ThreadSanitizer: data race ??:0 boost::shared_ptr<boost::detail::thread_data_base>::shared_ptr(boost::shared_ptr<boost::detail::thread_data_base> const&)
==================
==================
WARNING: ThreadSanitizer: data race (pid=14082)
  Read of size 8 at 0x7d4c0000de60 by thread T1:
    #0 boost::detail::shared_count::shared_count(boost::detail::shared_count const&) <null> (notify_all_at_thread_exit_p+0x0000004c7696)
    #1 boost::shared_ptr<boost::detail::thread_data_base>::shared_ptr(boost::shared_ptr<boost::detail::thread_data_base> const&) <null> (libboost_thread.so.1.58.0+0x000000031929)
    #2 boost::(anonymous namespace)::thread_proxy(void*) <null> (libboost_thread.so.1.58.0+0x0000000256a3)

  Previous write of size 8 at 0x7d4c0000de60 by main thread (mutexes: write M24):
    #0 boost::detail::shared_count::swap(boost::detail::shared_count&) <null> (notify_all_at_thread_exit_p+0x0000004c71cb)
    #1 boost::shared_ptr<boost::detail::thread_data_base>::swap(boost::shared_ptr<boost::detail::thread_data_base>&) <null> (libboost_thread.so.1.58.0+0x0000000317d6)
    #2 boost::shared_ptr<boost::detail::thread_data_base>::operator=(boost::shared_ptr<boost::detail::thread_data_base> const&) <null> (libboost_thread.so.1.58.0+0x00000003142d)
    #3 boost::thread::start_thread_noexcept() <null> (libboost_thread.so.1.58.0+0x000000025579)
    #4 boost::thread::start_thread() <null> (notify_all_at_thread_exit_p+0x0000004c3ba3)
    #5 boost::thread::thread<void (&)()>(void (&)()) <null> (notify_all_at_thread_exit_p+0x0000004c2f8b)
    #6 main <null> (notify_all_at_thread_exit_p+0x0000004c0903)

  Location is heap block of size 424 at 0x7d4c0000de40 allocated by main thread:
    #0 operator new(unsigned long) /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:571:3 (notify_all_at_thread_exit_p+0x00000045aebd)
    #1 boost::detail::thread_data<void (*)()>* boost::detail::heap_new<boost::detail::thread_data<void (*)()>, void (*)()>(void (*&&)()) <null> (notify_all_at_thread_exit_p+0x0000004c6acb)
    #2 boost::thread::make_thread_info(void (*)()) <null> (notify_all_at_thread_exit_p+0x0000004c3a87)
    #3 boost::thread::thread<void (&)()>(void (&)()) <null> (notify_all_at_thread_exit_p+0x0000004c2f82)
    #4 main <null> (notify_all_at_thread_exit_p+0x0000004c0903)

  Mutex M24 (0x0000014d9438) created at:
    #0 pthread_mutex_init /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1082:3 (notify_all_at_thread_exit_p+0x00000045f790)
    #1 boost::mutex::mutex() <null> (notify_all_at_thread_exit_p+0x0000004c27d7)
    #2 __cxx_global_var_init10 <null> (notify_all_at_thread_exit_p+0x0000004439cc)
    #3 _GLOBAL__sub_I_notify_all_at_thread_exit_pass.cpp <null> (notify_all_at_thread_exit_p+0x000000443a43)
    #4 __libc_csu_init <null> (notify_all_at_thread_exit_p+0x0000004d538c)

  Thread T1 (tid=14087, running) created by main thread at:
    #0 pthread_create /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:896:3 (notify_all_at_thread_exit_p+0x00000045e361)
    #1 boost::thread::start_thread_noexcept() <null> (libboost_thread.so.1.58.0+0x0000000255b0)
    #2 boost::thread::start_thread() <null> (notify_all_at_thread_exit_p+0x0000004c3ba3)
    #3 boost::thread::thread<void (&)()>(void (&)()) <null> (notify_all_at_thread_exit_p+0x0000004c2f8b)
    #4 main <null> (notify_all_at_thread_exit_p+0x0000004c0903)

SUMMARY: ThreadSanitizer: data race ??:0 boost::detail::shared_count::shared_count(boost::detail::shared_count const&)
==================
==================
WARNING: ThreadSanitizer: data race (pid=14082)
  Write of size 8 at 0x7fd7f9795c40 by thread T1:
    #0 boost::detail::shared_count::shared_count(boost::detail::shared_count const&) <null> (notify_all_at_thread_exit_p+0x0000004c76aa)
    #1 boost::shared_ptr<boost::detail::thread_data_base>::shared_ptr(boost::shared_ptr<boost::detail::thread_data_base> const&) <null> (libboost_thread.so.1.58.0+0x000000031929)
    #2 boost::(anonymous namespace)::thread_proxy(void*) <null> (libboost_thread.so.1.58.0+0x0000000256a3)

  Previous write of size 8 at 0x7fd7f9795c40 by main thread:
    #0 <null> <null> (0x000000000001)

  Location is stack of thread T1.

  Thread T1 (tid=14087, running) created by main thread at:
    #0 pthread_create /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:896:3 (notify_all_at_thread_exit_p+0x00000045e361)
    #1 boost::thread::start_thread_noexcept() <null> (libboost_thread.so.1.58.0+0x0000000255b0)
    #2 boost::thread::start_thread() <null> (notify_all_at_thread_exit_p+0x0000004c3ba3)
    #3 boost::thread::thread<void (&)()>(void (&)()) <null> (notify_all_at_thread_exit_p+0x0000004c2f8b)
    #4 main <null> (notify_all_at_thread_exit_p+0x0000004c0903)

SUMMARY: ThreadSanitizer: data race ??:0 boost::detail::shared_count::shared_count(boost::detail::shared_count const&)
==================
==================
WARNING: ThreadSanitizer: data race (pid=14082)
  Atomic write of size 4 at 0x7d080000ef88 by thread T1:
    #0 __tsan_atomic32_fetch_add /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cc:613:3 (notify_all_at_thread_exit_p+0x0000004a5256)
    #1 boost::detail::atomic_increment(int _Atomic*) <null> (notify_all_at_thread_exit_p+0x0000004c77cc)
    #2 boost::detail::sp_counted_base::add_ref_copy() <null> (notify_all_at_thread_exit_p+0x0000004c7749)
    #3 boost::detail::shared_count::shared_count(boost::detail::shared_count const&) <null> (notify_all_at_thread_exit_p+0x0000004c76e6)
    #4 boost::shared_ptr<boost::detail::thread_data_base>::shared_ptr(boost::shared_ptr<boost::detail::thread_data_base> const&) <null> (libboost_thread.so.1.58.0+0x000000031929)
    #5 boost::(anonymous namespace)::thread_proxy(void*) <null> (libboost_thread.so.1.58.0+0x0000000256a3)

  Previous write of size 8 at 0x7d080000ef88 by main thread (mutexes: write M24):
    #0 operator new(unsigned long) /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:571:3 (notify_all_at_thread_exit_p+0x00000045aebd)
    #1 boost::detail::shared_count::shared_count<boost::detail::thread_data<void (*)()> >(boost::detail::thread_data<void (*)()>*) <null> (notify_all_at_thread_exit_p+0x0000004c6f67)
    #2 void boost::detail::sp_pointer_construct<boost::detail::thread_data_base, boost::detail::thread_data<void (*)()> >(boost::shared_ptr<boost::detail::thread_data_base>*, boost::detail::thread_data<void (*)()>*, boost::detail::shared_count&) <null> (notify_all_at_thread_exit_p+0x0000004c6dd0)
    #3 boost::shared_ptr<boost::detail::thread_data_base>::shared_ptr<boost::detail::thread_data<void (*)()> >(boost::detail::thread_data<void (*)()>*) <null> (notify_all_at_thread_exit_p+0x0000004c6c7b)
    #4 boost::thread::make_thread_info(void (*)()) <null> (notify_all_at_thread_exit_p+0x0000004c3a93)
    #5 boost::thread::thread<void (&)()>(void (&)()) <null> (notify_all_at_thread_exit_p+0x0000004c2f82)
    #6 main <null> (notify_all_at_thread_exit_p+0x0000004c0903)

  Location is heap block of size 24 at 0x7d080000ef80 allocated by main thread:
    #0 operator new(unsigned long) /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:571:3 (notify_all_at_thread_exit_p+0x00000045aebd)
    #1 boost::detail::shared_count::shared_count<boost::detail::thread_data<void (*)()> >(boost::detail::thread_data<void (*)()>*) <null> (notify_all_at_thread_exit_p+0x0000004c6f67)
    #2 void boost::detail::sp_pointer_construct<boost::detail::thread_data_base, boost::detail::thread_data<void (*)()> >(boost::shared_ptr<boost::detail::thread_data_base>*, boost::detail::thread_data<void (*)()>*, boost::detail::shared_count&) <null> (notify_all_at_thread_exit_p+0x0000004c6dd0)
    #3 boost::shared_ptr<boost::detail::thread_data_base>::shared_ptr<boost::detail::thread_data<void (*)()> >(boost::detail::thread_data<void (*)()>*) <null> (notify_all_at_thread_exit_p+0x0000004c6c7b)
    #4 boost::thread::make_thread_info(void (*)()) <null> (notify_all_at_thread_exit_p+0x0000004c3a93)
    #5 boost::thread::thread<void (&)()>(void (&)()) <null> (notify_all_at_thread_exit_p+0x0000004c2f82)
    #6 main <null> (notify_all_at_thread_exit_p+0x0000004c0903)

  Mutex M24 (0x0000014d9438) created at:
    #0 pthread_mutex_init /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1082:3 (notify_all_at_thread_exit_p+0x00000045f790)
    #1 boost::mutex::mutex() <null> (notify_all_at_thread_exit_p+0x0000004c27d7)
    #2 __cxx_global_var_init10 <null> (notify_all_at_thread_exit_p+0x0000004439cc)
    #3 _GLOBAL__sub_I_notify_all_at_thread_exit_pass.cpp <null> (notify_all_at_thread_exit_p+0x000000443a43)
    #4 __libc_csu_init <null> (notify_all_at_thread_exit_p+0x0000004d538c)

  Thread T1 (tid=14087, running) created by main thread at:
    #0 pthread_create /home/development/llvm/3.6.0/final/llvm.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:896:3 (notify_all_at_thread_exit_p+0x00000045e361)
    #1 boost::thread::start_thread_noexcept() <null> (libboost_thread.so.1.58.0+0x0000000255b0)
    #2 boost::thread::start_thread() <null> (notify_all_at_thread_exit_p+0x0000004c3ba3)
    #3 boost::thread::thread<void (&)()>(void (&)()) <null> (notify_all_at_thread_exit_p+0x0000004c2f8b)
    #4 main <null> (notify_all_at_thread_exit_p+0x0000004c0903)

SUMMARY: ThreadSanitizer: data race ??:0 boost::detail::atomic_increment(int _Atomic*)
==================
No errors detected.
ThreadSanitizer: reported 6 warnings

EXIT STATUS: 66
            



#11499 windows - exception lock_error while intensive locking/unlocking of shared_mutex on many threads thread To Be Determined Bugs Jul 25, 2015
#include "stdafx.h"
#include <boost/thread/shared_mutex.hpp>
#include <thread>
#include <mutex>
#include <shared_mutex>
#include <atomic>
#include <vector>

using MutexT = boost::shared_mutex;
using ReaderLockT = std::lock_guard<MutexT>;
using WriterLockT = std::shared_lock<MutexT>;

MutexT gMutex;
std::atomic<bool> running = true;

long reads = 0;

void read()
{
   while (running)
   {
      ReaderLockT lock(gMutex);
      std::this_thread::yield();
      ++reads;
   }
}

int main()
{
   using namespace std;

   vector<thread> threads;
   for (int i = 0; i < 256; ++i)
   {
      threads.emplace_back(thread(read));
   }

   string str;

   getline(std::cin, str);
   running = false;

   for (auto& thread : threads)
   {
      thread.join();
   }

   return 0;
}



#11550 Solaris - boost::call_once issues thread To Be Determined Bugs Aug 18, 2015

I compiled Boost 1.59.0 with Solaris Studio 12.4 in C++11 mode and I

get the following error messages:

"libs/thread/src/pthread/thread.cpp", line 144: Error: Overloading ambiguity between "boost::call_once<void(*)()>(boost::once_flag&, void(*)())" and "boost::call_once<void(&)()>(boost::once_flag&, void(&)())".
"libs/thread/src/pthread/thread.cpp", line 150: Error: Overloading ambiguity between "boost::call_once<void(*)()>(boost::once_flag&, void(*)())" and "boost::call_once<void(&)()>(boost::once_flag&, void(&)())".
"libs/context/src/posix/stack_traits.cpp", line 58: Error: Overloading ambiguity between "boost::call_once<void(&)(unsigned long*), unsigned long*>(boost::once_flag&, void(&)(unsigned long*), unsigned long*&&)" and "boost::call_once<void(*)(unsigned long*), unsigned long*>(boost::once_flag&, void(*)(unsigned long*), unsigned long*)".
"libs/context/src/posix/stack_traits.cpp", line 66: Error: Overloading ambiguity between "boost::call_once<void(&)(rlimit*), rlimit*>(boost::once_flag&, void(&)(rlimit*), rlimit*&&)" and "boost::call_once<void(*)(rlimit*), rlimit*>(boost::once_flag&, void(*)(rlimit*), rlimit*)".
"libs/coroutine/src/posix/stack_traits.cpp", line 56: Error: Overloading ambiguity between "boost::call_once<void(&)(unsigned long*), unsigned long*>(boost::once_flag&, void(&)(unsigned long*), unsigned long*&&)" and "boost::call_once<void(*)(unsigned long*), unsigned long*>(boost::once_flag&, void(*)(unsigned long*), unsigned long*)".
"libs/coroutine/src/posix/stack_traits.cpp", line 64: Error: Overloading ambiguity between "boost::call_once<void(&)(rlimit*), rlimit*>(boost::once_flag&, void(&)(rlimit*), rlimit*&&)" and "boost::call_once<void(*)(rlimit*), rlimit*>(boost::once_flag&, void(*)(rlimit*), rlimit*)".
"./boost/thread/once.hpp", line 38: Error: Overloading ambiguity between "boost::call_once<void(*)()>(boost::once_flag&, void(*)())" and "boost::call_once<void(*)()&>(boost::once_flag&, void(*)()&)".
"./boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp", line 145: Error: Overloading ambiguity between "boost::call_once<void(*)()>(boost::once_flag&, void(*)())" and "boost::call_once<void(&)()>(boost::once_flag&, void(&)())".
"./boost/spirit/home/classic/phoenix/closures.hpp", line 427: Error: Overloading ambiguity between "boost::call_once<void(*)()>(boost::once_flag&, void(*)())" and "boost::call_once<void(&)()>(boost::once_flag&, void(&)())".
"./boost/thread/once.hpp", line 38: Error: Overloading ambiguity between "boost::call_once<void(*)()>(boost::once_flag&, void(*)())" and "boost::call_once<void(*)()&>(boost::once_flag&, void(*)()&)".
"./boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp", line 145: Error: Overloading ambiguity between "boost::call_once<void(*)()>(boost::once_flag&, void(*)())" and "boost::call_once<void(&)()>(boost::once_flag&, void(&)())".
"./boost/thread/once.hpp", line 38: Error: Overloading ambiguity between "boost::call_once<void(*)()>(boost::once_flag&, void(*)())" and "boost::call_once<void(*)()&>(boost::once_flag&, void(*)()&)".
"./boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp", line 145: Error: Overloading ambiguity between "boost::call_once<void(*)()>(boost::once_flag&, void(*)())" and "boost::call_once<void(&)()>(boost::once_flag&, void(&)())".
"./boost/spirit/home/classic/phoenix/closures.hpp", line 427: Error: Overloading ambiguity between "boost::call_once<void(*)()>(boost::once_flag&, void(*)())" and "boost::call_once<void(&)()>(boost::once_flag&, void(&)())".
"./boost/thread/once.hpp", line 38: Error: Overloading ambiguity between "boost::call_once<void(*)()>(boost::once_flag&, void(*)())" and "boost::call_once<void(*)()&>(boost::once_flag&, void(*)()&)".
"./boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp", line 145: Error: Overloading ambiguity between "boost::call_once<void(*)()>(boost::once_flag&, void(*)())" and "boost::call_once<void(&)()>(boost::once_flag&, void(&)())".
"./boost/thread/once.hpp", line 38: Error: Overloading ambiguity between "boost::call_once<void(*)()>(boost::once_flag&, void(*)())" and "boost::call_once<void(*)()&>(boost::once_flag&, void(*)()&)".
"./boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp", line 145: Error: Overloading ambiguity between "boost::call_once<void(*)()>(boost::once_flag&, void(*)())" and "boost::call_once<void(&)()>(boost::once_flag&, void(&)())".

I'm not 100% sure whether these are compiler issues or Boost compiler configuration issues thus I decided to raise this ticket.


#12104 windows - Visual Studio 2015 Update 2 RC gives out warning C4191 in thread_primitive.hpp thread To Be Determined Bugs Mar 30, 2016
thread/win32/thread_primitives.hpp(312): warning C4191: 'type cast': unsafe conversion from 'boost::detail::win32::farproc_t' to 'boost::detail::win32::detail::gettickcount64_t'

Calling this function through the result pointer may cause your program to fail


#12773 WINDOWS- Boost thread 1.63.0 strict aliasing warnings thread To Be Determined Bugs Jan 19, 2017

I'm cross-compiling boost on Linux, having 32-bit mingw64 as a target.

I'm still seeing strict aliasing complaints on boost 1.63.0 thread/win32/shared_mutex.hpp.

As gcc 6 has even stricter aliasing rules, I'm afraid that these may be harmful, so I came up with the attached patch - which is ugly, but works.


#12795 thread library - thread_specific_ptr documentation gives obsolete recomendation thread To Be Determined Bugs Jan 27, 2017

thread_specific_ptr documentation says

Though compilers often provide this facility in the form of extensions to the declaration syntax (such as _declspec(thread) or thread annotations on static or namespace-scope variable declarations), such support is non-portable, and is often limited in some way, such as only supporting POD types.

Now as we have portable thread_local in current compilers, it should be prefered to use thread_local, since thread_specific_ptr has known performance limitation.


#5947 Use CLOCK_PROCESS_CPUTIME_ID on platform providing them chrono To Be Determined Feature Requests Sep 27, 2011

The posix implementation of process real cpu clock uses the times() function. The resolution is better if we use

::clock_gettime( CLOCK_PROCESS_CPUTIME_ID, &ts );

on platforms for which the CLOCK_PROCESS_CPUTIME_ID is supported.


#7333 Provide User-defined Literals for chrono durations on compilers supporting them chrono To Be Determined Feature Requests Sep 6, 2012

boost::chrono::duration suffixes h, min, s, ms, us, ns in namespace boost::suffixes::chrono


#7586 Add a testable_mutex thread Feature Requests Oct 28, 2012

Based on Associate Mutexes with Data to Prevent Races, By Herb Sutter, May 13, 2010 - http://www.drdobbs.com/windows/associate-mutexes-with-data-to-prevent-r/224701827?pgno=3

"Make our mutex testable if it isn't already.

Many mutex services (including boost::mutex) don't provide a way to ask, "Do I already hold a lock on this mutex?"

Sometimes it is needed to know if a method like is_held to be available.

This wrapper associates an arbitrary lockable type with a thread id that stores the ID of the thread that currently holds the lockable. The thread id initially holds an invalid value that means no threads own the mutex.

When we acquire a lock, we set the thread id; and when we release a lock, we reset it back to its default no id state."


#7589 Add polymorphic lockables thread Feature Requests Oct 28, 2012

Mutex are generic classes that work well when generic programming. Sometimes, in a OOP context, it is useful to be able to use polymorphically any model of a lockable.

A poly_lockable class that defines the lockable interface could be added as well as an poly_lockable_adapter to make any Lockable inherit from poly_lockable.


#7595 Implement interruptible threads on top of non-interruptible threads thread To Be Determined Feature Requests Oct 28, 2012

Once we will be able to disable thread interruption it would be great if we can provide interruptible threads on top of non-interruptible threads so that the user don't pay for what they don't use, but has yet a mechanism that allows work with interruptible and non-interruptible threads on the same executable.

See #7594 Allow to disallow thread interruptions


#7629 Implement the algorithm deadlock detection "lockdep" thread To Be Determined Feature Requests Nov 2, 2012

Implement the algorithm deadlock detection "lockdep" (http://ceph.com/dev-notes/lockdep-for-pthreads/)


#8094 hierarchical_mutex for lock hierarchies (to avoid deadlocks) thread To Be Determined Feature Requests Feb 17, 2013

It would be great if boost::thread could be extended with a "hierarchical" mutex to facilitate lock hierarchies. Lock hierarchies is a construct that associates mutexes with software layer numbers, and enforces the application to only lock "downwards" in the software hierarchy [1]. This effectively translates potential deadlocks into deterministic run-time failures that be detected during testing.

An example draft implementation is attached. The attachment also includes a BOOST_THREAD_LOCAL work-around for missing "thread_local" support that should probably be moved to more neutral ground.

[1] http://www.drdobbs.com/parallel/use-lock-hierarchies-to-avoid-deadlock/204801163


#8273 Add externally locked streams thread Feature Requests Mar 11, 2013

Based on N3354: C++ Stream Mutexes http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3354.html add thread safe streams that gets its protecting mutex externally instead of internally as in the proposal so that several streams can share the same protecting mutex.

This will be useful to take in account coherency when working with cout and cin.


#8514 Async: Add a thread_pool executor with work stealing. thread To Be Determined Feature Requests Apr 28, 2013

See #8513 for the basic thread_pool interface


#8517 Async: Add a variadic shared_future::then thread To Be Determined Feature Requests Apr 28, 2013
template<typename S, typename ...F>
shared_future<tuple<typename boost::result_of<F(shared_future&)>::type...>
future::then(S&, F&& func ...);

#9588 Add a parallel_invoke algorithm. thread To Be Determined Feature Requests Jan 18, 2014

Base on http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2012/n3429.pdf and TBB Intel library add a parallel_invoke algorithm.

The main difference is that the algorithm could take an Executor as parameter.


#9589 Add a parallel_sort algorithm. thread To Be Determined Feature Requests Jan 18, 2014

Base on http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2012/n3429.pdf and TBB Intel library add a parallel_sort algorithm.

The main difference is that the algorithm could take an Executor as parameter.


#9590 Add a parallel_reduce algorithm. thread To Be Determined Feature Requests Jan 18, 2014

Base on http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2012/n3429.pdf and TBB Intel library add a parallel_reduce algorithm.

The main difference is that the algorithm could take an Executor as parameter.


#9591 Add a parallel_for algorithm. thread To Be Determined Feature Requests Jan 18, 2014

Base on http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2012/n3429.pdf and TBB Intel library add a parallel_for algorithm.

The main difference is that the algorithm could take an Executor as parameter.


#9592 Add a parallel_for_each algorithm thread To Be Determined Feature Requests Jan 18, 2014

Base on http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2012/n3429.pdf and TBB Intel library add a parallel_for_each algorithm.

The main difference is that the algorithm could take an Executor as parameter.


#9599 Add a parallel_transform algorithm thread To Be Determined Feature Requests Jan 22, 2014

Base on http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2012/n3429.pdf and TBB Intel library add a parallel_transform algorithm.

The main difference is that the algorithm could take an Executor as parameter.


#10299 Add queue iterators thread To Be Determined Feature Requests Aug 2, 2014

As for http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3533.html#streaming_iterators add queue iterators.


#10301 Add shared_queue_front and shared_queue_back thread To Be Determined Feature Requests Aug 2, 2014

Based on http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3533.html#Managed add shared_queue_front and shared_queue_back.


#10316 Thread: add subscription operator if the value provide it. thread To Be Determined Feature Requests Aug 6, 2014

I would like to be able to do

    typedef boost::synchronized_value< boost::container::flat_map<int, int> > ValueIndex;
    
    ValueIndex index;
    index[0] = 1;

and would expect that last line to be equivalent to

    auto locked_index = index.synchronize();
    (*locked_index)[0] = 1;

I'm not totally sure it's possible to do but it would help.


#10424 future/shared_future::then() in case of continuation return an invalid future thread To Be Determined Feature Requests Aug 30, 2014

Add this behavior to future/shared_future::then()

  • In case of implicit unwrapping, the validity of the future returned from then cannot be established until after the completion of the functor passed into then. In such case, the resulting future becomes ready with an exception of type future_error, with an error code of future_errc::broken_promise.

#10550 Implicit unwrapping from then() calls thread To Be Determined Feature Requests Sep 27, 2014

Follows the Fundamental TS wording for ::then() function.


#10551 Make futures returned by then()/when_all/when_any don't block. thread To Be Determined Feature Requests Sep 27, 2014

Follows the Fundamental TS wording for ::then()/ when_all/when_any functions.


#10610 Add unwrap shared_future constructor thread To Be Determined Feature Requests Oct 5, 2014

Following N4123, add unwrap shared_future constructor

See also https://github.com/cplusplus/concurrency_ts/issues/58


shared_future(future<shared_future<R>>&& rhs) noexcept;

Effects:
    Constructs a shared_future object from the shared state referred to by rhs. The shared_future becomes ready when one of the following occurs:

        Both the outer future and the inner shared_future are ready. The shared_future inherits the value or the exception from the inner shared_future.
        The outer future is ready but the inner shared_future is invalid. The shared_future gets an exception of type std::future_error, with an error code of std::future_errc::broken_promise.

Postconditions:

        valid() returns the same value as rhs.valid() prior to the constructor invocation.
        valid() == true.
        rhs.valid() == false.



#10878 boost::thread::attributes -> no non-variadic-support thread To Be Determined Feature Requests Dec 16, 2014

In terms of applying thread attributes right now the documentation describes only this signature:

template<typename Callable> thread(attributes& attrs, Callable func);

but this does not work when variadics are not supported (leading to error: type 'boost::thread_attributes' does not provide a call operator)

Nevertheless, this temporaray way works out:

thread(attributes& attrs, boost::bind(Callable func));


#10914 Add a future::notify_when_ready function thread To Be Determined Feature Requests Jan 7, 2015

This function should help to implement a generic wait_for_any on models of Future.


#10915 Change wait_for_any to work on models of Future. thread To Be Determined Feature Requests Jan 7, 2015

Using notify_when_any implement a generic wait_for_any on models of Future.


#10916 Change wait_for_all to work on models of Future. thread To Be Determined Feature Requests Jan 7, 2015

#10966 packaged_task::reset should not reuse the shared state to conform to C++11 thread To Be Determined Feature Requests Jan 24, 2015

The standard says

void reset();
Effects: as if *this = packaged_task(std::move(f)), where f is the task stored in *this. [ Note: This constructs a new shared state for *this. The old state is abandoned (30.6.4). — end note ]
Throws:
— bad_alloc if memory for the new shared state could not be allocated.
— any exception thrown by the move constructor of the task stored in the shared state. 
— future_error with an error condition of no_state if *this has no shared state.

Boost.Thread reuse the shared state.

Effects: Reset the state of the packaged_task so that it can be called again. 

#11041 Add no_unit to duration_style. chrono To Be Determined Feature Requests Feb 17, 2015

When using Chrono I/O V2, currently there's no easy way to specify that only the numeric value of a duration without the unit should be output to a stream (equivalent of duration unit pattern "%v"). It would be useful to add a new enumerator, say 'no_unit', to duration_style enumeration, and a corresponding stream manipulator (e.g. 'no_unit_format').


#11052 Make all executors copyable pointing to a shared context thread To Be Determined Feature Requests Feb 20, 2015

Ensuring that the lifetime of an executor is longer than the continuations could be hard for the user.

In particular, the tests add a sleep for to ensure it. This is not robust enough.


#11264 Add variadic lock_guard of Lockables thread To Be Determined Feature Requests May 3, 2015

lock_guard works with BasicLockable.

In order the variadic version to avoid deadlock, it can work only with Lockable, as the use of lock forces it.


#11552 Warning from chrono that could helpfully be suppressed ratio Boost 1.60.0 Feature Requests Aug 18, 2015

Boost.Chrono is emitting warnings with GCC (5.1.0) that cannot be suppressed even using the following cxxflags in the user jamfile

      <toolset>gcc:<cxxflags>-Wno-deprecated-declarations
      <toolset>gcc:<cxxflags>-Wno-long-long
      <toolset>gcc:<cxxflags>-ftrack-macro-expansion=0 # Suppress note: in expansion of macro

and they are repeated on every compilation which is quite annoying when reading the log file.

For example:

gcc.compile.c++ ..\..\..\bin.v2\libs\timer\build\gcc-mingw-5.1.0\debug\link-static\auto_timers_construction.o
In file included from C:/Program Files/mingw-w64/x86_64-5.1.0-win32-seh-rt_v4-rev0/mingw64/lib/gcc/x86_64-w64-mingw32/5.1.0/include/stdint.h:9:0,
                 from ..\..\../boost/cstdint.hpp:60,
                 from ..\..\../boost/ratio/config.hpp:13,
                 from ..\..\../boost/ratio/ratio.hpp:35,
                 from ..\..\../boost/chrono/duration.hpp:41,
                 from ..\..\../boost/chrono/chrono.hpp:11,
                 from ..\..\../boost/timer/timer.hpp:14,
                 from ..\..\..\libs\timer\src\auto_timers_construction.cpp:23:
..\..\../boost/chrono/system_clocks.hpp:77:111: warning: use of C++11 long long integer constant [-Wlong-long]
 # define BOOST_SYSTEM_CLOCK_DURATION

boost::chrono::duration<boost::int_least64_t, ratio<BOOST_RATIO_INTMAX_C(1), BOOST_RATIO_INTMAX_C(10000000)> >
                                                                                                               ^
..\..\../boost/chrono/system_clocks.hpp:77:90: note: in expansion of macro 'BOOST_RATIO_INTMAX_C'
 # define BOOST_SYSTEM_CLOCK_DURATION boost::chrono::duration<boost::int_least64_t, ratio<BOOST_RATIO_INTMAX_C(1), BOOST_RATIO_INTMAX_C(10000000)> >

and more...

It would be nice if the user would not see these (spurious?) warnings.


#11717 Associate an Executor used to launch the continuation to a promise/packaged_task constructor. thread To Be Determined Feature Requests Oct 10, 2015

Currently we have async function that constructs futures associated to an Executor.

The then() member function should use this executor to launch the continuation. See #11716.

But futures can also have other sources, as e.g. a promise or a packaged_task. This paper proposes the addition of Executor aware constructors for promise<T> and packaged_task<R(Args)> so that the continuation on the associated future make use of this executor.

We propose to:

  • Add promise<T>::promise<T>(Executor&) Executor aware constructor.
  • Add packaged_task<R(Args...)>::packaged_task(Executor&) Executor aware constructor.

#11773 Extract close/closed to a more specific shutdonw-executor interface. thread To Be Determined Feature Requests Oct 29, 2015

#11774 Extract try_executing_one, reschedule_until to a more specific reentrant executor interface. thread To Be Determined Feature Requests Oct 29, 2015

#12416 Windows: shared_mutex::state_data exceptions thrown in synthetic tests thread To Be Determined Feature Requests Aug 28, 2016

Hi, My name is Tomer Gal.

We have created synthetic benchmarks in which we create many threads. This causes shared_mutex to throw an exception when it has more than 2047 waiting threads due to the following limits:

struct state_data {

unsigned shared_count:11,

shared_waiting:11, exclusive:1, upgrade:1, exclusive_waiting:7, exclusive_waiting_blocked:1;

Obviously, creating more than 2047 threads waiting for a lock is too much for 'normal' code... however, the boost library shouldn't be the limiting factor for such a usage in my opinion.

The state_data is currently limited to the size of(long) which is 32 bits, and it looks like it could be increased to 64 bits.

Could this be fixed?

Regards, Tomer Gal, CTO at OpTeamizer


#11619 Chrono V2 IO - format tags 'unsupported'? chrono To Be Determined Support Requests Sep 4, 2015

http://www.boost.org/doc/libs/1_59_0/doc/html/chrono/reference.html#chrono.reference.io.ios_state_hpp.sag.set_time_fmt

table 6.3 on the page linked above describes format tags to be used with IO. Several are listed as unsupported. There is no explanation of what 'unsupported' means. Does it mean a format string with one of those tags will cause an exception? Will the format tag be ignored? Will the entire format string fail to work? Will interation over the string stop before or after the 'unsupported' tag? More explanation would be helpful here.


#11633 chrono IO V1 may throw bad_cast chrono To Be Determined Support Requests Sep 9, 2015

I had occurences of chrono io throwing bad_cast exceptions, which lead to backtraces like this one:

    #0  0x00007ffff54fda30 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    #1  0x00007ffff554f2a2 in std::__throw_bad_cast() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    #2  0x00007ffff2289bab in std::use_facet<boost::chrono::duration_punct<char> > (__loc=...) at /usr/include/c++/4.8/bits/locale_classes.tcc:137
    #3  0x00007ffff2288c61 in boost::chrono::operator<< <char, std::char_traits<char>, boost::rational<int>, boost::ratio<1l, 1l> > (os=..., d=...) at /home/sbarthelemy/.local/share/qi/toolchains/linux64/boost/include/boost/chrono/io_v1/chrono_io.hpp:210

I think the attached minimal example reproduces the issue.

Here the compile & run log using boost 1.58

$ make clean && make test
rm -f src/*.o src/chrono_io
clang++ -std=c++11 -c -g -fPIC -Iinclude -I/usr/include -o src/chrono_io.o src/chrono_io.cc
clang++ -std=c++11 -rdynamic -Lsrc -o src/chrono_io src/chrono_io.o -lboost_chrono -lboost_system -lpthread -L/usr/lib/x86_64-linux-gnu
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu ./src/chrono_io
terminate called after throwing an instance of 'std::bad_cast'
  what():  std::bad_cast
Aborted (core dumped)
Makefile:13: recipe for target 'test' failed
make: *** [test] Error 13

Here is the code around boost/include/boost/chrono/io_v1/chrono_io.hpp:210

template <class CharT, class Traits, class Rep, class Period>                  
std::basic_ostream<CharT, Traits>&                                             
operator<<(std::basic_ostream<CharT, Traits>& os, const duration<Rep, Period>& d)
{                                                                              
    typedef duration_punct<CharT> Facet;                                       
    std::locale loc = os.getloc();                                             
    if (!std::has_facet<Facet>(loc))                                           
        os.imbue(std::locale(loc, new Facet));                                 
    const Facet& f = std::use_facet<Facet>(os.getloc()); //<<<<<<< line210, throw here
    return os << d.count() << ' ' << f.template name<Period>(d.count());       
}

maybe we could avoid calling os.getloc() again at line 210 to avoid the race?


#11639 document std's vs boost's chrono::steady_clock system-wideness discrepancy chrono To Be Determined Support Requests Sep 10, 2015

boost doc states that its steady_clock is system-wide, in doc/libs/1_59_0/doc/html/chrono/reference.html#chrono.reference.cpp0x.system_clocks_hpp.steady_clock

steady_clock class provides access to the system-wide steady clock.
The current time can be obtained by calling steady_clock::now().
There is no fixed relationship between values returned by
steady_clock::now() and wall-clock time. 

As far as I know, the C++11 standard does not make this requirement.

It would be good to highlight this discrepancy in the doc, especially since the doc "Included on the C++11 Recommendation" section let's you think that boost's chrono and std's chrono are interchangeable.


#13408 Boost Library Possible memory Leak thread To Be Determined Support Requests Jan 19, 2018

Hi,

We have been using Boost library in the project. I've made analysis by using Valgrind tool to be able to find possible memory leaks. According to the result, there is a memory leak in Boost library.

==7535== 24 bytes in 1 blocks are still reachable in loss record 2 of 6
==7535==    at 0x4C2B0E0: operator new(unsigned long)
(vg_replace_malloc.c:324)
==7535==    by 0x4E430A3: boost::detail::make_external_thread_data()
(in /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.55.0)
==7535==    by 0x4E433DB: boost::detail::add_new_tss_node(void const*,
boost::shared_ptr<boost::detail::tss_cleanup_function>, void*)
(in /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.55.0)
==7535==    by 0x4E4408C: boost::detail::set_tss_data(void const*,
boost::shared_ptr<boost::detail::tss_cleanup_function>, void*, bool)
(in /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.55.0)
==7535==    by 0x54CAC0C:
boost::log::v2_mt_posix::core::add_thread_attribute(boost::log::v2_mt_posix::attribute_name const&, boost::log::v2_mt_posix::attribute const&)

It seems like the allocated memory is not deallocated, so it causes memory leak. Here is the definition of relevant event ;

       thread_data_base* make_external_thread_data()
        {
            thread_data_base* const
me(detail::heap_new<externally_launched_thread>());
            me->self.reset(me);
            set_current_thread_data(me);
            return me;
        }


        thread_data_base* get_or_make_current_thread_data()
        {
            thread_data_base*
current_thread_data(get_current_thread_data());
            if(!current_thread_data)
            {
                current_thread_data=make_external_thread_data();
            }
            return current_thread_data;
        }

I've made some research if there is any post which states that this event causes memory leak, but could not find any. Is there any fix for the problem stated above? If there is any, could you please state the relevant patch ?

Thanks in advance,

Kind Regards


#13599 condition_variable::timed_wait never returns thread To Be Determined Support Requests Jun 14, 2018

boost::condition_variable::timed_wait never returns if compiled with -DBOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC.

this_thread::sleep and thread::timed_join exhibit the same problem, but both these functions are documented as deprecated. However condition_variable::timed_wait is not documented as deprecated.

This can be worked around by using condition_variable::wait_for.

The following simple test program demonstrates the problem in that it hangs forever. Removing the #define makes it return after one second.

#define BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC

#include <boost/thread.hpp>
#include <iostream>

int main( int argc, char* argv[] )
{
    boost::condition_variable cv;
    boost::mutex m;
    boost::mutex::scoped_lock lock( m );

    cv.timed_wait( lock, boost::posix_time::seconds( 1 ) );
    std::cout << "wait_for has returned" << std::endl;

    return 0;
}

#11252 make make_ready_future more efficient thread To Be Determined Tasks Apr 29, 2015

this function should be more efficient using a specific shared_state constructor.


#11798 Implementation of boost::shared_mutex on POSIX is suboptimal thread To Be Determined Tasks Nov 16, 2015

The current (as of boost 1.59) implementation of boost::shared_mutex for 'pthread' is pretty suboptimal as it's using a heavyweight mutex to guard the internal mutex state. This is more evident when shared locks are used to guard state whose access concurrency is high, due to contention on the mutex state lock (in these cases, the shared mutex is effectively exclusive). In comparison, the 'win32' implementation uses lightweight spinlocks underneath.

There are a couple options to fix this for 'pthread', e.g. using a spinlock or leveraging pthreads_rwlock. I'm happy to provide with an initial patch for this.


#12433 Make use of make_shared whenever possible in future.hpp thread To Be Determined Tasks Sep 3, 2016

Even if boost::make_shared is not aware of Boost.Move there are a lot of places in future.hpp where make shared could be used and improve the performances.


Vladimir Prus (3 matches)

#2438 gcc.jam sets LD_LIBRARY_PATH which breaks FreeBSD build build Boost 1.42.0 Bugs Oct 27, 2008

In build/tools/v2/tools/gcc.jam we are setting the LD_LIBRARY_PATH for compilation to:

/usr/bin:/usr/lib:/usr/lib32:/usr/lib64

Couple of points:

  • /usr/bin (?) :D
  • /usr/lib on FreeBSD does not contain major number libs so most if not all binaries will not pick up anything from here
  • /usr/lib32 on FreeBSD DOES CONTAIN major number libs so if you are building on 32-bit this will work, HOWEVER if you are building 64-bit then this will cause failures
  • /usr/lib64 does not exist on FreeBSD (I believe this is a Linux thing)

Based on the comments within gcc.jam I FEEL as do some other people (see thread reference) that if bjam is *really* going to rely on rtld then it should do so by NOT setting anything to LD_LIBRARY_PATH which many have pointed out is only to be used when the standard search path is not enough. Setting this PATH is very dangerous and for 99% of the build cases, rtld does the right thing.

Thread:

http://www.nabble.com/Boost-1.36.0-FreeBSD-patches-for-review-td20143328.html

If it is decided to set LD_LIBRARY_PATH then we need to make this OS specific and unset it for FreeBSD (or minimally add back /lib which Steven pointed out in the above thread is probably not the right solution given LD_LIBRARY_PATH's semantics).


#2732 boost bjam install respects umask build Boost 1.38.0 Bugs Feb 5, 2009

Using bjam to install boost 1.37 the install procedure respects the current umask of the user.

This is not the expected behaviour. Other software install routines usually make sure to set the file modes explicitly (for example they use the unix program 'install').

Thus, if you have a umask like 0077 you have by default a boost installation which is only readable by yourself. Again, no other 'make install' or such command behaves like this.

I used this command line to install boost under Solaris 10: ./tools/jam/src/bin.solaris/bjam -sICU_PATH=/usr --user-config=user-config.jam --with-test --with-program_options address-model=64 -d3 --prefix=myprefix install


#3550 specify toolset to bootstrap.bat Building Boost Boost 1.46.0 Bugs Oct 23, 2009

Hi,

calling "bootstrap.bat" results in successful compilation of boost_1_40_0\tools\jam\src\bin.ntx86_64\bjam.exe but this is not where the bootstrap.bat expects it to be, as it only supports x86 as it seems.

BTW: tools\jam\src\build.bat somehow finds my VS2010beta and uses that for compilation (although I'd like it to use my production VS9) and it seems I have no control of telling "bootstrap.bat" to use a custom toolset (this is supported by build.bat)

cheers Chris


1 2 3
Note: See TracReports for help on using and creating reports.