astral-sh / uv

An extremely fast Python package installer and resolver, written in Rust.
https://astral.sh/
Apache License 2.0
14.94k stars 421 forks source link

uv fails to start because of jemalloc #4647

Open adminy opened 1 week ago

adminy commented 1 week ago
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 5 bytes failed
[1]    22202 abort (core dumped)  uv

A minimal code snippet that reproduces the bug.

uv venv or any uv command.

The current uv platform.

NixOS derivation running on raspberry Pi latest kernel with the aarch64 target.

The current uv version (uv --version).

0.2.15 ( I think, not sure because of the error)

zanieb commented 1 week ago

Looks like jemalloc is not supported on that operating system e.g. https://github.com/home-assistant/core/issues/105768

Home-assistant provides a DISABLE_JEMALLOC option to work-around this, we might need to do similar?

It looks like they also changed the page size (i.e. JEMALLOC_SYS_WITH_LG_PAGE) which may solve the issue? https://github.com/home-assistant/docker-base/pull/248 and more discussion at https://github.com/qdrant/qdrant/pull/3945#issuecomment-2030026387

konstin commented 1 week ago

This is the same problem as we had in https://github.com/astral-sh/ruff/issues/3791, we can try the same mitigation (JEMALLOC_SYS_WITH_LG_PAGE=16 during build)

charliermarsh commented 1 week ago

I believe we have that same mitigation in our build already @konstin.

konstin commented 1 week ago

This looks like a bug in the nixos derivation then, which doesn't set JEMALLOC_SYS_WITH_LG_PAGE=16 for the aarch64 target.

@adminy can you confirm that uv works with the official package (either from github or pypi)?