segmentation error: wopen

Anything that doesn't fit elsewhere.
Post Reply
bhalterm
Posts: 52
Joined: Wed Mar 08, 2006 10:43 am
Location: University of Pennsylvania

segmentation error: wopen

Post by bhalterm »

wopen in the File class gives a segmentation error with long path names.
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: segmentation error: wopen

Post by ted »

To us help reproduce the problem, could you please provide an example that generates the error, and mention which version of NEURON and under what OS this occurred?
bhalterm
Posts: 52
Joined: Wed Mar 08, 2006 10:43 am
Location: University of Pennsylvania

Re: segmentation error: wopen

Post by bhalterm »

When the following code is saved in a file and run with nrniv,

Code: Select all

begintemplate Results
    public translate
    
    proc translate() { localobj file
    
        file = new File()	
        file.wopen("/Users/benlhalt/NEURON/debugnet/translated_results/septohippo_lfp_threadsafe_06-29-09_02;30;42/septohippo_lfp_threadsafe_06-29-09_02;30;42_runtime=3.56_nthread=1/raster_for_septohippo_lfp_threadsafe_06-29-09_02;30;42_run_spike_trains_for_septohippo_lfp_threadsafe_06-29-09_02;30;42_runtime=3.56_nthread=1.txt")
        
        print "open = ", file.isopen()
        
        file.printf("hello")
    }
    
endtemplate Results

objref results
results = new Results()
{ results.translate() }
Then this is the output:

Code: Select all

NEURON -- Release 7.0 (281:80827e3cd201) 80827e3cd201
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html

nrniv(58664) malloc: *** error for object 0x7465f0: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
open = 1 
nrniv(58664) malloc: *** error for object 0x7465f0: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
It only happens when the code is in a file arg to nrniv, not when the commands are typed directly into the interpreter. The error occurs depending on the length of the path, whether or not the path is valid. A shorter path produces no error. With a longer, valid path, the code actually opens the file and writes to it, but then a segmentation error occurs (no malloc message) at an unpredictable time... either after the code executed, or after I tried to quit using CTRL-D.
I'm running OS X 10.5.7 on a macbook pro.
hines
Site Admin
Posts: 1607
Joined: Wed May 18, 2005 3:32 pm

Re: segmentation error: wopen

Post by hines »

There was a limit of 256 characters (without the macro substitutions). The length
is now unlimited from the perspective of NEURON. There may be an OS limit.
See
http://www.neuron.yale.edu/hg/neuron/nr ... f06f8195ac
I made a new dmg for the mac at
http://www.neuron.yale.edu/ftp/neuron/versions/alpha/
bhalterm
Posts: 52
Joined: Wed Mar 08, 2006 10:43 am
Location: University of Pennsylvania

Re: segmentation error: wopen

Post by bhalterm »

Thank you!
Post Reply