Page 1 of 1

section stack overflow

Posted: Mon Mar 06, 2006 1:19 pm
by Franzi

i have a new problem. There is a section stack overflow if i want to get the parents of a section (over 18 parent sections). Is this a program intern problem by filling a list or is it a selfe made problem by bad program code?

Posted: Sat Mar 11, 2006 9:17 am
by hines
I think both. Internally there is a section stack of size 20 which you are overflowing but that was never intended for recursive use. I would encourage you to use the
SectionRef class methods: root, parent, child; see ... ecref.html
and perhaps some of the SectionList methods; see ... clist.html

Posted: Thu Mar 13, 2008 3:22 pm
by Sherif

I got the same error message "section stack overflow" and found where the recursive call of a function took place. Is there a way to increase the stack size over the 20 limit at least for now? I am in the middle of a project and rather to use the same code before going back and modify it.


Posted: Thu Mar 13, 2008 3:34 pm
by hines
You would have to edit nrn/src/nrnoc/cabcode.c at the line

Code: Select all

#define NSECSTACK 20
and increase the value. The structure involved is not large so there is no practical limit on the value of NSECSTACK.

If you are using linux, after this change it is only necessary to type "make install" in this nrnoc directory to get the larger section stack (assuming your build directory is the same as your source directory).