Server down.

Issues, news, and discussion specific to the PWMangband variant.
Hades
Giant Mottled Ant Lion
Posts: 218
Joined: Tue 14.12.2004, 22:39

Server down.

Post by Hades » Thu 27.09.2007, 21:01

Well,
   I have encountered the same problem again... I need to delete the server savefile to fix it. But this is a very very severe problem that needs to be fixed. Honestly I'm getting tired of this and if it happens again. I won't be hosting it anymore until a fix is made. No point in running a server if I have to delete the server savefile every week... So i'll do it one more time, after that I don't know what to tell you.
PWMAngband Host - Check out http://www.mangband.org/forum/viewforum.php?f=9 and download the client, server, lib files, sound fx patch and even the source code for this new variant!

Hades
Giant Mottled Ant Lion
Posts: 218
Joined: Tue 14.12.2004, 22:39

Re: Server down.

Post by Hades » Sat 29.09.2007, 18:32

Well,
  This is my third time experienceing this same bug... It really needs a fix and there is no point in hosting a server if I have to delete the server savefile every week.

So if you think you can help fix this. Read the topic in

http://www.mangband.org/cgi-bin/yabb/Ya ... 1191010175

If you don't mind playing on a server where I have to delete the server savefile maybe once a week then just post here and I'll put it back up for you. But this is your warning if you want to.

You can not own any houses for if you do if I have to delete the server savefile they will be gone. So just post here if you want it up and I'll put it up. Not worth it if noone wants to play on it.

Hopfully this issue will be resolved soon.
PWMAngband Host - Check out http://www.mangband.org/forum/viewforum.php?f=9 and download the client, server, lib files, sound fx patch and even the source code for this new variant!

PowerWyrm
Balrog
Posts: 1574
Joined: Sun 27.11.2005, 15:57

Re: Server down.

Post by PowerWyrm » Sun 30.09.2007, 10:28

Did you already delete the server savefile? I think to have an idea of the problem we should do a little experimenting with that server savefile. Since the file is a text file (it's totally readable...), we could do the following:
- save the server savefile somewhere and remove it from the /save directory
- generate a new town
- add the elements of the old savefile one by one until the problem is reproduced
In particular, the following should be investigated:
- <monster_lore>
- <artifacts>
- <stores>
- <parties>
- <dungeon_levels>
- <monsters>
- <objects>
- <houses>
- <wilderness>
- <player_names>

At least, to be able to restart the server without losing the most important information, the <houses> part, seed_flavor and seed_town should be imported from the bugged server savefile.

Billsey
King Vampire
Posts: 272
Joined: Sun 12.02.2006, 14:36
Location: Oregon, USA
Contact:

Re: Server down.

Post by Billsey » Sun 30.09.2007, 12:38

While going through save files last night, I found a number of instances in the save code where a s16b number was written using the write_uint() function instead of the write_int() function. Though this doesn't really seem like it would cause problems (you should get 0xFFFFFFFF for dungeon depth at -50', which when read into a s16b is -1) I changed them anyway.
Mangband Project Team Member

Hades
Giant Mottled Ant Lion
Posts: 218
Joined: Tue 14.12.2004, 22:39

Re: Server down.

Post by Hades » Sun 30.09.2007, 17:26

I still have the server savefile yes. I'll do what you say Power and see what turns up. And I don't know much about C/C++ (Just some basic crap) So not sure if I wanna go messing around with what Bill said.
PWMAngband Host - Check out http://www.mangband.org/forum/viewforum.php?f=9 and download the client, server, lib files, sound fx patch and even the source code for this new variant!

Berendol
Evil Iggy
Posts: 868
Joined: Mon 11.11.2002, 19:13
Location: Loot Pile
Contact:

Re: Server down.

Post by Berendol » Sun 30.09.2007, 20:50

Why not upload your savefile somewhere, so the experts can give it a peek?

By the way, MAngband is straight C. Go ahead and tweak, but remember to back up things often and change the save AND load routines.

Tip: To alter an existing savefile's structure you should tweak the save function, recompile, run server, close server, tweak the load function, and recompile. By recompile, I mean to simply 'make' the game, don't 'make clean'.
By appreciation, we make excellence in others our own property. (Voltaire)

Hades
Giant Mottled Ant Lion
Posts: 218
Joined: Tue 14.12.2004, 22:39

Re: Server down.

Post by Hades » Sun 30.09.2007, 21:15

I've uploaded the server savefile onto here.


Geocities wouldn't let me upload it as plain "server" name so I renamed it "server.txt" so it would upload

http://www.geocities.com/thesectt/server.txt

Take a peek...

Thank you Berendol for the suggestion =).
PWMAngband Host - Check out http://www.mangband.org/forum/viewforum.php?f=9 and download the client, server, lib files, sound fx patch and even the source code for this new variant!

PowerWyrm
Balrog
Posts: 1574
Joined: Sun 27.11.2005, 15:57

Re: Server down.

Post by PowerWyrm » Mon 01.10.2007, 13:20

Ok... toying around with that server savefile, I narrowed the problem to the <stores> section...
Starting from a fresh server savefile and importing everything from the corrupted savefile except the <stores> section works fine. As soon as I put that section back the server crashes or freezes...
The problem must be an item in a shop that the game doesn't like...
More to come...

PowerWyrm
Balrog
Posts: 1574
Joined: Sun 27.11.2005, 15:57

Re: Server down.

Post by PowerWyrm » Mon 01.10.2007, 16:08

Found the problem...
The bug happens when someone sells a random artifact in a shop... when the artifact is removed from the shop, the server freezes/crashes.
I'll take a look at the source code to see what could be the cause...

Fink
Ancient MultiHued Dragon
Posts: 614
Joined: Tue 20.01.2004, 13:55

Re: Server down.

Post by Fink » Mon 01.10.2007, 20:46

PW, did this apear to be in your own code, or does it drift into preexisting stuff too?

PowerWyrm
Balrog
Posts: 1574
Joined: Sun 27.11.2005, 15:57

Re: Server down.

Post by PowerWyrm » Tue 02.10.2007, 11:56

Since it concerns random artifacts it doesn't appear in preexisting code.
I made further testing and still couldn't fix the thing. The server simply freezes when a random artifact is sold in a shop... it would require a debug mode to trap the timeout errors. I'll investigate more...

Hades
Giant Mottled Ant Lion
Posts: 218
Joined: Tue 14.12.2004, 22:39

Re: Server down.

Post by Hades » Tue 02.10.2007, 12:47

Well,
  Knowing this new information I am going to put the server back up, but the random artifacts will be disabled untill a fix is made. I will renew the store section so hopfully your houses will still be there. I don't have an obsurd amount of time to do so now but by tonight PWMAngband will be up without random artifacts.

I will use the original savefile from when the problem first happened. If I still have it not sure if I deleted it or not.

Thanks
PWMAngband Host - Check out http://www.mangband.org/forum/viewforum.php?f=9 and download the client, server, lib files, sound fx patch and even the source code for this new variant!

Berendol
Evil Iggy
Posts: 868
Joined: Mon 11.11.2002, 19:13
Location: Loot Pile
Contact:

Re: Server down.

Post by Berendol » Tue 02.10.2007, 15:51

Don't forget about gdb, PowerWyrm! gdb can save your whole week.

I'm very curious to see what happens with this one.
By appreciation, we make excellence in others our own property. (Voltaire)

PowerWyrm
Balrog
Posts: 1574
Joined: Sun 27.11.2005, 15:57

Re: Server down.

Post by PowerWyrm » Tue 02.10.2007, 16:02

RAAAAAAAH!
I finally found the stupid bug!!!!
Using the buggy server savefile and putting some debug code, I found that calls to rand_int in the apply_magic function were always yielding a result of 0!!! No wonder why the server froze... for example there was something like

while (rand_int(10)==0) count++;

in that function which resulted in an endless loop.
So I looked for something related to randarts that was damn the RNG up... and I found this marvelous bug in randart.c:

/* Set the RNG seed. */
Rand_value = o_ptr->name3;
Rand_quick = TRUE;

...

/* Restore RNG */
Rand_quick = FALSE;

The problem is that if the RNG was defined as "quick" prior to the call to the randart function, it is erroneously restored!
So I fixed the function as follows:

     /* save the RNG */
     tmp_seed = Rand_value;
     rand_old = Rand_quick;

     /* Set the RNG seed. */
     Rand_value = o_ptr->name3;
     Rand_quick = TRUE;

     ...

     /* Restore RNG */
     Rand_value = tmp_seed;
     Rand_quick = rand_old;

... and now the server doesn't crash anymore!!!

Hades
Giant Mottled Ant Lion
Posts: 218
Joined: Tue 14.12.2004, 22:39

Re: Server down.

Post by Hades » Tue 02.10.2007, 16:23

Awesome, If you wouldn't mind e-mailing it to me I can throw the server back up with randarts enabled =).

Since I still have the stupid pre-compiled version I can't slap the fix in myself hehe.
PWMAngband Host - Check out http://www.mangband.org/forum/viewforum.php?f=9 and download the client, server, lib files, sound fx patch and even the source code for this new variant!

Post Reply