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

jemalloc in 1.21.0 doesn't work on iOS #45262

Closed
michaelfairley opened this issue Oct 13, 2017 · 8 comments
Closed

jemalloc in 1.21.0 doesn't work on iOS #45262

michaelfairley opened this issue Oct 13, 2017 · 8 comments
Labels
A-allocators Area: Custom and system allocators C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. O-ios Operating system: iOS

Comments

@michaelfairley
Copy link
Contributor

Jemalloc 4.5.0 (first included in 1.21.0) immediately aborts when run on ARM iOS devices. (Upstream issue). Fortunately, the underlying issue seems to have been fixed in jemalloc 5.0.0 and onwards. (Unfortunately, a Rust PR to upgrade to 5.0.1 just got closed: #45163).

Using the system allocator is an okay workaround for now (though, it requires using nightly).

@kennytm kennytm added A-allocators Area: Custom and system allocators I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. O-ios Operating system: iOS labels Oct 13, 2017
@sfackler
Copy link
Member

It sounds like you tracked the commit that fixed it down? We may be able to cherry-pick that onto our 4.5.0 fork to avoid having to go debug Android.

@arthurprs
Copy link
Contributor

I don't think that change can be backported easily. I guess the best option would be to use system allocator in this platform.

@TimNN TimNN added the C-bug Category: This is a bug. label Oct 17, 2017
@kali
Copy link
Contributor

kali commented Nov 23, 2017

Should we consider just disabling jemalloc for iOS ? My understanding is that the only real use-case for iOS rust executables is tests and bench using dinghy or some other contraption of the same kind so the impact feels minimal.

@michaelfairley
Copy link
Contributor Author

My understanding is that the only real use-case for iOS rust executables is tests and bench...

I definitely ship apps with rust executables to the App Store. 😐

I'd be fine with disabling jemalloc in lieu of the system allocator until some future jemalloc upgrade.

@kali
Copy link
Contributor

kali commented Nov 23, 2017

Ha, good to know :) We only ship libraries, but we do like our tests... I am working on a PR with jemalloc disabled.

bors added a commit that referenced this issue Dec 1, 2017
disable jemalloc on executables for ios targets

This is a (temporary ?) workaround for issue #45262
@SimonSapin
Copy link
Contributor

@michaelfairley Should this be closed, after #46211 ?

@michaelfairley
Copy link
Contributor Author

I suppose! #46211 definitely has me running and happy.

It's probably worth tracking this somewhere though, since it's probably ideal to reenable jemalloc on iOS after a future jemalloc upgrade.

@SimonSapin
Copy link
Contributor

Ok, thanks! Closing.

Per #36963 the plan is to remove jemalloc from the standard library, so this will become a non-issue there. Try https://crates.io/crates/jemallocator and see if it works for you? I think these days it uses jemalloc 5.0.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-allocators Area: Custom and system allocators C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. O-ios Operating system: iOS
Projects
None yet
Development

No branches or pull requests

7 participants