Author peadar
Recipients bkabrda, justbennet, markmcclain, opoplawski, peadar, vstinner
Date 2019-08-14.14:59:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAO1X7jsON37-GvPxGL2pJKdrQxcutQz32e7-wGE0=c+G73Ju6g@mail.gmail.com>
In-reply-to <1565790358.78.0.895060554501.issue21131@roundup.psfhosted.org>
Content
On Wed, 14 Aug 2019 at 14:46, STINNER Victor <report@bugs.python.org> wrote:

>
> STINNER Victor <vstinner@redhat.com> added the comment:
>
> "On a 64-bit system, consuming 8M of address space is a drop in the ocean."
>
> Let me disagree here. Python always allocates faulthandler stack, even if
> faulthandler is not used. Even when faulthandler is used, I would prefer to
> not waste memory if 8 KiB is good enough.
>

I can understand the aversion to the waste when its never used - I can
address 37851 if you like - it seems pretty simple to fix. The pedant in me
must point out that it's 8M of address space, not memory. The cost on
64-bit (well, with a 47-bit user address space) is vanishingly small,
regardless of the physical memory on the system. On 32-bit, it's 0.2% of
your address space, which I think I'd trade for the safety, but that's your
call, and I appreciate that address space can be a constrained resource on
32-bit systems.

I do think SIGSTKSZ*2=16k is far too small considering the fault handler
could be running arbitrary python code, and we know that there's somewhat
less than half of that available for use by the interpreter.

>
> By the way, I just created bpo-37851 to allocate this stack at the first
> faulthandler usage, instead of always allocating it, even when faulthandler
> is not used.
>
> I wrote PR 15276 to use a stack of SIGSTKSZ*2 bytes. According to
> msg349694, it does fix the crash.
>
> Can someone please double check that PR 15276 fix test_faulthandler on a
> platform where the test crash without this change?
>

I can confirm that on the specific hardware I could reproduce this, that
PR14276 and setting the stacksize to SIGSTKSZ*2 passes the
test_faulthandler test.

>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue21131>
> _______________________________________
>
History
Date User Action Args
2019-08-14 14:59:32peadarsetrecipients: + peadar, vstinner, bkabrda, opoplawski, markmcclain, justbennet
2019-08-14 14:59:32peadarlinkissue21131 messages
2019-08-14 14:59:31peadarcreate