Skip to content
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

swift test failing locally due to (FB12061292) #60

Closed
heckj opened this issue Feb 18, 2023 · 6 comments · Fixed by #127
Closed

swift test failing locally due to (FB12061292) #60

heckj opened this issue Feb 18, 2023 · 6 comments · Fixed by #127
Labels

Comments

@heckj
Copy link
Contributor

heckj commented Feb 18, 2023

Likely a question more than a bug report. I checked out the repo (main branch), installed jemalloc per the prerequisites (brew install jemalloc). After that swift build worked fine, but swift test in the repository failed for me locally:

Building for debugging...
[10/10] Linking BenchmarkPackageTests
Build complete! (7.69s)
error: Exited with signal code 11

When I run the tests from within Xcode (currently using the 14.3 beta), the tests trap on jemalloc - je_free_default in the stack trace.
Screenshot 2023-02-18 at 11 35 22 AM

Is there something additional I should be doing re: jemalloc?

I'm not familiar with using custom allocators and what the requirements are around that, so I suspect I'm missing something in my setup to support running swift test without issue.

@hassila
Copy link
Contributor

hassila commented Feb 19, 2023

Yeah… unfortunately this seems to be a problem with the macOS proprietary version of xctest - I’ve reported it to Apple with a feedback which was subsequently closed as they thought it was a problem with jemalloc. I’ve the had help investigating this with the jemalloc engineers which seems to point out xctest as passing a pointer to free that was not originally allocated by jemalloc… I’ve commented on the original Apple feedback but got no reply after that.

The open source xctest version works fine on Linux though (so we currently live on the CI Ubuntu runner or local multipass/Ubuntu testing at the moment) and that would be the current recommended way to run the test suite (still hoping to get someone at Apple to take a second look at it, as it’d be much better to be able to run it on macOS too…).

@hassila
Copy link
Contributor

hassila commented Mar 16, 2023

If anyone files a feedback on this, please reference FB12061292.

@hassila hassila changed the title swift test failing locally swift test failing locally due to (FB12061292) Mar 17, 2023
@hassila
Copy link
Contributor

hassila commented Mar 22, 2023

Fixing this in #127 - to run test suite on macOS:

BENCHMARK_DISABLE_JEMALLOC=1 swift test

I haven't found a way to pick up environment variables properly in Xcode (hints appreciated) so it works, but if running the benchmark package in Xcode and simply setting the variable properly in Package.swift, the test suite can be run within Xcode too.

@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 1.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@heckj
Copy link
Contributor Author

heckj commented Mar 22, 2023

Thanks @hassila

@hassila
Copy link
Contributor

hassila commented Mar 23, 2023

For posterity, I found a workaround how to get it working in Xcode:

$ killall Xcode
$ BENCHMARK_DISABLE_JEMALLOC=1  open Package.swift

(source: https://forums.swift.org/t/how-to-switch-package-dependencies-in-xcode-after-deprecation-of-generate-xcodeproj/42130)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants