The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Yona-TYT on February 14, 2026, 01:15:58 AM

Title: Segmentation Fault for desc = NULL
Post by: Yona-TYT on February 14, 2026, 01:15:58 AM
There was a bug when trying to get a waytype = 6, because in pak64 this object does not exist, this is in reference to my other patch to get the last way/track used by the player: https://forum.simutrans.com/index.php/topic,23813.msg212102/topicseen.html#msg212102

0001-Fix-Segmentation-Fault-for-desc-NULL.patch
Title: Re: Segmentation Fault for desc = NULL
Post by: prissi on February 14, 2026, 03:04:40 AM
NUll should be a valid return paramter for non-existing ways.
Title: Re: Segmentation Fault for desc = NULL
Post by: Yona-TYT on February 14, 2026, 03:50:54 AM
Quote from: prissi on February 14, 2026, 03:04:40 AMNUll should be a valid return paramter for non-existing ways.
Now I understand better, thank you.  8)
Title: Re: Segmentation Fault for desc = NULL
Post by: prissi on February 14, 2026, 12:46:27 PM
How did you end up seeing this? It should be impossible to build ways not defined in the pak since the init function of the waybuilder fails.
Title: Re: Segmentation Fault for desc = NULL
Post by: Yona-TYT on February 14, 2026, 05:25:31 PM
Quote from: prissi on February 14, 2026, 12:46:27 PMHow did you end up seeing this? It should be impossible to build ways not defined in the pak since the init function of the waybuilder fails.
It was my mistake in the patch; I was sending a NULL descriptor when the package didn't contain the object.

I've tested your new implementation, and this error is now resolved here: https://github.com/simutrans/simutrans/commit/8b1f98d8dfa171825d10af8cd110e4020b0a5095