-
Notifications
You must be signed in to change notification settings - Fork 1.6k
"Error allocating TSD" when running Polkadot #6591
Comments
For reference, here is the old allocator selection code in |
Why does jemalloc doesn't work on mac? Maybe they should provide more information, otherwise we can not help. |
I'm facing this issue. I just get the error
My computer is a macbook pro, with the m1 pro chip (32gb ram, etc). I've tried quite a few things so far. Reinstalling make, cmake, installing rosetta 2 for Intel chip emulation, updating to latest rust nightly, updating to the macOS ventura, reinstalling mac xcode developer tools, deleting and recloning polkadot, etc. This issue has always been the case for me, but my workaround in the past was to compile with a different allocator(mimalloc) via the parity-util-mem features. @vieira-giulia mentioned also facing a similar error in the past, but its not clear how she got rid of hers. |
@mrcnski I don't know the reason. If it works for you, it probably has to do with the C toolchain used to build jemalloc. Having a crate for setting a global allocator might make sense, I've thought about it as well. We could extract memory stats there. That would make us not worry about Line 23 in 153543b
That crate could have jemalloc and mimalloc features (both disabled by default). The features should be mutually exclusive (cfg(all(..), compile_error)). |
@ordian Would setting the allocator in a crate not introduce the risk of soundness issues, similar to those we encountered with (My understanding of the soundness issues with parity-util-mem: it was unsound particularly if two different versions were used, which was possible because we had dependencies also relying on it... So every time it got updated, we had to coordinate releases across different crates, and be very careful not to miss any.) |
Yes, the soundness issue was due to having to versions with different features. It was mitigated by https://github.com/paritytech/parity-common/blob/806ca48a95c06014e0fde74a1382dc128da62206/parity-util-mem/Cargo.toml#L12, which can be done here as well. |
Disallowing duplicates of EDIT: Hmm, actually, if we extract mem stats, it will be used as a dependency for the overseer, which is not great at all. Maybe it's best to not extract it into a crate after all. |
Yeah, I don't see a need for this crate 🤔, but I do think we could/should add a feature flag to Polkadot that enables a different allocator. |
TBH, I don't get why we need to use jemalloc for this. As we are mainly supporting Linux, we should only make mem stats works for Linux and report nothing for Mac os. Then we can make jemalloc optional again. We could also make the jemalloc memory collection optional. |
Yep I had this, it's a problem for macs with M1 processor regarding make. These are a few things I did at the time that are maybe worth checking.
All of these are decently obvious but well worth doing anyway. I remember deleting and reseting the jemalloc dirs but that was just brute forcing the whole thing. |
@tonyalaribe that seems to work for me when I try it. What error do you get now, still the same one? Perhaps run |
@mrcnski it's strange. I get the exact same error even after cargo clean and cargo build. Why would it still show a jemalloc error? |
Also, I tried all of @vieira-giulia 's suggestions. But the issue persists |
Thanks @bkchr, I commented the code in the function you shared, and it runs now. |
Hi @bkchr I want to take a stab at this, as it's blocking my workflow (quite difficult to run zombienet tests when the default build doesn't run). About the implementation, and about your comment
Should I make a PR that hides the jemalloc and memory collection behind a flag, which is turned on by default on Linux? Or what would you suggest as the expected behavior? |
Generally sounds reasonable. |
The linked PR to introduce the jemalloc-allocator feature flag was merged, so I'll close this issue for now |
A user is running into this error when running a release binary which they built using a recent nightly. They also report:
However, AFAIK
jemalloc
should work on Mac (at least it does for me, both pre- and post-M1).@ordian do you have any ideas what might be the issue? And would it make sense to support a different allocator through a feature flag, which
parity-util-mem
used to support?The text was updated successfully, but these errors were encountered: