Request: Precompiled Win32 CF server

Technical and coding related questions.

Moderator: Board moderators

EmperorBMA
Luser
Posts: 37
Joined: Sun Sep 14, 2003 4:58 am

Post by EmperorBMA »

Now this is why I love Dr. MinGW...


It looks kind of like an out of bounds array error to me, and this problem would affect the CVS unless someone has already fixed it.

The error is here:

Code: Select all

crossfire32.exe caused an Access Violation at location 004dfd17 in module crossfire32.exe Reading from location 01f63d72.

Registers:
eax=0059d954 ebx=7ffdf000 ecx=01428a50 edx=00000014 esi=00000018 edi=0012f1b0
eip=004dfd17 esp=0012f14c ebp=0012f1b0 iopl=0         nv up ei ng nz na po cy
cs=001b  ss=0023  ds=0023  es=0023  fs=0038  gs=0000             efl=00000287

Call stack:
004DFD17  crossfire32.exe:004DFD17  _set_ring_bonus  treasure.c:676
	...
	    if (val>35) val=35;/* Upper limit */
	    b=0;
>	    while (op->resist[resist_table[resist]]!=0 && b<4) {
	resist=RANDOM() % num_resist_table;
	    }
	...

004E05F2  crossfire32.exe:004E05F2  _fix_generated_item  treasure.c:869
	...
	if ( ! (flags & GT_ONLY_GOOD) && ! (RANDOM() % 3))
	    SET_FLAG(op, FLAG_CURSED);
>	set_ring_bonus(op,QUERY_FLAG(op, FLAG_CURSED)?-DICE2:DICE2);
	if(op->type!=RING) /* Amulets have only one ability */
	    break;
	...

004DEF3F  crossfire32.exe:004DEF3F  _create_all_treasures  treasure.c:342
	...
	        if(t->nrof&&tmp->nrof<=1)
	          tmp->nrof = RANDOM()%((int) t->nrof) + 1;
>	        fix_generated_item (tmp, op, difficulty, t->magic, flag);
	        change_treasure(t, tmp);        
	        put_treasure (tmp, op, flag);
	...

004DF5EF  crossfire32.exe:004DF5EF  _create_treasure  treasure.c:412
	...
	create_one_treasure(t, op, flag,difficulty, tries);
	    else
>	  create_all_treasures(t->items, op, flag, difficulty, tries);
	}
	
	...

004DF665  crossfire32.exe:004DF665  _generate_treasure  treasure.c:424
	...
	object *ob = get_object(), *tmp;
	
>	create_treasure(t, ob, 0, difficulty, 0);
	
	/* Don't want to free the object we are about to return */
	...

0041FAC8  crossfire32.exe:0041FAC8  _auto_apply  apply.c:3149
	...
	i=10; /* let's give it 10 tries */
	while((tmp=generate_treasure(op->randomitems,
>	     op->stats.exp?op->stats.exp:MAX(op->map->difficulty, 5)))==NULL&&--i);
	if(tmp==NULL)
	    return 0;
	...

0041FF68  crossfire32.exe:0041FF68  _fix_auto_apply  apply.c:3224
	...
	
	if(QUERY_FLAG(tmp,FLAG_AUTO_APPLY))
>	    auto_apply(tmp);
	else if((tmp->type==TREASURE || (tmp->type==CONTAINER))&& HAS_RANDOM_ITEMS(tmp)) {
	    while ((tmp->stats.hp--)>0)
	...

004CB5A6  crossfire32.exe:004CB5A6  _ready_map_name  map.c:1321
	...
	    return (NULL);
	
>	(*fix_auto_apply_func)(m); /* Chests which open as default */
	
	/* If a player unique map, no extra unique object file to load.
	...

0044C5F0  crossfire32.exe:0044C5F0  _enter_exit  main.c:646
	...
	    mapstruct*newmap;
	    if (exit_ob->map) {
>	newmap = ready_map_name(normalize_path(exit_ob->map->path, EXIT_PATH(exit_ob)), 0);
	/* Random map was previously generated, but is no longer about.  Lets generate a new
	 * map.
	...

0041BAF1  crossfire32.exe:0041BAF1  _manual_apply  apply.c:2221
	...
	if (tmp->msg && strncmp(EXIT_PATH(tmp),"/!",2) && strncmp(EXIT_PATH(tmp), "/random/", 8))
	    new_draw_info (NDI_NAVY, 0, op, tmp->msg);
>	enter_exit(op,tmp);
	    }
	    return 1;
	...

0041D81F  crossfire32.exe:0041D81F  _player_apply  apply.c:2410
	...

	    pl->contr->last_used_id = op->count;
	
>	    tmp = manual_apply (pl, op, aflag);
	    if ( ! quiet) {
	        if (tmp == 0)
	...

0041D9CA  crossfire32.exe:0041D9CA  _player_apply_below  apply.c:2453
	...
	            || QUERY_FLAG (tmp, FLAG_FLY_ON))
	        {
>	            if (player_apply (pl, tmp, 0, 1) == 1)
	                return;
	        }
	...

004329A7  crossfire32.exe:004329A7  _command_apply  c_object.c:468
	...
	{
	  if (!params) {
>	    player_apply_below(op);
	    return 0;
	  }
	...

0043223F  crossfire32.exe:0043223F  _execute_newserver_command  c_new.c:112
	...
	LOG(llevDebug,"execute_newclient_command: Player issued command that takes more time than he has left.\n");
	    }
>	    return csp->func(pl, cp);
	}
	
	...

0040F2FF  crossfire32.exe:0040F2FF  _NewPlayerCmd  request.c:424
	...
	    }
	    /* In c_new.c */
>	    execute_newserver_command(pl->ob, command);
	    /* Perhaps something better should be done with a left over count.
	     * Cleaning up the input should probably be done first - all actions
	...

0040BB14  crossfire32.exe:0040BB14  _HandleClient  loop.c:366
	...
	    if (strcmp((char*)ns->inbuf.buf+2,plcommands[i].cmdname)==0) {
	if (pl->state == ST_PLAYING || plcommands[i].flag == 0)
>	    plcommands[i].cmdproc((char*)data,len,pl);
	ns->inbuf.len=0;
	return;
	...

0040C674  crossfire32.exe:0040C674  _doeric_server  loop.c:621
	...
	}
	else {
>	    HandleClient(&pl->socket, pl);
	    /* If the player has left the game, then the socket status
	     * will be set to this be the leave function.  We don't
	...

0044EC8D  crossfire32.exe:0044EC8D  _main  main.c:1176
	...
	
	    doeric_server();
>	    process_events(NULL);    /* "do" something with objects with speed */
	    cftimer_process_timers();/* Process the crossfire Timers */    
	    /* GROS : Here we handle the CLOCK global event */
	...

004F2E9C  crossfire32.exe:004F2E9C  _mainCRTStartup  crt0.c:206
77E9CA90  KERNEL32.dll:77E9CA90  CreateProcessW
Ryo
Forum Fanatic
Posts: 752
Joined: Mon May 19, 2003 9:16 pm
Location: Paris, France

Post by Ryo »

EmperorBMA wrote:VC++, thanks Ryo-san. Bow.
*bows*
douitashimashite :)

EmperorBMA wrote:It was a complete success... and what do you know, mine crashes too!!!

You know I should probably test and see if its the weather algo or something... (Can't be, weather is set to 0)
If random crash, i think that's a bug in attack.h, change #define number of attacks from 21 to 20....
EmperorBMA wrote:P.S. I compiled mine with Python 2.3 installed (It compiled in, I hope)...
You can compile with Python, but it'll prolly crash if you apply a casino machine in Goth's tavern... Compilation is fine but not running :)
If you feel like fixing (too lazy here for now), it's because some functions are called directly from plugin code where it should be called through hook...
Ryo
Forum Fanatic
Posts: 752
Joined: Mon May 19, 2003 9:16 pm
Location: Paris, France

Post by Ryo »

Didn't see your post with Dr Mingw's output.
Definitely that attack.h #define that is wrong :)
(hint: array is only 20 items large...)
EmperorBMA
Luser
Posts: 37
Joined: Sun Sep 14, 2003 4:58 am

Post by EmperorBMA »

My server still crashes, so it only fixed part of the problem. Indeed, I need to see if I can narrow it down some more.

Unfortunately, I am cut off from my computer (using one of my class rooms), so I cannot test this any further until 4:00 or 5:00 my time (it's 2:00).

P.S. Python obviously didn't compile in because I don't see a slot machine at all...
Ryo
Forum Fanatic
Posts: 752
Joined: Mon May 19, 2003 9:16 pm
Location: Paris, France

Post by Ryo »

EmperorBMA wrote:P.S. Python obviously didn't compile in because I don't see a slot machine at all...
Presence of slot maching isn't based on Python presence or not...
Maybe they appear only in bigworld maps?
Or I mistook in the map's name...
It's in one of Scorn's tavern, where you find the ambassador for dragon quest.
EmperorBMA
Luser
Posts: 37
Joined: Sun Sep 14, 2003 4:58 am

Post by EmperorBMA »

I know its in Scorn Tavern. That's where I was.

Anyway, I am using BigWorld with the CVS server. I will soon use the scfclient if I can get gros's package to compile, which should hopefully alleviate any client problems if any...

I need to see what my clientlog says when it crashes, anyway. I didn't keep track of that...
-- Ride on Shooting Star... :)

Teiou-sensei lesson 9: Mobs, they arent trying to light your cigar.
Avion
Senior member
Posts: 301
Joined: Tue Jun 03, 2003 1:16 am
Location: Canada
Contact:

Post by Avion »

If python is working you will see an orange message saying 'no mail...' when you log in, and if you look in the var directory you will see the data storage files for the logger and stuff. You can also try speaking to the guy at the front of goths tavern - he should be able to tell you if he has 'seen' a player and when. The bigworld maps in CVS have the slotmachines in goths where the 1.5.0 maps do not. I am putting in more maps with the banking stuff soon too. If you have the older maps try going to /unlinked/ImperialPost/IPO and speaking to Collette - does this crash the server too? How about the post office functions? Do they work? Does the sever give any python exceptions or is it a blackhole? If you unload the plugin in the game the slots shouldn't crash the server anymore.
EmperorBMA
Luser
Posts: 37
Joined: Sun Sep 14, 2003 4:58 am

Post by EmperorBMA »

It ain't compiled in then....


Gotta try again. I'll look at Daimonin sources too, because it requires Python...
-- Ride on Shooting Star... :)

Teiou-sensei lesson 9: Mobs, they arent trying to light your cigar.
Eriwal
Luser
Posts: 19
Joined: Tue Sep 16, 2003 7:24 am

Post by Eriwal »

Ryo -- I've been trying to run the CF server but it refuses to get past the "Could not open var/temp.maps for reading" error. This is where it crashes (seg faults), so it's not a normal exit condition.

The error occurs after read_map_log() function, which executes and returns without error. Without being able to compile the code I can't test where the actual seg fault is occuring.

However, testing against the visible log outputs in the code shows that the crash occurs somewhere in init_beforeplay().
EmperorBMA
Luser
Posts: 37
Joined: Sun Sep 14, 2003 4:58 am

Post by EmperorBMA »

Odd, I never got that error. Do you have the CVS sources or the normal package?
-- Ride on Shooting Star... :)

Teiou-sensei lesson 9: Mobs, they arent trying to light your cigar.
Post Reply