You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The unit test Variant_test fails with the most recent version of boost 1.73.0 in the unpack_pair test. The const std::vector<Variant> &v passed to unpack_pair (Variant.hpp:79) contains garbage. :)
The reason is some fancy template gone wrong in the script interface. Compiler warning:
[...]
/home/hirschsn/esp/espresso-add/src/script_interface/constraints/initialize.cpp:67:79: required from here
/home/hirschsn/esp/espresso-add/src/script_interface/Variant.hpp:75:29: warning: narrowing conversion of ‘(double)pair.std::pair<int, double>::second’ from ‘double’ to ‘boost::enable_if_c<true, bool>::type’ {aka ‘bool’} [-Wnarrowing]
75 | return {{pair.first, pair.second}};
| ~~~~~^~~~~~
Latest ESPResSo python branch.
Edit: Forgot to mention: Of course, with boost 1.72.0 everything works fine.
The text was updated successfully, but these errors were encountered:
Thanks for bringing our attention to this issue. Boost 1.73 will be shipped with Fedora 33, which will start rebuilding all packages including espressomd on July 22. I can maybe have a look next week.
Just tried it with boost 1.73 on Ubuntu 20.04 with espresso 4.2-dev and 4.1.2. The Variant test fails because the pair is serialized into a vector of size 1. I originally also got random values as I forgot to add boost::get<T>() when printing the first value of the vector. The second value is uninitialized memory, so it can only be random.
The double brace expression return {{pair.first, pair.second}}; instantiates a vector of 1 Variant with underlying type int instead of a vector of 2 Variants with underlying types int and double, therefore unpack_pair() accesses memory out of bounds when fetching the second element. That's an easy fix, PR is coming.
The unit test
Variant_test
fails with the most recent version of boost 1.73.0 in theunpack_pair
test. Theconst std::vector<Variant> &v
passed tounpack_pair
(Variant.hpp:79) contains garbage. :)The reason is some fancy template gone wrong in the script interface. Compiler warning:
Latest ESPResSo python branch.
Edit: Forgot to mention: Of course, with boost 1.72.0 everything works fine.
The text was updated successfully, but these errors were encountered: