indygreg / PyOxidizer

A modern Python application packaging and distribution tool
Mozilla Public License 2.0
5.41k stars 234 forks source link

memory allocation of 4 bytes failed #423

Open Alyetama opened 3 years ago

Alyetama commented 3 years ago

Steps to reproduce

$ cargo install --git https://github.com/indygreg/PyOxidizer.git --branch main pyoxidizer
$ pyoxidizer init-config-file pyapp
$ cd pyapp
$ pyoxidizer run
.
.
.
    Finished dev [unoptimized + debuginfo] target(s) in 1m 10s
installing files to /Users/user/pyapp/./build/aarch64-apple-darwin/debug/install
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 4 bytes failed
error: cargo run failed

Full traceback: https://pastebin.com/raw/9MXYt2JH

Rust version

rustc 1.53.0 (53cb7b09b 2021-06-17)

OS info

OS: macOS 11.4 20F71 arm64

indygreg commented 3 years ago

Very interesting. I also have an M1 machine (a Mac Mini) but I can't reproduce this.

It looks like we're getting an error from jemalloc. This will likely need someone to look into its source code and see how/where that Unsupported system page size error occurs.

You can work around this by disabling jemalloc in your pyoxidizer.bzl. In the default config file, simply uncomment the # python_config.allocator_backend = "default" line to override PyOxidizer's default of using jemalloc on Linux/macOS.