Use a temporary variable for that test - #3883
Conversation
|
I don't really understand how the introduction of a new temporary variable could in any way fix the occurring issue. The global So in fact I guess there's something different going on here, even though I don't know what it is. I'm unable to reproduce the issue though, as ASAN cannot even reach this segment of code due to it aborting with a false positive before. I guess you're using ASAN with clang? Which version exactly and how did you configure libgit2? Just so I am able to reproduce the issue. Thanks :) |
|
I honestly have no idea why it doubles-frees, which is why I'm not sure if the fix is correct. Maybe there's something that uses the address of the global var, but then the
The I'm using an CMake-generated Xcode project though, so from the root of the project : You'll end up with a .xcodeproj in there, which you can setup for ASan the usual way. Here's my clang info (running Xcode 7.3.1 7D1014): |
|
Just for completeness, if you want to investigate some weirdness : I did |
|
It does not double-free but instead tries to use memory that has previously been free'd. I think I've got an OSX VM stored somewhere, so I'll try to reproduce with the Apple Clang toolchain. Thanks for the specs. And no, the TOO_BIG test is not the issue, instead it complains about a |
|
One interesting thing: ASAN complains that the address that is to be accessed in |
|
I took a closer look by doing multiple loops of "open/iterate-refs/free" because it seems the failure is intermittent — at least today I can run the This is so very weird... |
|
If you don't set the pointer to |
|
Yeah, it's obviously wrong, I was just investigating. "Forgetting" the |
|
Are you still able to reproduce the issue? |
|
Haven't seen it after 2 full tests run with ASan enabled. Really weird. I have a few changes for ASan compatibility, and I can upstream them if there's interest in those. Seems that ASan is supported by clang >= 3.1 or GCC >= 4.8. |
I'll let ASAN speak for me here. That fix might be completely wrong, and it's expected to be able to run with both instances at the same time, but here I consistently get a failure when running the full test suite.