Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex, DotBot, Bing

Members: 0
Guests: 5
Stats
Files
Topics
Posts
Members
Newest Member
481
3,734
19,366
618
Micheal64X
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Smaug Snippets » Weather System crash do_showw...
Forum Rules | Mark all | Recent Posts

Weather System crash do_showweather
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Mar 21, 2008, 11:03 pm   Last edited Mar 21, 2008, 11:25 pm by Llarn
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

This crash happens from my staff doing doing showweather 3 3
x and y are default at 3 in weather.h like the snippet had it set.

#0 mudstrlcat (dst=0x6b <Address 0x6b out of bounds>, src=0x63656863 <Address 0x63656863 out of bounds>, siz=8192)
at db.c:7089
7089 db.c: No such file or directory.
in db.c
(gdb) bt
#0 mudstrlcat (dst=0x6b <Address 0x6b out of bounds>, src=0x63656863 <Address 0x63656863 out of bounds>, siz=8192)
at db.c:7089
#1 0x080b5ead in flag_string (bitvector=-2, flagarray=0x8200b58) at build.c:311
#2 0x0818cb81 in do_showweather (ch=0xab77a98, argument=0x2000 <Address 0x2000 out of bounds>;) at weather.c:3156
#3 0x081137e1 in interpret (ch=0xab77a98, argument=0xbfffb41c "3 3";) at interp.c:537
#4 0x080de0e9 in game_loop () at comm.c:1289
#5 0x080dd829 in main (argc=6, argv=0xbfffbc40) at comm.c:857
Current language: auto; currently c++
(gdb) frame 0
#0 mudstrlcat (dst=0x6b <Address 0x6b out of bounds>, src=0x63656863 <Address 0x63656863 out of bounds>, siz=8192)
at db.c:7089
7089 in db.c
(gdb) print dst
$1 = 0x6b <Address 0x6b out of bounds>
(gdb) print src
$2 = 0x63656863 <Address 0x63656863 out of bounds>
(gdb) print siz
$3 = 8192

db.c 7089 is from the below function and a comment is on line in question
size_t mudstrlcat( char *dst, const char *src, size_t siz )

while( *s && *s != '\0' ) // this line right here is 7089
{
if( n != 1 )
{
*d++ = *s;
n--;
}
s++;
}

build.c line 311 points to this, there is a comment on the offending line.
char *flag_string(int bitvector, char *const flagarray[])
{
static char buf[MSL];
int x;

buf[0] = '\0';
for(x = 0; x < 32; x++)
if(IS_SET(bitvector, 1 << x))
{
mudstrlcat(buf, flagarray[x], MSL); // this is line 311



weather.c points to this line in showweather as being a problem
ch_printf_color( ch, "&WClimate: &w%s&D\r\n", flag_string( cell->climate, climate_names ) );

       
Post is unread #2 Mar 22, 2008, 9:28 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Noted, and being investigated.
       
Post is unread #3 Mar 23, 2008, 12:23 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

This looks like the problem:
	if( x < 1 && x > WEATHER_SIZE_X )
	{
		
		ch_printf( ch, "X value must be between 1 and %d.\r\n", WEATHER_SIZE_X );
		return;
	}	
		
	if( y < 1 && y > WEATHER_SIZE_Y )
	{
		
		ch_printf( ch, "Y value must be between 1 and %d.\r\n", WEATHER_SIZE_Y );
		return;
	}


The x and y variables cannot be both smaller than 1 *AND* larger than the maximum value at the same time. I think those checks should be || instead of &&
       
Post is unread #4 Mar 23, 2008, 7:34 pm
Go to the top of the page
Go to the bottom of the page

Llarn
Apprentice
GroupMembers
Posts63
JoinedNov 25, 2007

That fixed it thanks.

btw just curious, why Kayle went with setweather x y corridnates, instead of something like aset filename weathertype. I guess his system is more realistic, I was just thinking to simplify things.

       
Post is unread #5 Mar 23, 2008, 7:56 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

The point of my system was to make weather its own entity and instead of tying it to areas, tie areas to the weather.


Samson: Good catch. I didn't notice it.
       
Pages:<< prev 1 next >>