Page 1 of 1

Segmentation violation

Posted: Sun Aug 05, 2007 11:01 pm
by bhalterm

Code: Select all

      { sprint(cmd.s, "%s_from_%s_to_synlist_%g", $o1.name, $o2.name().s, section.cell.synlist.count() -1) }
      print cmd.s
      print $o2.name().s
when these lines are executed during repeated calls to the enclosing function, they produce this output (on OSX10.4.10 running NEURON 6.0.4):

Code: Select all

lateral_from__to_synlist_0 
msp_1 
lateral_from__to_synlist_0 
msp_2 
lateral_from__to_synlist_0 
msp_2 
lateral_from__to_synlist_1 
msp_2 
lateral_from__to_synlist_1 
msp_2 
lateral_from_?4c_to_synlist_2 
msp_4 
lateral_from__to_synlist_0 
msp_5 
lateral_from__to_synlist_2 
msp_5 
lateral_from_cess_to_synlist_3 
msp_5 
lateral_from__to_synlist_0 
msp_6 
lateral_from__to_synlist_0 
msp_7 
lateral_from__to_synlist_1 
msp_8 
cort_glu_msp_from_m_postscript_filter_to_synlist_2 
artificial_0 
/Users/benlhalt/NEURON/nrn/i686/bin/nrniv.app/Contents/MacOS/nrniv: Segmentation violation
 in make_net.hoc near line 75
 {Synapse[12].a_point_process = Synapse[12].NMDA}
                                                 ^
        Compartment[40].sprint("pp = new msp_NMDA(0.5)", "%s_from_%s_to_synlist_%g", "cort_glu_msp", 
Notice how $o2.name().s produces unpredictable results within the call to sprint(), but performs normally outside sprint(). name() is an obfunc which returns the name of a cell object in a stdrun String object.

Posted: Sun Aug 05, 2007 11:17 pm
by bhalterm
if I make "cell" a localobj in the enclosing function and change the lines to:

Code: Select all

      cell = $o2
      { sprint(cmd.s, "%s_from_%s_to_synlist_%g", $o1.name, cell.name().s, section.cell.synlist.count() -1) }
      print cmd.s
      print $o2.name().s
I get even more exotic output:

Code: Select all

lateral_from_m_postscript_filter_to_synlist_0 
msp_1 
lateral_from_m_postscript_filter_to_synlist_0 
msp_2 
lateral_from_m_postscript_filter_to_synlist_0 
msp_2 
lateral_from_m_postscript_filter_to_synlist_1 
msp_2 
lateral_from_m_postscript_filter_to_synlist_1 
msp_2 
lateral_from_m_postscript_filter_to_synlist_2 
msp_4 
lateral_from_m_postscript_filter_to_synlist_0 
msp_5 
lateral_from_m_postscript_filter_to_synlist_2 
msp_5 
lateral_from_m_postscript_filter_to_synlist_3 
msp_5 
lateral_from_m_postscript_filter_to_synlist_0 
msp_6 
lateral_from_m_postscript_filter_to_synlist_0 
msp_7 
lateral_from_m_postscript_filter_to_synlist_1 
msp_8 
cort_glu_msp_from_m_postscript_filter_to_synlist_2 
artificial_0 
cort_glu_msp_from_    Python is the interpreter
    -realtime        For hard real-time simulation for dynamic clamp
    --version        print version info
    and all InterViews and X11 options
  fileargs:          any number of following
    -                input from stdin til ^D (end of file)
    -c "statement"    execute next statement
    filename         execute contents of filename_to_synlist_3 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_4 
artificial_0 
cort_glu_msp_from_$??'_to_synlist_5 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_6 
artificial_0 
cort_glu_msp_from_elp message
    -help            print this help message
    -isatty          unbuffered stdout, print prompt when waiting for stdin
    -mpi             launched by mpirun or mpiexec, in parallel environment
    -mswin_scale float   scales gui on screen
    -NSTACK integer  size of stack (default 1000)
    -NFRAME integer  depth of function call nesting (default 200)
    -nobanner        do not print startup banner
    -nogui           do not send any gui info to screen
    -notatty         buffered stdout and no prompt
    -python          Python is the interpreter
    -realtime        For hard real-time simulation for dynamic clamp
    --version        print version info
    and all InterViews and X11 options
  fileargs:          any number of following
    -                input from stdin til ^D (end of file)
    -c "statement"    execute next statement
    filename         execute contents of filename_to_synlist_7 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_8 
artificial_0 
cort_glu_msp_from__to_synlist_9 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_10 
artificial_0 
cort_glu_msp_from_elp message
    -help            print this help message
    -isatty          unbuffered stdout, print prompt when waiting for stdin
    -mpi             launched by mpirun or mpiexec, in parallel environment
    -mswin_scale float   scales gui on screen
    -NSTACK integer  size of stack (default 1000)
    -NFRAME integer  depth of function call nesting (default 200)
    -nobanner        do not print startup banner
    -nogui           do not send any gui info to screen
    -notatty         buffered stdout and no prompt
    -python          Python is the interpreter
    -realtime        For hard real-time simulation for dynamic clamp
    --version        print version info
    and all InterViews and X11 options
  fileargs:          any number of following
    -                input from stdin til ^D (end of file)
    -c "statement"    execute next statement
    filename         execute contents of filename_to_synlist_11 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_12 
artificial_0 
cort_glu_msp_from_$??'_to_synlist_13 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_14 
artificial_0 
cort_glu_msp_from_ print this help message
    -isatty          unbuffered stdout, print prompt when waiting for stdin
    -mpi             launched by mpirun or mpiexec, in parallel environment
    -mswin_scale float   scales gui on screen
    -NSTACK integer  size of stack (default 1000)
    -NFRAME integer  depth of function call nesting (default 200)
    -nobanner        do not print startup banner
    -nogui           do not send any gui info to screen
    -notatty         buffered stdout and no prompt
    -python          Python is the interpreter
    -realtime        For hard real-time simulation for dynamic clamp
    --version        print version info
    and all InterViews and X11 options
  fileargs:          any number of following
    -                input from stdin til ^D (end of file)
    -c "statement"    execute next statement
    filename         execute contents of filename_to_synlist_15 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_16 
artificial_0 
cort_glu_msp_from__to_synlist_17 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_18 
artificial_0 
cort_glu_msp_from_set_x_to_synlist_19 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_20 
artificial_0 
cort_glu_msp_from_??u?M
_to_synlist_21         ???9
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_0 
artificial_0 
cort_glu_msp_from_tdin til ^D (end of file)
    -c "statement"    execute next statement
    filename         execute contents of filename_to_synlist_1 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_2 
artificial_0 
cort_glu_msp_from_l_to_synlist_3 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_4 
artificial_0 
cort_glu_msp_from_TACK_to_synlist_5 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_6 
artificial_0 
cort_glu_msp_from_$??'_to_synlist_7 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_8 
artificial_0 
cort_glu_msp_from_r_to_synlist_9 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_10 
artificial_0 
cort_glu_msp_from__to_synlist_11 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_12 
artificial_0 
cort_glu_msp_from__to_synlist_13 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_14 
artificial_0 
cort_glu_msp_from_ter_to_synlist_15 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_16 
artificial_0 
cort_glu_msp_from__to_synlist_17 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_18 
artificial_0 
cort_glu_msp_from__to_synlist_19 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_1 
artificial_0 
cort_glu_msp_from__to_synlist_2 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_3 
artificial_0 
cort_glu_msp_from__to_synlist_4 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_5 
artificial_0 
cort_glu_msp_from_ter_to_synlist_6 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_7 
artificial_0 
cort_glu_msp_from__to_synlist_8 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_9 
artificial_0 
cort_glu_msp_from_[]?U???
                         _to_synlist_10 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_11 
artificial_0 
cort_glu_msp_from_??_to_synlist_12 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_13 
artificial_0 
cort_glu_msp_from__to_synlist_14 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_15 
artificial_0 
cort_glu_msp_from_y_to_synlist_16 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_17 
artificial_0 
cort_glu_msp_from_???   _to_synlist_18 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_19 
artificial_0 
cort_glu_msp_from_???   _to_synlist_20 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_1 
artificial_0 
cort_glu_msp_from__to_synlist_2 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_3 
artificial_0 
cort_glu_msp_from_thon_to_synlist_4 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_5 
artificial_0 
cort_glu_msp_from_thon_to_synlist_6 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_7 
artificial_0 
cort_glu_msp_from_???   _to_synlist_8 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_9 
artificial_0 
cort_glu_msp_from_???   _to_synlist_10 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_11 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_12 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_13 
artificial_0 
cort_glu_msp_from_???   _to_synlist_14 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_15 
artificial_0 
cort_glu_msp_from_thon_to_synlist_16 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_17 
artificial_0 
cort_glu_msp_from_???   _to_synlist_18 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_19 
artificial_0 
cort_glu_msp_from_???   _to_synlist_20 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_1 
artificial_0 
cort_glu_msp_from_thon_to_synlist_2 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_3 
artificial_0 
cort_glu_msp_from_thon_to_synlist_4 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_5 
artificial_0 
cort_glu_msp_from__to_synlist_6 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_7 
artificial_0 
cort_glu_msp_from_???   _to_synlist_8 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_9 
artificial_0 
cort_glu_msp_from__to_synlist_10 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_11 
artificial_0 
cort_glu_msp_from__to_synlist_12 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_13 
artificial_0 
cort_glu_msp_from__to_synlist_14 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_15 
artificial_0 
cort_glu_msp_from__to_synlist_16 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_17 
artificial_0 
cort_glu_msp_from__to_synlist_18 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_19 
artificial_0 
cort_glu_msp_from__to_synlist_20 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_4 
artificial_0 
cort_glu_msp_from_ter_to_synlist_5 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_6 
artificial_0 
cort_glu_msp_from__to_synlist_7 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_8 
artificial_0 
cort_glu_msp_from_set_x_to_synlist_9 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_10 
artificial_0 
cort_glu_msp_from__to_synlist_11 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_12 
artificial_0 
cort_glu_msp_from_???   _to_synlist_13 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_14 
artificial_0 
cort_glu_msp_from__to_synlist_15 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_16 
artificial_0 
cort_glu_msp_from__to_synlist_17 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_18 
artificial_0 
cort_glu_msp_from__to_synlist_19 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_20 
artificial_0 
cort_glu_msp_from_elp message
    -help            print this help message
    -isatty          unbuffered stdout, print prompt when waiting for stdin
    -mpi             launched by mpirun or mpiexec, in parallel environment
    -mswin_scale float   scales gui on screen
    -NSTACK integer  size of stack (default 1000)
    -NFRAME integer  depth of function call nesting (default 200)
    -nobanner        do not print startup banner
    -nogui           do not send any gui info to screen
    -notatty         buffered stdout and no prompt
    -python          Python is the interpreter
    -realtime        For hard real-time simulation for dynamic clamp
    --version        print version info
    and all InterViews and X11 options
  fileargs:          any number of following
    -                input from stdin til ^D (end of file)
    -c "statement"    execute next statement
    filename         execute contents of filename_to_synlist_21 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_22 
artificial_0 
cort_glu_msp_from__to_synlist_23 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_3 
artificial_0 
cort_glu_msp_from_thon_to_synlist_4 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_5 
artificial_0 
cort_glu_msp_from_$??'_to_synlist_6 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_7 
artificial_0 
cort_glu_msp_from__to_synlist_8 
artificial_0 
cort_glu_msp_from_m_postscript_filter_to_synlist_9 
artificial_0 
/Users/benlhalt/NEURON/nrn/i686/bin/nrniv.app/Contents/MacOS/nrniv: Bus error See $NEURONHOME/lib/help/oc.help
 in make_net.hoc near line 75
 {Synapse[75].a_point_process = Synapse[75].NMDA}
                                                 ^
        Compartment[1348].sprint("pp = new msp_NMDA(0.5)", "%s_from_%s_to_synlist_%g", "cort_glu_msp", 

Posted: Sun Aug 05, 2007 11:33 pm
by bhalterm
making "cell_name" a localobj in the enclosing function and changing the lines as follows yields the appropriate output (and produces no errors):

Code: Select all

      cell_name = $o2.name()
      { sprint(cmd.s, "%s_from_%s_to_synlist_%g", $o1.name, cell_name.s, section.cell.synlist.count() -1) }
      print cmd.s
      print $o2.name().s