>64TB mmap() calls leading to out-of-memory crash
|Assignee||A. Wilcox (awilfox)|
|Reported||2021-02-05 17:59:49 -0600|
|Modified||2021-02-05 17:59:49 -0600|
|Hardware||Adélie Linux / PowerPC (64-bit)|
|Importance||--- / normal|
Some perl scripts are leading to mmap() calls with insanely huge sizes (far beyond 64TB) resulting in out-of-memory errors.
2 examples of perl scripts that lead to the scenario:
(from inside the packages git repo with local changes)
$ git add -p
(from inside the kernel source tree)
$ make localmodconfig
In the backtrace, many important variables are optimized out. So to debug this I modified APKBUILD in system/perl, changing the optimization flags to:
By default, -Os is used. To my surprise, after rebuilding the perl package, the problem goes away! I don't know if it is a problem with -Os or what. Unfortunately I know nothing about perl internals. I assume anyone wit ppc64 can easily reproduce the problem with the 2 examples above. I can provide core dumps or backtraces if anyone is interested.