[issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX
Tony Reix
report at bugs.python.org
Thu Aug 13 09:12:55 EDT 2020
Tony Reix <tony.reix at atos.net> added the comment:
Some more explanations.
On AIX, the memory is controlled by the ulimit command.
"Global memory" comprises the physical memory and the paging space, associated with the Data Segment.
By default, both Memory and Data Segment are limited:
# ulimit -a
data seg size (kbytes, -d) 131072
max memory size (kbytes, -m) 32768
...
However, it is possible to remove the limit, like:
# ulimit -d unlimited
Now, when the "data seg size" is limited, the malloc() routine checks if enough memory/paging-space are available, and it immediately returns a NULL pointer.
But, when the "data seg size" is unlimited, the malloc() routine first tries to allocate and quickly consumes the paging space, which is much slower than acquiring memory since it consumes disk space. And it nearly hangs the OS. Thus, in that case, it does NOT check if enough memory of data segments are available. Bad.
So, this issue appears on AIX only if we have:
# ulimit -d unlimited
Anyway, the test:
if (size > (size_t)PY_SSIZE_T_MAX)
in:
Objects/obmalloc.c: PyMem_RawMalloc()
seems weird to me since the max of size is always lower than PY_SSIZE_T_MAX .
----------
nosy: -facundobatista, mark.dickinson, pablogsal, rhettinger, skrah
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41540>
_______________________________________
More information about the Python-bugs-list
mailing list