Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I increase the stack size in python

Tags:

python

stack

dll

I have a python program that uses a custom-built DLL. This DLL crashes due to a stack overflow. This overflow is not due to a recursive function gone bad, but to large allocations on the stack using alloca().

I want to increase stack size to get rid of this error. Is there any way to do this?

like image 618
Philippe Beaudoin Avatar asked Jan 14 '10 21:01

Philippe Beaudoin


1 Answers

The functions in a dll can have no control over the stack size available when they are executed (unless you spawn new threads under the control of your library).

If the dll is custom, then can't you allocate on the heap rather than stack (or statically allocate, if appropriate), and stop the problem that way?

like image 144
James Avatar answered Sep 16 '22 17:09

James