section stack overflow

Anything that doesn't fit elsewhere.
Post Reply
Franzi

section stack overflow

Post by Franzi » Mon Mar 06, 2006 1:19 pm

Hello,

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?

hines
Site Admin
Posts: 1577
Joined: Wed May 18, 2005 3:32 pm

Post by hines » Sat Mar 11, 2006 9:17 am

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 http://www.neuron.yale.edu/neuron/stati ... ecref.html
and perhaps some of the SectionList methods; see http://www.neuron.yale.edu/neuron/stati ... clist.html

Sherif
Posts: 27
Joined: Thu Oct 13, 2005 4:32 pm

Post by Sherif » Thu Mar 13, 2008 3:22 pm

Hello,

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.

Thanks.

hines
Site Admin
Posts: 1577
Joined: Wed May 18, 2005 3:32 pm

Post by hines » Thu Mar 13, 2008 3:34 pm

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).

Post Reply