Segmentation fault when using restart2data

Hi Steve,

I met a problem of segmentation fault when using restart2data which is similar to jiwu ever reported in lammps mailing list and I saw your response to him (http://lammps.sandia.gov/threads/msg01330.html), but I did not get ways to solve this problem.

The lammps version I used is lammps-30Sep11 and the simulation goes smoothly. The attached file is the restart file that I need to transform to data file. I went to tool directory and use “g++ restart2data.cpp -o restart2data” to compile the restart2data.cpp. The executable restart2data is generated although the following information is shown on the screen:

restart2data.cpp: In function ��void header(FILE*, Data&)��:
restart2data.cpp:481:19: warning: deprecated conversion from string constant to ��char��
restart2data.cpp:493:14: warning: deprecated conversion from string constant to ��char
��

Then I run the transformation using the restart2data, the following information is finally shown and the transformation is failed:

Writing data file ...
Segmentation fault (core dumped)

I also tried other restart2data.cpp in latest lammps version (lammps-20Apr12) to transform the attached restart file but unfortunately still got the same error. So what is your insight for this problem? Thanks in advance!

Regards,
Yingdong

a.532 (5.28 MB)

Hi Steve,

I have find out what is going on with my problem. I made some changes to the code of the dihedral style I used in my simulation, but I did not change the corresponding place in restart2data.cpp, so the segmentation fault happened. Just now I changed the corresponding place in the restart2data.cpp and the transformation is successful. I thought it might be a possible reminder for other people who met the same problem. Have a good day!

Regards,
Yingdong