Page 1 of 1

segmentation violation

Posted: Fri Oct 06, 2006 10:46 am
by Tsirogiannis
A segmentation violation error occured in a couple of circumstances.
The first time was in calling a function that was supposed to return an integer. I solved that problem by removing the localobj variables that I was using and setting them global, outside the function body.

However, afterwards, the same error occured in this block of code:

Code: Select all

for c1=0,ncells-1 {
	for c2=0,ncells-1 {
		print synapses[c1][c2] 
	}
}
,

where the "synapses" is supposed to be a 2-D array of integers. This block is not in a function or proc, simply in a hoc.
Here is the error:
nrniv: Segmentation violation
in C:/nrn59/my_models/net.hoc near line 307
}
What is the meaning of the "segmentation fault" and how can I resolve these issues?

Thanks a lot

Posted: Fri Oct 06, 2006 11:13 am
by ted
Sometimes segmentation violations mean that there is a bug in NEURON, but most often
they are caused by user-written code that contains an error.

To diagnose the origin of the problem you encountered, it is necessary to examine the
code that declares the variable "synapses", and the code that assigns values to its
elements. Can you provide brief excerpts that show how you did this?