Modify

Ticket #3076 (closed Bugs: fixed)

Opened 5 years ago

Last modified 5 years ago

[multi_index] assertion failure sorting an empty collection in VC10 Beta 1

Reported by: Richard Webb <richard.webb@…> Owned by: joaquin
Milestone: Boost 1.40.0 Component: multi_index
Version: Boost 1.38.0 Severity: Problem
Keywords: Cc:

Description

The Bimap 'test_bimap_sequenced' test is failing in VC10 beta due to an assertion failure ( http://tinyurl.com/qwczko), but the actual problem seems to be in multi_index.

When you run the sample:

using namespace boost::multi_index;

typedef multi_index_container<
  std::string,
  indexed_by<
    random_access<>
  >
> text_container;


int _tmain(int argc, _TCHAR* argv[])
{
	text_container tc;
	tc.sort();

	return 0;
}

the call to std::copy on line 190 of rnd_index_ops.hpp passes NULL as the third parameter (&*buf). The VC10 version of copy asserts if the 3rd param is NULL, causing the failure.

Attachments

Change History

comment:1 Changed 5 years ago by joaquin

  • Status changed from new to closed
  • Resolution set to fixed

(In [53246]) fixed #3076

comment:2 Changed 5 years ago by joaquin

Hi Richard,

Thanks for reporting this bug. I've just commited a fix:

 https://svn.boost.org/trac/boost/changeset/53246

I'd appreciate if you can have keep an eye on this to make sure the problems in bimap eventually disappear.

There's one thing in your description of the problem that puzzles me a bit: you say that std::copy asserts because the third parameter is NULL, yet it seems to me that it's entirely ok to invoke

std::copy(first,last,NULL);

as long as first==last and consequently NULL is not dereferenced. Can you provide me with more info on the kind of assertion failure you're seeing? Can't it rather be the expression &*buf that is failing?

comment:3 Changed 5 years ago by Richard Webb <richard.webb@…>

In VC9, the copy code does the check

_DEBUG_RANGE(_First, _Last); if (_First != _Last)

_DEBUG_POINTER(_Dest);

Wheras VC10 just does

_DEBUG_RANGE(_First, _Last); _DEBUG_POINTER(_Dest);

(Where _DEBUG_POINTER gives an error if _Dest is NULL). So VC9 only complains if Dest is null and theres something to do, but VC10 gives you an error any time it's null.

comment:4 Changed 5 years ago by anonymous

I see. I'm not entirely sure the VC10 checking is conformant, so I've posted a query to comp.std.c++:

 http://tinyurl.com/ouut5e

Let's see what the gurus say.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.