This is an archive of the discontinued LLVM Phabricator instance.

make a debug check thread-safe
AbandonedPublic

Authored by llunak on Apr 5 2022, 2:13 PM.

Diff Detail

Event Timeline

llunak created this revision.Apr 5 2022, 2:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2022, 2:13 PM
llunak requested review of this revision.Apr 5 2022, 2:13 PM
JDevlieghere accepted this revision.Apr 5 2022, 11:42 PM
JDevlieghere added a subscriber: JDevlieghere.

LGTM

This revision is now accepted and ready to land.Apr 5 2022, 11:42 PM
urnathan requested changes to this revision.EditedApr 6 2022, 4:27 AM

you need to modify the original in libcxxabi/src/demangle and then run the cp script there. Thanks for spotting this!

ETA:but it doesn't matter whether this check runs multiple times, in racing threads? I guess one wants an atomic set though. The once-only bits you've added are probably not available in libcxxabi?

This revision now requires changes to proceed.Apr 6 2022, 4:27 AM

ETA:but it doesn't matter whether this check runs multiple times, in racing threads? I guess one wants an atomic set though.

AFAICT the problem is only that it causes warnings from thread-sanitizer, there is no actual problem as such. I don't know if an atomic set would help (@JDevlieghere can you try please?). But even if, I presume it's not available in libcxxabi either if once isn't?

The once-only bits you've added are probably not available in libcxxabi?

I have no idea about libcxxabi. I'm relatively unfamiliar with LLVM, I've just created this PR because the warning got mentioned as triggered by code in my other PR and I thought this would be a simple fix. If it isn't, then I probably don't know how to do better here.

ETA:but it doesn't matter whether this check runs multiple times, in racing threads? I guess one wants an atomic set though.

AFAICT the problem is only that it causes warnings from thread-sanitizer, there is no actual problem as such. I don't know if an atomic set would help (@JDevlieghere can you try please?). But even if, I presume it's not available in libcxxabi either if once isn't?

ah, that explains it. I didn't want to expose the array outside of the lookup function, but that would be another solution. Then a unit test can test it.

The once-only bits you've added are probably not available in libcxxabi?

I have no idea about libcxxabi. I'm relatively unfamiliar with LLVM, I've just created this PR because the warning got mentioned as triggered by code in my other PR and I thought this would be a simple fix. If it isn't, then I probably don't know how to do better here.

understood. Mind if I grab the PR? (Is there an actual PR to grab?)

understood. Mind if I grab the PR? (Is there an actual PR to grab?)

No, sorry, I meant Phabricator D's. Thank you for taking care of this.

llunak abandoned this revision.Apr 8 2022, 10:40 AM