legacyclonk / LegacyClonk

The LegacyClonk engine and the c4group command line tool.
https://clonkspot.org/lc-en
Other
83 stars 18 forks source link

Error handling with checked_cast #78

Closed Somebodyisnobody closed 2 years ago

Somebodyisnobody commented 2 years ago

I was faced with an engine crash without crashdump or useful clonk.log. The crash was issued by a negative integer in the date-changed attribute of an Author.txt of a scenario my client was loading over the network. https://github.com/legacyclonk/LegacyClonk/blob/6a3b2437d79d6c19fe8c23b4e25da0a5ca6b8115/src/C4Group.cpp#L842

Only with some luck we discovered the issue. I reached 1. @Fulgen301, who was able to debug the whole thing and 2. reached the host via another communication channel to get him to host the scenario again. Without this we would have not found the issue.

In my eyes there is a todo with the error handling. The engine must never stop without any error message. At least a log entry should have to be written before exiting.

Fulgen301 commented 2 years ago

Fixed in 0e5cb2d7000050a1056ae0dbc21bdb294f663a7d.