News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

[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.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

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.