News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

[r9274] Error when expending the map.

Started by Mishasama, October 11, 2020, 08:16:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mishasama

pak 121 r2044 w/o addon
Added both the old sqai and the new sqai_rail.
Because of some reason. I am looking for volunteers who can help me update the Pak64.Nightly.

I'm helping to build the Chinese community for now.
如果您是使用中文的玩家,歡迎到這裏尋找同好或張貼您們組織的聯係方式。
如果你是中文玩家,欢迎来这个帖子里找组织或者贴出你们的联系方式。

prissi

This is not Scripterror, so I am not sure if this is due to the AI. Which climate generator did you use?

Mishasama

Quote from: prissi on October 11, 2020, 11:54:44 PM
This is not Scripterror, so I am not sure if this is due to the AI. Which climate generator did you use?
You guess right, the new humidity generator.
100% reproduce.
Because of some reason. I am looking for volunteers who can help me update the Pak64.Nightly.

I'm helping to build the Chinese community for now.
如果您是使用中文的玩家,歡迎到這裏尋找同好或張貼您們組織的聯係方式。
如果你是中文玩家,欢迎来这个帖子里找组织或者贴出你们的联系方式。

prissi

Halfway fixed in r9278. However, rotated map will not treated correctly (so we need to add anyway wind directions for this ...)

I noted that new rivers spawn everywhere, no only in new parts of the map.

Mishasama

Quote from: prissi on October 12, 2020, 01:36:08 PM
Halfway fixed in r9278. However, rotated map will not treated correctly (so we need to add anyway wind directions for this ...)

I noted that new rivers spawn everywhere, no only in new parts of the map.
r9278
It looks like something wrong.
Because of some reason. I am looking for volunteers who can help me update the Pak64.Nightly.

I'm helping to build the Chinese community for now.
如果您是使用中文的玩家,歡迎到這裏尋找同好或張貼您們組織的聯係方式。
如果你是中文玩家,欢迎来这个帖子里找组织或者贴出你们的联系方式。

ceeac

Also, the game still crashes when expanding the map in both x and y direction:

=================================================================
==4203==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x631000038800 at pc 0x0000010f47ec bp 0x7ffdf2e83bf0 sp 0x7ffdf2e83be8
READ of size 4 at 0x631000038800 thread T0
    #0 0x10f47eb in karte_t::calc_climate_map_region(short, short, short, short) /home/ceeac/Projects/code/simutrans/simworld.cc:6190:66
    #1 0x10e997d in karte_t::enlarge_map(settings_t const*, signed char const*) /home/ceeac/Projects/code/simutrans/simworld.cc:1960:3
    #2 0x8dfc61 in enlarge_map_frame_t::action_triggered(gui_action_creator_t*, value_t) /home/ceeac/Projects/code/simutrans/gui/enlarge_map_frame_t.cc:151:9
    #3 0x8dfe53 in non-virtual thunk to enlarge_map_frame_t::action_triggered(gui_action_creator_t*, value_t) /home/ceeac/Projects/code/simutrans/gui/enlarge_map_frame_t.cc
    #4 0x7c57f1 in gui_action_creator_t::call_listeners(value_t) /home/ceeac/Projects/code/simutrans/gui/components/gui_action_creator.h:32:11
    #5 0x7cafa1 in button_t::infowin_event(event_t const*) /home/ceeac/Projects/code/simutrans/gui/components/gui_button.cc:276:4
    #6 0x7e7f27 in gui_container_t::infowin_event(event_t const*) /home/ceeac/Projects/code/simutrans/gui/components/gui_container.cc:201:23
    #7 0x9156e9 in gui_frame_t::infowin_event(event_t const*) /home/ceeac/Projects/code/simutrans/gui/gui_frame.cc:132:34
    #8 0xa8cbf7 in check_pos_win(event_t*) /home/ceeac/Projects/code/simutrans/gui/simwin.cc:1521:20
    #9 0xfd3055 in interaction_t::process_event(event_t&) /home/ceeac/Projects/code/simutrans/siminteraction.cc:366:5
    #10 0xfd3b92 in interaction_t::check_events() /home/ceeac/Projects/code/simutrans/siminteraction.cc:439:7
    #11 0x1140c37 in karte_t::interactive(unsigned int) /home/ceeac/Projects/code/simutrans/simworld.cc:7167:17
    #12 0xff0356 in simu_main(int, char**) /home/ceeac/Projects/code/simutrans/simmain.cc:1472:9
    #13 0x122a54f in sysmain(int, char**) /home/ceeac/Projects/code/simutrans/sys/simsys.cc:1098:9
    #14 0x12b8741 in main /home/ceeac/Projects/code/simutrans/sys/simsys_s2.cc:790:9
    #15 0x7f98765970b2 in __libc_start_main /build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:308:16
    #16 0x42696d in _start (/media/ceeac/Projects/code/simutrans/build/default/sim+0x42696d)

0x631000038800 is located 0 bytes to the right of 65536-byte region [0x631000028800,0x631000038800)
allocated by thread T0 here:
    #0 0x4ce92d in operator new[](unsigned long) (/media/ceeac/Projects/code/simutrans/build/default/sim+0x4ce92d)
    #1 0x10f40e2 in karte_t::calc_climate_map_region(short, short, short, short) /home/ceeac/Projects/code/simutrans/simworld.cc:6172:34
    #2 0x10e997d in karte_t::enlarge_map(settings_t const*, signed char const*) /home/ceeac/Projects/code/simutrans/simworld.cc:1960:3
    #3 0x8dfc61 in enlarge_map_frame_t::action_triggered(gui_action_creator_t*, value_t) /home/ceeac/Projects/code/simutrans/gui/enlarge_map_frame_t.cc:151:9
    #4 0x8dfe53 in non-virtual thunk to enlarge_map_frame_t::action_triggered(gui_action_creator_t*, value_t) /home/ceeac/Projects/code/simutrans/gui/enlarge_map_frame_t.cc
    #5 0x7c57f1 in gui_action_creator_t::call_listeners(value_t) /home/ceeac/Projects/code/simutrans/gui/components/gui_action_creator.h:32:11
    #6 0x7cafa1 in button_t::infowin_event(event_t const*) /home/ceeac/Projects/code/simutrans/gui/components/gui_button.cc:276:4
    #7 0x7e7f27 in gui_container_t::infowin_event(event_t const*) /home/ceeac/Projects/code/simutrans/gui/components/gui_container.cc:201:23
    #8 0x9156e9 in gui_frame_t::infowin_event(event_t const*) /home/ceeac/Projects/code/simutrans/gui/gui_frame.cc:132:34
    #9 0xa8cbf7 in check_pos_win(event_t*) /home/ceeac/Projects/code/simutrans/gui/simwin.cc:1521:20
    #10 0xfd3055 in interaction_t::process_event(event_t&) /home/ceeac/Projects/code/simutrans/siminteraction.cc:366:5
    #11 0xfd3b92 in interaction_t::check_events() /home/ceeac/Projects/code/simutrans/siminteraction.cc:439:7
    #12 0x1140c37 in karte_t::interactive(unsigned int) /home/ceeac/Projects/code/simutrans/simworld.cc:7167:17
    #13 0xff0356 in simu_main(int, char**) /home/ceeac/Projects/code/simutrans/simmain.cc:1472:9
    #14 0x122a54f in sysmain(int, char**) /home/ceeac/Projects/code/simutrans/sys/simsys.cc:1098:9
    #15 0x12b8741 in main /home/ceeac/Projects/code/simutrans/sys/simsys_s2.cc:790:9
    #16 0x7f98765970b2 in __libc_start_main /build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:308:16

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/ceeac/Projects/code/simutrans/simworld.cc:6190:66 in karte_t::calc_climate_map_region(short, short, short, short)
Shadow bytes around the buggy address:
  0x0c627ffff0b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c627ffff0c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c627ffff0d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c627ffff0e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c627ffff0f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c627ffff100:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c627ffff110: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c627ffff120: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c627ffff130: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c627ffff140: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c627ffff150: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==4203==ABORTING

prissi

It works for me, also in both diredctions. Even mores since Simutrans checks the size of teh arrays for out of bound access. Also an overlow by 0 bytes is a strange error message. (Although there could be certainly more errors.)

Also I see just two entries in the Combobox.

Mishasama

Quote from: prissi on October 13, 2020, 01:51:18 PM
Also I see just two entries in the Combobox.
It only happens after starting the game then click new game.

And another problem...
Because of some reason. I am looking for volunteers who can help me update the Pak64.Nightly.

I'm helping to build the Chinese community for now.
如果您是使用中文的玩家,歡迎到這裏尋找同好或張貼您們組織的聯係方式。
如果你是中文玩家,欢迎来这个帖子里找组织或者贴出你们的联系方式。

Dwachs

I cannot reproduce any bad behavior either.

@ceaac: can you upload a savegame, where this fails?
Parsley, sage, rosemary, and maggikraut.

ceeac

Not needed - I managed to fix the crash myself already. :) The issue was only present when expanding the map in both directions at the same time.

Dwachs

Thanks! I could not reproduce this since the climate-generator setting is not saved in the savegame, which is a bug of its own.

Edit: should be fixed in r9218.
Parsley, sage, rosemary, and maggikraut.