News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

[Segfault] create a new map with trees and forests

Started by Phystam, April 17, 2022, 04:31:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Phystam

Creation of a new map with trees and forests seems to be broken currently.
A backtrace shows that it is caused by tree_builder_t::fill_trees().

jamespetts

Thank you for your report. Can I check whether this always occurs with any given map generation involving any trees, or only occasionally?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

Although those codes were brought from the standard by ceeac a few months ago, the standard and the code look almost the same.
Since there are many commits in extended that have not yet been incorporated, such as climate patches and tree offset, there may be many inconsistencies that are not visualized.
I'm not familiar with those specs so I don't know how tied tree planting to climate patches.

However, as far as I tested with small map generation, map generation with tree planting was possible.
Basically, I only report bugs occasionally, never provide patches for new features.
I may only work on fixing bugs that are caused by Ranran.
Fork of simutrans extended for Jalápagos is here.

Phystam

I tried to create a new map with this .ppm file:
https://cdn.discordapp.com/attachments/965943187946475541/965943292107849758/philip125.zip
Please make sure that this file can reproduce the segfault.
settings:
 load option: legacy(small height)
 sea level=-11

DrSuperGood

As a rough guess it looks like the function does not do sanity checks on arguments for if the provided map area to fill exists. As such I would recommend checking the arguments it is being passed if they make sense and are not off by 1.

jamespetts

Thank you for the report, and especially to Phystam for the reliable reproduction case. I believe that I have now fixed this - I should be grateful if you could test with to-morrow's nightly build.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Phystam

Thank you, I have confirmed that the problem is fixed.