You are here

OS signal: 11 (SIGSEGV) when trying to run or compile

I recently added a few new parameters trying to create a submodel to take my daily data output and convert it to average monthly.  During this effort a problem with the model popped up and I don't seem to be able to fix it or what the signal means. help.  My file is to big to attach.

Reporter: 
John E. Rogers04
Created: 
Tue, 10/05/2011 - 16:45
Updated: 
Fri, 13/05/2011 - 14:58

Comments

Perhaps you could send the model file to support@simulistics.com? Compress it if necessary.

John -- Thanks for sending me the model and data. I believe I've found your problem. The model is trying to pick a value from an array that is beyond its bounds; this may or may not cause a 'segmentation violation' signal when converted into c++ code.

The way to find these is to execute the model in 'debug' mode. This causes a model program to be created in the interpreted language Tcl rather than c++. When a Tcl program tries to access a non-existent array member, an appropriate error message is generated, which Simile tries to disassemble to show where in the model the problem occurred.

The trouble is, Tcl is much slower than c++, so to get this information reasonably quickly I removed all the time series data from the model. I then found the problem was with the variable 'month total'. It gets an element from 'PHYTON MA' indexing it by month -- and the array has only 10 members. That was a red herring as there are only 10 months -- but the 'month' variable has value index(1), which means it uses the instance id from its innermost parent submodel 'submodel1', which has 84 instances. So in instances 11 to 84 of 'submodel1', the equation for 'month total' will be trying to get an out-of range element from the array 'PHYTON MA'. It seems to me that the value of 'month' should be index(2), giving the instance id of the next innermost submodel 'month', which only has 10 instances.

Hope this is a satisfactory fix.