Ticket #1 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

getting index outside boundries for Vectors and arrays segfaults

Reported by: emuller Assigned to: somebody
Priority: major Milestone:
Component: component1 Version:
Keywords: Cc:

Description

import neuron as nrn
nrn.h.execute('double f[10]')

# this is ok, throws an exception

nrn.h.execute('f[10]')
NEURON: subscript out of range f
 near line 0
 {f[10]}
        ^
        execute("f[10]")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
RuntimeError: hoc error

# this is ok:

nrn.h.f[9]

# but this not:

nrn.h.f[10]

NEURON: subscript out of range f
 near line 0
 ^
Segmentation fault

Similarly for Vectors:

import neuron as nrn

nrn.h.execute('objref f')

nrn.h.execute('f = new Vector(5)')
nrn.h.f.x[0]
0.0
nrn.h.f.x[5]
NEURON: subscript out of range x
 near line 0
 {f = new Vector(5)}
                    ^
Segmentation fault

Change History

05/22/07 17:00:05 changed by hines

  • status changed from new to closed.
  • resolution set to fixed.