uv icon indicating copy to clipboard operation
uv copied to clipboard

uv fails to start because of jemalloc

Open adminy opened this issue 1 year ago • 4 comments

<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)

adminy avatar Jun 29 '24 16:06 adminy

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

zanieb avatar Jun 29 '24 17:06 zanieb

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)

konstin avatar Jul 01 '24 07:07 konstin

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

charliermarsh avatar Jul 01 '24 12:07 charliermarsh

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)?

konstin avatar Jul 01 '24 12:07 konstin

I'm going to close this as stale. #6528 tracks this issue for our own binaries.

zanieb avatar Aug 26 '24 16:08 zanieb