[Bug libstdc++/61107] stl_algo.h: std::__inplace_stable_partition() doesn't process the whole data range

Jonathan Wakely jwakely@redhat.com
Mon Nov 10 21:49:00 GMT 2014


On 10/11/14 21:50 +0100, François Dumont wrote:
>Any news about this one ?
>
>Here is another version with additional random tests on algos just to 
>challenge other combinations of tests.
>
>    PR libstdc++/61107
>    * include/bits/stl_algo.h (__inplace_stable_partition): Delete.
>    (__stable_partition_adaptive): Return __first is range length is 1.

The first "is" should be "if".

The change to stl_algo.h looks OK.

I don't like the use of mt19937 in the tests, I know you committed a
test I wrote recently that uses mt19937, but that was only meant to
demonstrate the bug for bugzilla, not necessarily as the final test.

The PRNG produces the exact same sequence of numbers every time (when
you don't seed it) so if you can make the test fail using a few
iterations with the PRNG then you can find the input that fails and
just add that input to the testsuite. I didn't do that for the test I
put in bugzilla because I didn't have time to work out which input
caused the memory leak, only that it leaked for *some* easily
reproducible input. I wasn't trying to start a trend where we use
fixed sequences of pseudorandom numbers in lots of tests.



More information about the Gcc-patches mailing list