STINNER Victor <vstin...@python.org> added the comment:

> So where getauxval(AT_MINSIGSTKSZ) < SIGSTKSZ the merged changes actually 
> resulted in decrease of the allocated signal deliver stack. 

faulthandler stack is only used in the least likely case: on a fatal error. It 
should reduce its memory footprint, so it's good that it uses less memory.

To fix bpo-21131, I chose to use SIGSTKSZ * 2 because:

* the fix is trivial: add "* 2"
* it "just works"
* there was no API to query how many bytes Linux uses on the stack

Previously, faulthandler had between 0 and SIGSTKSZ bytes depending on which 
CPU extension was used or not on the process.

If I understood correctly, on Linux 5.14 with the change, faulthandler now 
always has SIGSTKSZ bytes for its own usage, and the other bytes are used by 
the Linux kernel. So it's more reliable for faulthandler, to always have the 
same amount of memory for its personal use.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46968>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to