-
Notifications
You must be signed in to change notification settings - Fork 396
Description
It seems that enabling various STL debug features that change the ABI of standard data types might break accessing these types from the Rust side. Perhaps this is to be expected, but it did caught me by surprise. I used gcc to reproduce the issue, using the latest cxx version 1.0.191.
Here is a simple example that introduces a obtain_vector function, which returns a vector from the C++ side to the Rust side (via a UniquePtr<CxxVector<usize>> construction). Furthermore, it prints the values contained the in the vector on both sides. When running this example with the build.define calls in build.rs commented out we see the results I expect:
contains: 1
Obtained [1]
However, when running it with the various _LIBCPP_DEBUG_XXX and _GLIBCXX_DEBUG defines enabled I instead see the following output.
contains: 1
Obtained []
This also does not cause any segfaults or errors reported by AddressSanitizer.