I am attempting to use a randomvar
in a model, like so:
class evcharger_rand { randomvar work_dist; } object evcharger_rand{ mileage_classification 73; name evcharger_det_0; parent evcharger_house_0; work_dist "type:weibull(0.5,0.5); min:0.0; max:1.0; refresh:1h;"; }
where evcharger_rand
is some of my own custom code.
Running this model results in a segfault in random.c
at Line 1301 when var->update_rate
tries to deference var
, whose address at this point is 0x4052400000000000
.
Tracing the issue back, it seems as though var->next
on Line 1336 should be yielding a NULL
but isn't.
Therefore, I investigated randomvar_create()
at Line 1259. And found that it was called only once and that var->next
at that time was NULL
.
Looking in convert_to_randomvar()
, I found that var->next
was 0x4052400000000000
when this function was called.
My conclusion is that var->next
is getting altered sometime between the calls to randomvar_create()
and convert_to_randomvar()
.
(Note: my custom code is not making such a change to my knowledge. It simply tries to observe the value of the randomvar.)