CalculateCellToCellChanges Crash
< Newer Topic
:: Older Topic >
Pages:<< prev 1 next >>
#1 Jan 4, 2025 10:15 am
Geomancer
GroupAdministrators
Posts1,992
JoinedJul 26, 2005
==23630==ERROR: AddressSanitizer: global-buffer-overflow on address 0x555555e726bc at pc 0x555555b66740 bp 0x7fffffffd870 sp 0x7fffffffd860 READ of size 4 at 0x555555e726bc thread T0 #0 0x555555b6673f in CalculateCellToCellChanges() /home/remcon/smaugfuss/src/weather.c:767 #1 0x555555b6db07 in UpdateWeather() /home/remcon/smaugfuss/src/weather.c:1222 #2 0x555555b53b1a in update_handler() /home/remcon/smaugfuss/src/update.c:2073 #3 0x5555558b76cc in game_loop() /home/remcon/smaugfuss/src/comm.c:882 #4 0x5555558b51a4 in main /home/remcon/smaugfuss/src/comm.c:532 #5 0x7ffff734d1c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #6 0x7ffff734d28a in __libc_start_main_impl ../csu/libc-start.c:360 #7 0x5555556d3304 in _start (/home/remcon/smaugfuss/src/smaug+0x17f304) (BuildId: 27f8194789bedc4a8de853f30904b7a954c958ca) 0x555555e726bc is located 20 bytes after global variable 'weatherMap' defined in 'weather.c:90:20' (0x555555e72540) of size 360 0x555555e726bc is located 36 bytes before global variable 'weatherDelta' defined in 'weather.c:103:20' (0x555555e726e0) of size 360 SUMMARY: AddressSanitizer: global-buffer-overflow /home/remcon/smaugfuss/src/weather.c:767 in CalculateCellToCellChanges() Shadow bytes around the buggy address: 0x555555e72400: f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 0x555555e72480: f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 01 f9 f9 f9 0x555555e72500: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00 0x555555e72580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x555555e72600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x555555e72680: 00 00 00 00 00 f9 f9[f9]f9 f9 f9 f9 00 00 00 00 0x555555e72700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x555555e72780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x555555e72800: 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 0x555555e72880: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x555555e72900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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 ==23630==ABORTING [Inferior 1 (process 23630) exited with code 01]
So it doesn't seem to take to long on testing out smaugfuss to have this happen. The first crash came in less than 1 min on as admin. the next time it was more like 5 mins on as admin. And that one i had gdb in and thats all it shows.
#2 Jan 4, 2025 11:15 am
Black Hand
GroupAdministrators
Posts3,706
JoinedJan 1, 2002
That's due to a buffer overflow in the weather system. That hasn't been incorporated into the main SmaugFUSS release yet, but the changes have been committed here: https://github.com/Arthmoor/SmaugFUSS/commit/21e1aa14eae721bea060d512f6db3fffde478a89
#3 Jan 4, 2025 12:22 pm
Geomancer
GroupAdministrators
Posts1,992
JoinedJul 26, 2005
At least already have it found and figured out. fixed the logging in and it not showing the room name and top part of the compass on the first auto look?
all that is just all black then it finaly shows up tried a few times logging in it looks like that.
[Press Enter] Help level: 51 This is where you may post messages to imms only To edit it.. type hedit imotd then hset save Press [ENTER] Welcome to (Name Not Set)... Darkhaven Square [Exits: North East South West Up Northeast Northwest] +-----------+
all that is just all black then it finaly shows up tried a few times logging in it looks like that.
#4 Jan 4, 2025 1:01 pm
Black Hand
GroupAdministrators
Posts3,706
JoinedJan 1, 2002
I'm not entirely sure what causes the large empty space, but the display of the room map at the end is fixed locally and will be in the next update. Using your fix for the map.
#5 Jan 4, 2025 1:43 pm
Geomancer
GroupAdministrators
Posts1,992
JoinedJul 26, 2005
its like a blank screen where it does the press enter but the stuff there is just dark where it tells that its a help file and how to edit etc... probably just because no color has been set by that point yet. ill look in a sec on it.
#6 Jan 4, 2025 1:52 pm
Last edited Jan 4, 2025 1:52 pm by Remcon
Geomancer
GroupAdministrators
Posts1,992
JoinedJul 26, 2005
comm.c around line 2410 find
to this
Just adding the set_char_color( AT_PLAIN, ch ); before the do_help( ch, "imotd" ); fixes the login not showing characters that are there.
void nanny_press_enter( DESCRIPTOR_DATA * d, const char *argument ) { CHAR_DATA *ch; ch = d->character; if( chk_watch( get_trust( ch ), ch->name, d->host ) ) /* --Gorog */ SET_BIT( ch->pcdata->flags, PCFLAG_WATCH ); else REMOVE_BIT( ch->pcdata->flags, PCFLAG_WATCH ); set_pager_color( AT_PLAIN, ch ); if( xIS_SET( ch->act, PLR_RIP ) ) send_rip_screen( ch ); if( xIS_SET( ch->act, PLR_ANSI ) ) send_to_pager( "\033[2J", ch ); else send_to_pager( "\014", ch ); if( IS_IMMORTAL( ch ) ) do_help( ch, "imotd" ); if( ch->level == LEVEL_AVATAR ) do_help( ch, "amotd" ); if( ch->level < LEVEL_AVATAR && ch->level > 0 ) do_help( ch, "motd" ); if( ch->level == 0 ) do_help( ch, "nmotd" ); send_to_pager( "\r\nPress [ENTER] ", ch ); d->connected = CON_READ_MOTD; }
to this
void nanny_press_enter( DESCRIPTOR_DATA * d, const char *argument ) { CHAR_DATA *ch; ch = d->character; if( chk_watch( get_trust( ch ), ch->name, d->host ) ) /* --Gorog */ SET_BIT( ch->pcdata->flags, PCFLAG_WATCH ); else REMOVE_BIT( ch->pcdata->flags, PCFLAG_WATCH ); set_pager_color( AT_PLAIN, ch ); if( xIS_SET( ch->act, PLR_RIP ) ) send_rip_screen( ch ); if( xIS_SET( ch->act, PLR_ANSI ) ) send_to_pager( "\033[2J", ch ); else send_to_pager( "\014", ch ); set_char_color( AT_PLAIN, ch ); if( IS_IMMORTAL( ch ) ) do_help( ch, "imotd" ); if( ch->level == LEVEL_AVATAR ) do_help( ch, "amotd" ); if( ch->level < LEVEL_AVATAR && ch->level > 0 ) do_help( ch, "motd" ); if( ch->level == 0 ) do_help( ch, "nmotd" ); send_to_pager( "\r\nPress [ENTER] ", ch ); d->connected = CON_READ_MOTD; }
Just adding the set_char_color( AT_PLAIN, ch ); before the do_help( ch, "imotd" ); fixes the login not showing characters that are there.
Pages:<< prev 1 next >>