[issue25518] Investigate implementation of PyOS_CheckStack on OSX

2019-08-31 Thread Ned Deily


Change by Ned Deily :


--
resolution:  -> duplicate
stage: test needed -> resolved
status: open -> closed
superseder:  -> Implement PyOS_CheckStack on macOS using pthread_get_stack*_np

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25518] Investigate implementation of PyOS_CheckStack on OSX

2015-10-30 Thread Ronald Oussoren

New submission from Ronald Oussoren:

On OSX 10.4 or later the following functions are available:

size_t pthread_get_stacksize_np(pthread_t);
void* pthread_get_stackaddr_np(pthread_t);

These functions could be used to implement PyOS_CheckStack on OSX. The 
advantage of this would be that it would get less likely that recursion causes 
hard crashes when the recursion limit is not optimally tuned to the stack size 
on OSX. (Note that OSX has a fixed size stack for the main thread as well, 
AFAIK unlike linux).

The disadvantage of implementing this is that a naive implementation might have 
a negative performance impact. It should be possible to avoid this by caching 
the return values of these functions in the thread state.

Another disadvantage according to a quick search on Google: 
``pthread_get_stacksize_np`` appears to be buggy on some OSX versions, which 
requires workarounds to get the right behavior.

--
components: Interpreter Core, Macintosh
messages: 253742
nosy: ned.deily, ronaldoussoren
priority: low
severity: normal
stage: test needed
status: open
title: Investigate implementation of PyOS_CheckStack on OSX
type: behavior
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com