commit | b7393c0bb202d59455e5fc3d4428ea9b9c8d0a51 | [log] [tgz] |
---|---|---|
author | Aaron Green <aarongreen@google.com> | Tue Dec 12 15:33:20 2023 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Dec 12 15:33:20 2023 +0000 |
tree | a6c31d32d3100234d278e26aeab6405f533e7ddc | |
parent | 8616c571bcec99c28746e49d87754d3972030913 [diff] |
pw_containers: Fix IntrusiveList::Item move assignment test This CL revisits the move assignment operator added to `intrusive_list_impl::List::Item`. This operator allows storing the backing items, which are not owned in a list, in a `Vector` that can be moved. The test for this assignment operator exposed a latent bug in `pw::Vector`'s destructor. The call to `clear` in the base vector class occurs after the derived vector's destructor has invalidated the items' memory. Thus, if an element references its own memory in its destructor, as `IntrusiveList::Item`s do, then letting a vector with elements fall out of scope will trigger a use-after-dtor MSAN bug. This vector bug is tracked by b/313899658. Several tests are added that test move operators with `std::array`s instead of `Vector`s. A `Vector` test is retained, since that use case is needed for FuzzTest. It has been updated to explicitly clear the vector. Bug: b/303634979 Change-Id: I132756dc25e4d14f8e8e30868f13f3208a260b38 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/182951 Reviewed-by: Taylor Cramer <cramertj@google.com> Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> Commit-Queue: Aaron Green <aarongreen@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.