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

Build Failure with ASAN Due to ENOMEM Error Despite Sufficient Memory #1833

Open
Techinfo0708 opened this issue Dec 27, 2024 · 4 comments
Open

Comments

@Techinfo0708
Copy link

Hi,

We are trying to compile our workspace with the ASAN library, but during the compilation, one of the application requests around 3.2 GB of memory. Despite having enough available memory and swap space, we are encountering an "ENOMEM" error, causing the build to fail.

Below is the system snap shot
free -h
total used free shared buff/cache available
Mem: 31Gi 1.2Gi 3.1Gi 35Mi 27Gi 29Gi
Swap: 4.0Gi 2.3Gi 1.7Gi

This is the error log we traced through strace

openat(AT_FDCWD, "build/rcp/magnum/ppc4/program/rcpd/rcpd-v", O_RDONLY|O_LARGEFILE) = 7
mmap2(NULL, 3283073560, PROT_READ, MAP_SHARED, 7, 0) = -1 ENOMEM (Cannot allocate memory)
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = 8

Note: We are building it for powerpc 32-bit.

@ramosian-glider
Copy link
Member

I am assuming your host is 64-bit, right?
What does ulimit -a say?

@Techinfo0708
Copy link
Author

Yes, I am using 64-bit host machine
Virtual memory is already set to unlimited
Below is the snapshot of ulimit -a
$ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 127917
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 127917
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

@ramosian-glider
Copy link
Member

Oh, sorry, I must have misread the original request.
This is a ENOMEM at compile time, right? Are you using a vanilla compiler (which one?) to compile your project with ASan, or is the compiler itself compiled with ASan?

In general, it is perfectly fine for the compiler to require more memory than usual in both cases I mentioned. If you believe the memory consumption is unreasonably high for a particular file, can you provide a preprocessed reproducer together with the command invoking the compiler?

@Techinfo0708
Copy link
Author

We are linking the ASan runtime (libasan) to our PowerPC library during compilation, with the host system being x64 Linux. The compiler itself is not built with ASan, we are adding ASan support manually.
We are adding versioning to our legacy app, which results in the system attempting to allocate 3.2GB of memory, causing a failure with ENOMEM. Unfortunately, providing a preprocessed reproducer is not feasible for us at this time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants