[Bug libstdc++/59603] std::random_shuffle tries to swap element with itself
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 12 11:45:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59603
--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jörg Richter from comment #2)
> Seems like we have hit this bug too. It happens not only in debug mode. We
> have a testcase that triggers valgrind errors in non-debug mode while
> calling random_shuffle. I can try to reduce this testcase if it would help.
Would you be able to provide such a test? self-move in non-debug mode should
not cause valgrind errors, it should just cause the vector to be left empty (so
the valgrind errors might come later if you assume the vector still contains
data and try to access it).
More information about the Gcc-bugs
mailing list