YilingQiao/diffsim

Segmentation fault (core dumped)

Closed this issue · 5 comments

When I run demo exp_inverse.py , the error occurs: Segmentation fault (core dumped)
I found the error comes from arcsim.init_physics(out_path+'/conf.json', out_path+'/out%d'%epoch,False)
What should I do?

Hi, what's your command to run exp_inverse.py? Are you in the pysim directory when running this script?

I run the demo through python exp_inverse.py and I am in the pysim directory.
The error comes from line Tensor min_angle = infinity;in Io.cpp
When I modified it into Tensor min_angle = std::numeric_limits<double>::infinity()*ONE; , the error disappeared. I don't know why, The original code gives infinity the std::numeric_limits<double>::infinity()*ONE. It's the same.

After that, another segmentation fault error occurs. It comes from obstacles.resize(json.size()); in conf.cpp.

Thanks for your feedback about the infinity issue, and I change this to a #define. Can you please try if this solves your problem? As for the next segmentation fault, can you see if it's caused by resize() of jason.size()?

The error of obstacles.resize(json.size()) also comes from infinity , I use your new code and the error disappears. Thanks.

Thanks!