-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allocation counter tests don't work on macOS #2672
Comments
Ah, the problem is that the main test package, created by
With The following change appears to fix the issue[1]. However, I've only tested in on macOS. We'd need to check Linux is also working fine. [1]
|
Motivation: Allocation counters are broken on macOS as described [here](apple#2672). This PR fixes it. Modifications: `AtomicCounter` library is made `.dynamic`. This deduplicates the two (static) copies that used to exist. One embedded in the main binary, and the other in `HookedFunctions` dylib. This deplication fixes the issue, because there is just one copy of the counters in the process address space. Result: All the tests counting allocations and related statistics work on macOS.
Motivation: Allocation counters are broken on macOS as described [here](#2672). This PR fixes it. Modifications: `AtomicCounter` library is made `.dynamic`. This deduplicates the two (static) copies that used to exist. One embedded in the main binary, and the other in `HookedFunctions` dylib. This deplication fixes the issue, because there is just one copy of the counters in the process address space. Result: All the tests counting allocations and related statistics work on macOS.
Expected behavior
Documentation describes how to run allocation tests locally on macOS, here: https://github.com/apple/swift-nio/blob/63e8c4e1aa6a98252f7838b313c9e35a7317b31c/docs/debugging-allocations.md#understanding-the-output-of-the-allocation-counter-tests
The expected output should contain the actual allocation counters, like:
Actual behavior
All counters are
0
, e.g.:Steps to reproduce
If possible, minimal yet complete reproducer code (or URL to code)
As above.
SwiftNIO version/commit hash
63e8c4e
System & version information
The text was updated successfully, but these errors were encountered: