Skip to content

implemented the changes for P4453 - #349

Draft
dietmarkuehl wants to merge 7 commits into
mainfrom
implement-p4453
Draft

dietmarkuehl wants to merge 7 commits into
mainfrom
implement-p4453

Conversation

@dietmarkuehl

Copy link
Copy Markdown
Member

No description provided.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 92.918% (-0.07%) from 92.992% — implement-p4453 into main

@Cra3z

Cra3z commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

TSan isn't aware that the reference counting for std::exception_ptr is atomic. Looks like we should set up TSAN_OPTIONS to suppress these false positives.

@dietmarkuehl

Copy link
Copy Markdown
Member Author

TSan isn't aware that the reference counting for std::exception_ptr is atomic. Looks like we should set up TSAN_OPTIONS to suppress these false positives.

I see that exec-parallel-scheduler.test.cpp uses task<int>: I wonder if that is actually rather a case of the issue which is supposed to be prevented by the new Remarks, i.e., an already destroyed object ends up being used? I didn't change anything with respect to that, yet, i.e., I didn't change task to destroy the held scheduler before completing. I haven't looked at the issue properly, yet.

@Cra3z

Cra3z commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

From the call stack reported by TSan, the problem occurs at

try {
test_std::sync_wait(test_std::schedule(sch) | test_std::then([] { throw 114; }));
} catch (int n) {
ASSERT(n == 114);
}
, which should have nothing to do with this PR. I also encountered this TSan error during CI testing on my previous PR, and sometimes it just passes on retry. This is related to std::exception_ptr being used across threads (one thread catches an exception and gets its exception_ptr using std::current_exception, and then another thread rethrows it with std::rethrow_exception; even if the former is guaranteed to happen before the latter, TSan may still report an error under Clang + libc++, as TSan doesn't know that decrementing the reference count in __cxa_end_catch in libc++abi.so is atomic).
repro: https://godbolt.org/z/rvdqexrr3

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants