viking-gps / viking

Viking is a free/open source program to manage GPS data (inc GPX, FIT, TCX and KML files). You can import and plot tracks, routes and waypoints, show OpenStreetMaps (OSM), Bing Aerial and other maps, generate Mapnik maps, geotag images, make new tracks, routes and waypoints, see real-time GPS position, etc. It is written mostly in C with GTK
http://sourceforge.net/projects/viking/
GNU General Public License v2.0
223 stars 55 forks source link

Viking crash with specific .vik file. #275

Open WieLeen opened 3 months ago

WieLeen commented 3 months ago

Viking keeps crashing when i try to open a specific file (see attachment)

The log for opening the file is:

viking [Debug]): file_read: reading file version 1 viking [Warning]): Line 29: Unknown parameter. Line: new_on=t viking [Warning]): Line 30: Unknown parameter. Line: new_alpha=100 viking [Warning]): Line 31: Unknown parameter. Line: new_color=#4365b8 viking [Debug]): Key file does not have key “external_diary_program” in group “viking” viking [Debug]): Key file does not have key “external_astro_program” in group “viking” viking [Debug]): Key file does not have key “external_text_program” in group “viking” viking [Warning]): viking [Debug]): file_read: reading file version 1 viking [Warning]): Line 29: Unknown parameter. Line: new_on=t viking [Warning]): Line 30: Unknown parameter. Line: new_alpha=100 viking [Warning]): Line 31: Unknown parameter. Line: new_color=#4365b8 viking [Debug]): Key file does not have key “external_diary_program” in group “viking” viking [Debug]): Key file does not have key “external_astro_program” in group “viking” viking [Debug]): Key file does not have key “external_text_program” in group “viking” viking [Warning]): file_read: Mismatched number of toplayer markers 1

Can someone help me to debug Viking/the file as it is impossible to work with it at the moment.

Kind regards, Wieland Reis_Compostela_2024Final.zip

rnorris commented 3 months ago

Thank you for providing a sample file, but I can not recreate it crashing (neither v1.10 nor latest source code).

What version of Viking are you using?

From your posted log messages it appears to be perhaps v1.8 but using a file generated by v1.9 or later, since there are warnings about "Unknown parameter."; which should only happen when using an older Viking program on a file from a newer version. Thus in this case, those warnings are expected and Viking simply ignores those lines it doesn't understand.

However the "Mismatched number of toplayer markers" warning is more concerning - I think this should only happen if you have a corrupt .vik file or perhaps accidentally modified it in some other program and end up having unequal '~TopLayer' versus '~EndTopLayer' lines in the .vik file.

Yet your sample is fine!

If it is Viking v1.8 or earlier, it was susceptible to crashing if there was no final '~EndTopLayer' lines, but was fixed with this commit:

https://github.com/viking-gps/viking/commit/fa74af7f50563b79c069c7f713b7082c33e0b0ad

So if you have other .vik files going wrong, try opening the .vik file with a plain text editor - e.g. gedit, emacs, geany, notepad++, etc... and see if there matching '~TopLayer' and '~EndTopLayer' lines - and manually add the final '~EndTopLayer' line if it is missing.

Finally, if you are running Linux - you might be able to run Viking under the debugger and get a stack trace of where it is going wrong. But typically if using a Linux Distribution with pre supplied binary programs - the debugging information is stripped and so a trace of the program going wrong doesn't yield that much information.

HTH.