This revision has been moved into GH: https://github.com/llvm/llvm-project/pull/72677
Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Tue, Dec 5
Aug 1 2023
Jul 24 2023
I changed order to avoid suggesting that std::deque has annotations not for all allocators.
Thx for fast review!
Jul 21 2023
Jul 20 2023
Jul 19 2023
CI rerun and rebase.
I also don't think the issue is related to the patch.
Jul 18 2023
Rebase and suggested changes.
Jul 14 2023
Jul 13 2023
This update removes __grow_by from _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST in libcxx/include/__string/extern_template_lists.h.
Jul 12 2023
This patch reverts previous attempt and is fixing the preoblem.
Jul 11 2023
Testing a potential fix.
Jul 10 2023
To test the issue on CI, this update does:
- add _LIBCPP_SUPPRESS_DEPRECATED_PUSH and _LIBCPP_SUPPRESS_DEPRECATED_POP to not duplicate code.
Jul 6 2023
Removing std::__debug_db_invalidate_all(this); from __grow_by_without_replace as it was removed form __grow_by.
A fix for rebase.
Jul 5 2023
- applies comment change suggested by @ldionne (thank you!),
- resolves conflicts.
Jun 30 2023
Jun 28 2023
Jun 26 2023
I hope I fixed everything requested, cannot find anything else to fix. I hope this time it landed for the last time...
I see buildbot failures, but I don't see how my patch may be the cause (one, two).
Jun 22 2023
Jun 21 2023
Updating libcxx/include/__config in response to _LIBCPP_FUNC_VIS removal.
Jun 20 2023
Jun 14 2023
This update improves a comment.
This update adds tests for the patch.
- Test for different allocators.
- Test confirming that turning off annotations work.
Jun 13 2023
As suggested, this update:
- reverts changes in libcxx/include/__string/extern_template_lists.h,
- in a comment, describes the bug and explains why the function is preserved,
- adds _LIBCPP_HIDE_FROM_ABI to __grow_by_without_replace (),
- removes changes in libcxx/lib/abi.
Jun 12 2023
Jun 10 2023
To the best of my knowledge, that implementation is correct.
- The same value as in __grow_by_and_replace.
- D132769 is working with that patch.
- I tested it with more than unit tests.
- fixes annotations after changes in D148693,
- does rebase.
Jun 9 2023
- removes XFAIL as the test should always pass,
- removes _LIBCPP_ENABLE_ASSERTIONS=1 because ASan assertions are catched anyway.
Rebase, I hope it will fix the issue with the fail on MacOS.
Jun 7 2023
Jun 6 2023
rebase, I hope it fixes the CI fail (doesn't look like issue made by this revision).
This update fixes a naming issue.
Jun 1 2023
This update renames the new test and updates it slightly.
This updates the base commit.
This update changes how __annotate_delete() for an empty container is executed and makrs two functions as const.
It solves issues with non-standard allocators.
- adds a test suggested by @vitalybuka (extended to do that kind of caterpillar from every side),
- removes the issue,
- reimplementes __annotate_whole_block (last arguments removed; no longer calling __annotate_from_to).
May 31 2023
This update (hopefully) brings back old behavior of deque with const elements.
Because D132092 got reverted, I will include that change there.
May 30 2023
This update resolves merge conflicts with new head.
Ok, I just learned that deque objects have to be assignable/movable, so std::deque<const int> is not correct (from what I understand). Therefore tests for it cannot exist. But it's not my intention to change behavior of std::deque<const T> and therefore I created D151777. The new patch adds a few const. All examples working previously seem to work with D151777, but I found some not working even before this patch.
@alexfh it's not by design. A const_cast is missing (or should I use (void *)?). We may add it in the very place where error happens or later before calling API, but type has to be changed here.
May 24 2023
This update resolves merge conflicts with the new head commin on the main branch.
I hope I understood all comments. I'm in the middle of testing right now.
This update fixes issues mentioned in the code review:
- adds _LIBCPP_DEPRECATED_("use __grow_by_without_replace"),
- adds _LIBCPP_HIDE_FROM_ABI_AFTER_V1,
- changes deprecated call to __grow_by in __grow_by_without_replace with a copy-paste code of the function.
- in libcxx/include/__string/extern_template_lists.h removes references to __grow_by and __grow_by_without_replace,
- clang-format, I hope this time I used the correct config!
May 17 2023
May 14 2023
This update fixes the issue with incorrect arguments during deque annotations. Now the patch should work without a problem after landing.
I have a hard time trying to create a stand alone test.
To go to the problematic if branch, push_back should be called when:
- __back_spare() == 0
- __front_spare() < __block_size
- __map_.size() < __map_.capacity()
- __map_.__back_spare() == 0
Should I change something?
May 7 2023
It looks like the problem was created when I added __annotate_whole_block. Example buildbot output relevant for this revision: https://lab.llvm.org/buildbot/#/builders/5/builds/33480/steps/13/logs/stdio
==296484==ERROR: AddressSanitizer: bad parameters to __sanitizer_annotate_double_ended_contiguous_container: storage_beg : 0x6210000d0d00 storage_end : 0x6210000d1d00 old_container_beg : 0x6210000d1b40 old_container_end : 0x6210000d1d00 new_container_beg : 0x6210000d1b40 new_container_end : 0x6210000d0d00 #0 0x56178e14cac5 in __sanitizer_annotate_double_ended_contiguous_container /b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/asan/asan_poisoning.cpp:499:5 #1 0x56178efd3474 in __annotate_double_ended_contiguous_container /b/sanitizer-x86_64-linux-fast/build/libcxx_build_asan/include/c++/v1/deque:893:13 #2 0x56178efd3474 in __annotate_from_to /b/sanitizer-x86_64-linux-fast/build/libcxx_build_asan/include/c++/v1/deque:991:13 #3 0x56178efd3474 in __annotate_whole_block /b/sanitizer-x86_64-linux-fast/build/libcxx_build_asan/include/c++/v1/deque:1037:9 #4 0x56178efd3474 in std::__1::deque<std::__1::pair<std::__1::function<void ()>, llvm::ThreadPoolTaskGroup*>, std::__1::allocator<std::__1::pair<std::__1::function<void ()>, llvm::ThreadPoolTaskGroup*>>>::__add_back_capacity() /b/sanitizer-x86_64-linux-fast/build/libcxx_build_asan/include/c++/v1/deque:2233:13 #5 0x56178efd1aaf in std::__1::pair<std::__1::function<void ()>, llvm::ThreadPoolTaskGroup*>& std::__1::deque<std::__1::pair<std::__1::function<void ()>, llvm::ThreadPoolTaskGroup*>, std::__1::allocator<std::__1::pair<std::__1::function<void ()>, llvm::ThreadPoolTaskGroup*>>>::emplace_back<std::__1::pair<std::__1::function<void ()>, llvm::ThreadPoolTaskGroup*>>(std::__1::pair<std::__1::function<void ()>, llvm::ThreadPoolTaskGroup*>&&) /b/sanitizer-x86_64-linux-fast/build/libcxx_build_asan/include/c++/v1/deque:1596:9 [...]
May 5 2023
May 4 2023
This update fixes an issue with name shadowing and hopefully resolves all CI problems.
Rebase to HEAD of master.
May 3 2023
This update the base commit.
This update solves the merge conflict with the newest commit.