Details
Diff Detail
- Repository
- rCRT Compiler Runtime
Event Timeline
lib/tsan/rtl/tsan_debugging.cc | ||
---|---|---|
89 | Why return 1? What does that mean? | |
lib/tsan/rtl/tsan_interface.h | ||
122 | There's no documentation on the meaning of the arguments or the return value here. | |
test/tsan/Darwin/external-swift-debugging.cc | ||
11 | I know for ASan we ship the interface header with Clang. Do we not do that with TSan? If we do can you just include that so you don't have to redefine this here? | |
40 | I don't understand this. There's no Swift code in this test case so how is this a Swift access race? |
lib/tsan/rtl/tsan_debugging.cc | ||
---|---|---|
89 | All the APIs return 1 on success, 0 on failure. | |
lib/tsan/rtl/tsan_interface.h | ||
122 | See comments around. "report" is an opaque pointer representing the report we want to extract data from, "tag" is the output variable. All these APIs return non-zero on success, zero on failure. Sorry about the lack of formal documentation here, it's because this is only for debugger integration (and not really a public API) and this header file isn't shipped anywhere. | |
test/tsan/Darwin/external-swift-debugging.cc | ||
11 | Yeah, we do not. The reason is that these are not really stable APIs. | |
40 | The test is faking what a Swift code would do via the __tsan_external_write call. |
LGTM, but would be better with a comment in the header describing the function
lib/tsan/rtl/tsan_interface.h | ||
---|---|---|
122 | I would also prefer a basic doxygen comment. |
test/tsan/Darwin/external-swift-debugging.cc | ||
---|---|---|
19 | Why does tag need to be a global here? Can't it just be a literal in ExternalWrite which is the only place its used. | |
40 | This is still incredibly unclear. Why when using __tsan_external_write
Please add some comments to ExternalWrite to explain what is going on (i.e. that you're faking a swift access will a special tag that is defined in lib/tsan/rtl/tsan_defs.h ). | |
63 | This variable is hiding the tag global variable of the same name. Removing the global variable will fix this. |
test/tsan/Darwin/external-swift-debugging.cc | ||
---|---|---|
40 | I don't want to expand the scope of this patch. Let's strictly focus on the added API. |
test/tsan/Darwin/external-swift-debugging.cc | ||
---|---|---|
40 | @delcypher this file is just a test. The race itself is immaterial here, from my understanding the test is there to check that we can get the correct tag from the report. In fact, all the CHECK: lines about the race could be even dropped. |
test/tsan/Darwin/external-swift-debugging.cc | ||
---|---|---|
21 | @kubamracek Great. Thanks for using a clearer name. A comment probably isn't necessary anymore. Out of curiosity, why does this variable have static storage? I can't think of a reason why that would be necessary. | |
40 | @george.karpenkov Although this file is a test, it's important to make the test as understandable as possible without putting too much burden on the test writer. This test in the original patch wasn't very easy to understand and a simple comment explaining what ExternalWrite was doing would help with understanding. That being said now that @kubamracek has moved the tag definition into ExternalWrite and named it kSwiftAccessRaceTag to code is clearer and a comment probably isn't needed any more. |
Why return 1? What does that mean?