Bug 2211211
| Summary: | clang TSA cannot guard sibling struct fields in C | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Stefan Hajnoczi <stefanha> |
| Component: | clang | Assignee: | Tom Stellard <tstellar> |
| Status: | CLOSED MIGRATED | QA Contact: | qe-baseos-tools-bugs |
| Severity: | unspecified | Docs Contact: | |
| Priority: | high | ||
| Version: | 9.2 | CC: | jchecahi, kwolf, mprchlik, pbonzini, scoady, sipoyare, tbaeder, tstellar |
| Target Milestone: | rc | Keywords: | MigratedToJIRA, Triaged |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-08-25 00:39:47 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Stefan Hajnoczi
2023-05-30 18:28:43 UTC
The reproducer warns in C++: https://godbolt.org/z/qfYjsKzoG (where using this->lock works). Is the missing support for referencing struct members in C the only problem in the reproducer or are there other ones? What's needed to make the reproducer not warn? Ah, I get it. In C++, member functions work, and in C, release_capability(f->lock) etc. works. (In reply to Timm Bäder from comment #1) > The reproducer warns in C++: https://godbolt.org/z/qfYjsKzoG (where using > this->lock works). Is the missing support for referencing struct members in > C the only problem in the reproducer or are there other ones? What's needed > to make the reproducer not warn? I think the warning you're seeing is the expected result for the code above because the pthread lock functions don't have TSA annotations. In clean code, you should probably use separate wrapper functions if you created a new lock type with typedef, but as a quick hack to make the warning go away, adding these declarations is enough for me: int pthread_mutex_lock(mutex *mutex) __attribute__((acquire_capability(*mutex))); int pthread_mutex_unlock(mutex *mutex) __attribute__((release_capability(*mutex))); This bug is about to be migrated to the RHEL project in JIRA. Once done, this bug should automatically be closed with a reference link to the new JIRA. Please continue any conversations there. For any questions, you can contact either me or Timm Bäder. Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug. This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there. To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer. You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like: "Bugzilla Bug" = 1234567 In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. |