Segmentation violation when load_file a .ses file

Using the Multiple Run Fitter, praxis, etc..
Post Reply
eacheon
Posts: 97
Joined: Wed Jan 18, 2006 2:20 pm

Segmentation violation when load_file a .ses file

Post by eacheon »

When I load my model and type manually

Code: Select all

$ /path/to/special model_setup.hoc -
oc> init()
oc> load_file("SEClampFit.ses") 
every things goes fine and a multirun fitter pops out. However when I append this load_file to a init_fit.hoc script and run the script I got the following error message (repeating many times till ctrl-C to stop):

init_fit.hoc:

Code: Select all

init()
load_file("SEClampFit.ses")

Code: Select all

 $ /path/to/special model_setup init_fit.hoc
...
...
...
       object_push(/myhome/nrn59/nrn/i686/bin/nrniv: Segmentation violation
 in SEClampFit.ses near line 13
 ^
        object_push(/myhome/nrn59/nrn/i686/bin/nrniv: Segmentation violation
 in SEClampFit.ses near line 13
 ^
        object_push(/myhome/nrn59/nrn/i686/bin/nrniv: Segmentation violation
 in SEClampFit.ses near line 13
 ^
        object_push(/myhome/nrn59/nrn/i686/bin/nrniv: Segmentation violation
 in SEClampFit.ses near line 13
 ^
        object_push(/myhome/nrn59/nrn/i686/bin/nrniv: Segmentation violation
 in SEClampFit.ses near line 13
 ^
        object_push(./mod/i686/special: line 12: 12922 Segmentation fault      "${NRNIV}" -dll "/path_to_mod/mod/i686/.libs/libnrnmech.so" "$@"
Command exited with non-zero status 139
The 12922 is sometimes other number, for instance, 16348.


SEClampFit.ses:

Code: Select all

objectvar save_window_, rvp_
objectvar scene_vector_[6]
objectvar ocbox_, ocbox_list_, scene_, scene_list_
{ocbox_list_ = new List()  scene_list_ = new List()}

//Begin MulRunFitter[0]
{
load_file("mulfit.hoc", "MulRunFitter")
}
{
ocbox_ = new MulRunFitter(1)
}
{object_push(ocbox_)}
{
version(5)
ranfac = 2
fspec = new File("SEClampFit.ses.ft1")
fdat = new File("SEClampFit.ses.fd1")
read_data()
build()
}
{p.gengui(0, 636, 459, 337.92, 314.88)}
{object_pop()}
{
ocbox_.map("MulRunFitter[0]", 423, 139, 360.96, 199.68)
}
objref ocbox_
//End MulRunFitter[0]

objectvar scene_vector_[1]
{doNotify()}
Typing a load_file("something.ses") maybe fine, but I still wish to know what happened and how I can avoid this problem.
Last edited by eacheon on Fri Dec 01, 2006 1:28 am, edited 1 time in total.
eacheon
Posts: 97
Joined: Wed Jan 18, 2006 2:20 pm

Post by eacheon »

hold on. I seem to find the reason. will post later.
eacheon
Posts: 97
Joined: Wed Jan 18, 2006 2:20 pm

Post by eacheon »

If init_fit.hoc is using stdinit() instead of init():

Code: Select all

stdinit()
load_file("SEClampFit.ses")
Then everything is fine.
In the customized init() I created something like "rig/instrument", i.e. an SEClamp. because parameters of some instruments depend on the result of init(). Now I realized it might be better to initialize instruments independently with init(), then modify the parameters in init().
Raj
Posts: 220
Joined: Thu Jun 09, 2005 1:09 pm
Location: Groningen, The Netherlands
Contact:

Post by Raj »

You might want to have a look at this discussion on how to use the standard run system:
https://www.neuron.yale.edu/phpBB2/view ... initialize
eacheon
Posts: 97
Joined: Wed Jan 18, 2006 2:20 pm

Post by eacheon »

Raj wrote:You might want to have a look at this discussion on how to use the standard run system:
https://www.neuron.yale.edu/phpBB2/view ... initialize
Actually I read this thread before, though I still cannot figured out why stdinit() will do but init() won;t when I work with Mutrunfitter.
Post Reply