PDA

View Full Version : Debian Lenny


Kobaz
11-06-2008, 06:34 AM
I've an old Intel STL2 server that has Lenny on it. I'm trying to build the server on it, but am having a lot of grief.

With both gcc 4.1 and 4.3 I get the following:

../common/crc32.cpp: In static member function static uint32 CRC32::Update(const int8*, uint32, uint32):
../common/crc32.cpp:238: error: PIC register bx clobbered in asm
make[1]: *** [../common/crc32.o] Error 1

I notice someone else had this error, and they fixed it, but they didn't say how.

I've tried to get current source via svn, using:

svn checkout http://projecteqemu.googlecode.com/svn/trunk/EQEmuServer

but this doesn't get me all the code, i.e. the ../common/* directory isn't there (or the parent Makefile, or heaps of other files).

Where am I stuffing up?

Kobaz
11-06-2008, 06:41 AM
BTW, the 1st error was for the 1129 tarball.

Derision
11-06-2008, 07:11 AM
To get the code from SVN:


svn checkout http://projecteqemu.googlecode.com/svn/trunk/ projecteqemu-read-only


The solution to your compilation problem is to downgrade to an older version of GCC. I know 4.1.1 works, as that is what I use on Gentoo.

Edit: I see you tried GCC 4.1, so I'm not sure what your problem is.

Angelox
11-06-2008, 07:33 AM
This actually is a 'rare' bug that will turn up under certain situations while compiling. I looked it up a while ago and tried to understand it. I have this problem on one of my machines, but it's not a big deal for me since it's not my server machine and i can still compile else where.
If you google 'PIC register bx clobbered in asm', you'll see what I mean.
This (http://lists.xensource.com/archives/html/xen-devel/2005-02/msg01040.html) is one example of this problem and how they solved it.

Line 112 in crc32.cpp seems to point to an earlier problem of this sort'
#undef i386 //darwin seems to think we are generating PIC, and we clobber ebx

I can downgrade my GCC to version 3.3.6 and this problem will go away, so it must be GCC related too.

I also noticed sometimes I would get one good compile, then it would start with the 'clobbered' BS.

kjaer_dk
11-06-2008, 02:29 PM
I was using a debian lenny install as well and the problem with thats is that you can not downgrade perl 5.10 to 5.8.8

http://www.eqemulator.net/forums/showthread.php?p=159583#post159583

Kobaz
11-06-2008, 04:25 PM
I'm no expert on asm coding by any means, but in crc32.cpp, why does the code go:


__asm __volatile (
"xorl %%ebx, %%ebx\n"
"movl %1, %%esi\n"

(cut many lines)

"xorl (%%edi,%%ebx,4), %%eax\n"
"2:\n"
:
: "a" (val), "g" (buf), "g" (bufsize)
: "bx", "cx", "dx", "si", "di"
);

return val;


instead of:



__asm __volatile (

"push %%ebx"

"xorl %%ebx, %%ebx\n"
"movl %1, %%esi\n"

(cut many lines)

"xorl (%%edi,%%ebx,4), %%eax\n"

"pop %%ebx"

"2:\n"
:
: "a" (val), "g" (buf), "g" (bufsize)
: "cx", "dx", "si", "di"
);

return val;



This bug has nothing to do with the Perl version btw.

Kobaz
11-06-2008, 04:46 PM
Fixed code seems to be:



__asm __volatile (

"push %%ebx\n"

"xorl %%ebx, %%ebx\n"
"movl %1, %%esi\n"

(cut many lines)

"xorl (%%edi,%%ebx,4), %%eax\n"

"2:\n"
"pop %%ebx\n"

:
: "a" (val), "g" (buf), "g" (bufsize)
: "cx", "dx", "si", "di"
);

return val;

Derision
11-06-2008, 04:53 PM
I'll test those changes out and incorporate them. I'll probably also get around to downloading the latest GCC and updating the source at some point so it compiles under it, as these issues come up on a fairly regular basis. Thanks.

Angelox
11-06-2008, 06:25 PM
Am I doing this right;
__asm __volatile (
"push %%ebx" //Kobaz
"xorl %%ebx, %%ebx\n"
"movl %1, %%esi\n"
"movl %2, %%ecx\n"
"movl $CRC32Table, %%edi\n"
"shrl $2, %%ecx\n"
"jz 1f\n"

".align 4\n"
"0:\n"
"movb %%al, %%bl\n"
"movl (%%esi), %%edx\n"
"shrl $8, %%eax\n"
"xorb %%dl, %%bl\n"
"shrl $8, %%edx\n"
"xorl (%%edi,%%ebx,4), %%eax\n"

"movb %%al, %%bl\n"
"shrl $8, %%eax\n"
"xorb %%dl, %%bl\n"
"shrl $8, %%edx\n"
"xorl (%%edi,%%ebx,4), %%eax\n"

"movb %%al, %%bl\n"
"shrl $8, %%eax\n"
"xorb %%dl, %%bl\n"
"movb %%dh, %%dl\n"
"xorl (%%edi,%%ebx,4), %%eax\n"

"movb %%al, %%bl\n"
"shrl $8, %%eax\n"
"xorb %%dl, %%bl\n"
"addl $4, %%esi\n"
"xorl (%%edi,%%ebx,4), %%eax\n"

"decl %%ecx\n"
"jnz 0b\n"

"1:\n"
"movl %2, %%ecx\n"
"andl $3, %%ecx\n"
"jz 2f\n"

"movb %%al, %%bl\n"
"shrl $8, %%eax\n"
"xorb (%%esi), %%bl\n"
"xorl (%%edi,%%ebx,4), %%eax\n"

"decl %%ecx\n"
"jz 2f\n"

"movb %%al, %%bl\n"
"shrl $8, %%eax\n"
"xorb 1(%%esi), %%bl\n"
"xorl (%%edi,%%ebx,4), %%eax\n"

"decl %%ecx\n"
"jz 2f\n"

"movb %%al, %%bl\n"
"shrl $8, %%eax\n"
"xorb 2(%%esi), %%bl\n"
"xorl (%%edi,%%ebx,4), %%eax\n"
"2:\n"
"pop %%ebx" //Kobaz
:
: "a" (val), "g" (buf), "g" (bufsize)
: "bx", "cx", "dx", "si", "di"
);

return val;
}

It still 'clobbers' on the clobber machine, and on the server where the code works I get 'Bad register name' error

Kobaz
11-06-2008, 07:25 PM
You have to change


: "bx", "cx", "dx", "si", "di"


to


: "cx", "dx", "si", "di"


as well as save and restore ebx

Angelox
11-06-2008, 07:42 PM
Ok, but now I get this;
../common/crc32.cpp:240: Error: bad register name `%ebxxorl %ebx'
../common/crc32.cpp:291: Error: bad register name `%ebx2:'


If you need a SSH to my machine so you can make tests, send me a PM

Kobaz
11-06-2008, 07:51 PM
I really need new glasses....

You are missing the \n at the end of the push and pop lines. Look at the last post I made that starts "Fixed code seems to be:".

It's things like that that remind me how much I hated assembler back in the day when I had to do it. And that was on 8 and 16 bit processors.

Angelox
11-06-2008, 08:09 PM
That's cool, I'm really glad to see this get fixed - it went through this time (no clobber), I'll run the server with it a few days ), make sure it's all OK, then post again here.
Thank you for helping out!

Kobaz
11-06-2008, 08:55 PM
I'm sure I'm missing something obvious, but things are not quite right.

I can login with minilogin.

I can create a toon and it's saved to the DB.

When I enter tutorialb, the mobs are there, but they don't move. #loc and #search don't work. After a minute or so I get the "disconnected" screen.

eqemu_debug_world.log:

11355 [11.07. - 10:09:12] [WORLD__CLIENT] New connection from 192.168.0.50:2010
11355 [11.07. - 10:09:12] [NET__IDENT_TRACE] 192.168.0.50:2010: First opcode 0x4dd0 did not match expected 0x2792
11355 [11.07. - 10:09:12] [NET__IDENT_TRACE] 192.168.0.50:2010: Tried patch 6.2_world, and it did not match.
11355 [11.07. - 10:09:12] [NET__IDENT_TRACE] 192.168.0.50:2010: First opcode 0x4dd0 did not match expected 0x2ec9
11355 [11.07. - 10:09:12] [NET__IDENT_TRACE] 192.168.0.50:2010: Tried patch 6.2_zone, and it did not match.
11355 [11.07. - 10:09:12] [NET__IDENT_TRACE] 192.168.0.50:2010: First opcode matched 0x4dd0 and length matched 464
11355 [11.07. - 10:09:12] [NET__IDENTIFY] Identified stream 192.168.0.50:2010 with signature Titanium_world
11355 [11.07. - 10:09:12] [WORLD__CLIENT] Checking inbound connection 192.168.0.50 against BannedIPs table
11355 [11.07. - 10:09:12] [WORLD__CLIENT] Connection 192.168.0.50 PASSED banned IPs check. Processing connection.
11355 [11.07. - 10:09:12] [WORLD__CLIENT] john: Logged in. Mode=(CharSel)
11355 [11.07. - 10:09:12] [WORLD__CLIENT] john: MiniLogin Account #1
11355 [11.07. - 10:10:46] [WORLD__CLIENT] john: Attempting autobootup of tutorialb (189)
11355 [11.07. - 10:10:46] [WORLD__ZONE] [6] Setting to 'tutorialb' (189)
11355 [11.07. - 10:10:46] [WORLD__CLIENT] john: Entering zone tutorialb (189)
11355 [11.07. - 10:10:46] [WORLD__ZONE] [6] [tutorialb] Broadcasting a world time update
11355 [11.07. - 10:10:46] [WORLD__ZONE] [6] [tutorialb] Setting to 'tutorialb' (189)
11355 [11.07. - 10:10:46] [WORLD__CLIENT] john: Sending client to zone tutorialb (189) at 192.168.0.24:7005
11355 [11.07. - 10:10:46] [WORLD__CLIENT] john: Client disconnected (not active in process)
11355 [11.07. - 10:11:20] [WORLD__ZONELIST] Removing zoneserver #6 at :7005
11355 [11.07. - 10:11:20] [WORLD__ZONELIST] Hold Zones mode is ON - rebooting lost zone
11355 [11.07. - 10:11:20] [WORLD__LAUNCH] zone: dynamic_03 reported state STOPPED (2 starts)
11355 [11.07. - 10:11:32] [WORLD__LAUNCH] zone: dynamic_03 reported state STARTED (3 starts)
11355 [11.07. - 10:11:32] [WORLD__ZONE] New TCP connection from 127.0.0.1:43102
11355 [11.07. - 10:11:32] [WORLD__CONSOLE] New zoneserver #7 from 127.0.0.1:43102
11355 [11.07. - 10:11:32] [WORLD__ZONE] [7] Zone started with name dynamic_03 by launcher zone
11355 [11.07. - 10:11:32] [WORLD__ZONE] [7] Auto zone port configuration. Telling zone to use port 7006
11355 [11.07. - 10:12:52] [WORLD__CLIENT] New connection from 192.168.0.50:2017



eqemu_debug_zone.log:

11370 [11.07. - 10:05:34] [WORLD__CLIENT] New connection from 192.168.0.50:2007
11370 [11.07. - 10:05:35] [NET__IDENT_TRACE] 192.168.0.50:2007: First opcode 0x7752 did not match expected 0x2792
11370 [11.07. - 10:05:35] [NET__IDENT_TRACE] 192.168.0.50:2007: Tried patch 6.2_world, and it did not match.
11370 [11.07. - 10:05:35] [NET__IDENT_TRACE] 192.168.0.50:2007: First opcode 0x7752 did not match expected 0x4dd0
11370 [11.07. - 10:05:35] [NET__IDENT_TRACE] 192.168.0.50:2007: Tried patch Titanium_world, and it did not match.
11370 [11.07. - 10:05:35] [NET__IDENT_TRACE] 192.168.0.50:2007: First opcode 0x7752 did not match expected 0x61c9
11370 [11.07. - 10:05:35] [NET__IDENT_TRACE] 192.168.0.50:2007: Tried patch Anniversary_world, and it did not match.

<snip lots of this>

11370 [11.07. - 10:05:35] [NET__IDENT_TRACE] 192.168.0.50:2007: First opcode matched 0x7213 and length matched 68
11370 [11.07. - 10:05:35] [NET__IDENTIFY] Identified stream 192.168.0.50:2007 with signature Titanium_zone
11370 [11.07. - 10:05:35] [WORLD__CLIENT] New client from 192.168.0.50:2007


and then no more references to the client machine (192.168.0.50)



client is 192.168.0.50

loginserver is 192.168.0.50

server is 192.168.0.24

server config:

<?xml version="1.0">
<server>
<world>
<shortname>xxxxxx</shortname>
<longname>xxxxxx Family Game</longname>
<!-- Only specify these two if you really think you need to. -->
<address>192.168.0.24</address>
<localaddress>192.168.0.24</localaddress>
<!-- Loginserver information. -->
<loginserver>
<host>192.168.0.50</host>
<port>5999</port>
<account></account>
<password></password>
</loginserver>
<unlocked></unlocked>

<!-- Sets the shared key used by zone/launcher to connect to world -->
<key>kiw9083wdfgesiwud</key>

<!-- Enable and set the port for the HTTP service. -->
<http port="9080" enabled="true" mimefile="mime.types" />
</world>

<!-- Database configuration, replaces db.ini. -->
<database>
<host>localhost</host>
<port>3306</port>
<username>eq</username>
<password>xxxxxxx</password>
<db>eqemu</db>
</database>
</server>



loginserver.ini:

###Your current configuration is as follows:

#loginserver.ini:
[LoginServer]
loginserver=127.0.0.1
loginport=5999
#worldname=
#worldaddress=
#locked=false
#account=
#password=

[WorldServer]
Defaultstatus=
Unavailzone=
[ChatChannelServer]

worldshortname=
chataddress=
chatport=

[LoginConfig]
ServerMode=Minilogin
ServerPort=5999


Any advice as to what to look at?

Angelox
11-06-2008, 09:05 PM
Looks like you are getting bumped right after you get in, and is why the mobs never move (you're already booted, you just didn't know yet).
I noticed you placed <eqemu> for database?
what database/version with what source are you using?
If you have the newest source, then you need to make sure all the tables are up to date, or you have the newest database.
Also make sure tutorialb is available for your toon (check min_status and min_level in table zone)

Kobaz
11-06-2008, 09:23 PM
I'm using code from svn (release 175 I think) from about 12 hours ago.
DB is from PEQ CVS as of about 12 hours ago.

Both fields have value 0.

Angelox
11-06-2008, 09:47 PM
So I guess you renamed your peq database to 'eqemu' and set all the permissions to eqemu.

also, you have your login server on your client machine with windows? it will work fine off Linux with wine - in fact with me, it works better under linux ( wine minilogin.exe).

make sure you have all the proper ports set. What I do is, since my router already has a hardware firewall, I disable all firewalls , but keep the server on DMZ and with the Linux firewall. If you plan to just play on LAN, then you don't need the DMZ thing.
Actually, I keep my server DMZ more for a problem my router has with FTP port fowarding.

My link for minilogin in my sig shows the ports that have to be opened (a blocked port will do this too).

Kobaz
12-20-2008, 03:17 AM
Well I've got my Lenny based system to work.

I used the debootstrap command to make a chrooted Etch environment. I made sure that the proc system was mounted, and pretty much followed the Debian guide. I also added a line to /etc/inittab so that the Etch environment booted on tty8.

It seems that the biggest problem was in zone.h where a member named map is declared. This conflicts with map in the stl, and the library for gcc 4.3 seemed to ignore the declaration in Zone in favour of the one in <map>. Someone who understands c++ could probably do something with namespaces and make it work. As it was it segfaulted badly trying to send the spawns to the client.