On Fri, 5 Mar 2021 15:03:59 +0000
Mark Shannon <m...@hotpy.org> wrote:
> 
> There are two issues here. Portability and changes to behaviour.
> 
> Regarding portability, I have to admit that PEP is rather vague.
> That's my fault; I should have done more implementation first :(
> FWIW, I have an implementation that should be portable.
> https://github.com/python/cpython/compare/master...markshannon:pep-overflow-implementation

I looked through this diff and I'm not sure how this works robustly.

This seems to assume:
- each thread's stack size is known and is a compile-time constant
- Python owns the thread and can compute the stack limit reliably from
  the current stack frame
- the OS allocates stack pages in units of BLOCK_SIZE or more (currently
  8kiB)
- the OS doesn't use a segmentation scheme that limits stack accesses
  with a finer granularity than page (or "block") size
- it's ok to write memory beyond the current stack top (I can imagine
  verification tools such as Valgrind complaining about that, though
  this can be worked around using suppressions)

I would be curious if you could elaborate on these points.

Regards

Antoine.


_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/HFV33HIVTWLIJXI4WQAGK6ZLWYQHKJPX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to