New submission from Xi Ruoyao <xry...@mengyan1223.wang>:

In faulthandler.c STACK_OVERFLOW_MAX_SIZE is defined to 100 * 1024 * 1024 
(100MB).  But recently KPTI has been applied to mitigate Meltdown 
(CVE-2017-5754) so the userspace stack pointer may be very close to 0xffffffff 
on Linux systems with 32-bit x86.  For example, on my laptop it's sometimes 
0xffffcc20.   So the expression

sp + STACK_OVERFLOW_MAX_SIZE

overflows and becomes a very small number.  That causes 
faulthandler._stack_overflow() to bail out after only one recursive call:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
RuntimeError: unable to raise a stack overflow (allocated 4124 bytes on the 
stack, 1 recursive calls)

----------
components: Extension Modules
messages: 341915
nosy: xry111
priority: normal
severity: normal
status: open
title: faulthandler._stack_overflow doesn't work on x86-linux with KPTI enabled
type: behavior
versions: Python 3.7

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

Reply via email to