Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ ROM ➜ Compiling the server ➜ upgrading to olc2

upgrading to olc2

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Typhon   USA  (112 posts)  Bio
Date Tue 20 Jul 2004 08:47 PM (UTC)

Amended on Tue 20 Jul 2004 08:49 PM (UTC) by Typhon

Message
ok.. fair warning this is gonna be a long post :p
im running a copy of quickmud, right now im tryin to do this at home so im also running cygwin. normally the mud runs on a redhat server. now then for the post.

quickmud has olc 1.7 i believe installed.. im trying to upgrade to olc2 and its been a little difficult. i had to rip out some of the code we put in just to get to be able to manually install the patch. funny thing is i got the patch to install correctly the first time, had to clean up a few minor things, but it was a fairly clean install. the new olc code uses a -FIRST_BOOT option when you first install it so that the mud can convert all the races/classes/skills etc to tables. the conversion only happens in the tablesave.c file. it loads all the tables to memory then writes them to file. well after the instal it writes the skills no problem, however it gets to the races and the mud segfaults. this is what i get when i compile:
Quote:

tablesave.c: In function `grabar_tabla_comandos':
tablesave.c:571: warning: assignment discards qualifiers from pointer target type
tablesave.c:576: warning: assignment discards qualifiers from pointer target type
tablesave.c: In function `grabar_razas':
tablesave.c:809: warning: assignment discards qualifiers from pointer target type
tablesave.c:814: warning: assignment discards qualifiers from pointer target type
tablesave.c:820: warning: passing arg 4 of `save_struct' discards qualifiers from pointer target type
tablesave.c: In function `grabar_skills':
tablesave.c:877: warning: passing arg 4 of `save_struct' discards qualifiers from pointer target type

granted its only warnings, so the mud compiles. using gdb this is what i get:
Quote:

Starting program: /home/typ/th2/th/src/rom.exe
Tue Jul 20 16:03:45 2004 :: Loading configuration settings from ../area/qmconfig
.rc.
Tue Jul 20 16:03:45 2004 :: Set IP address to 0.0.0.0
Tue Jul 20 16:03:45 2004 :: Loaded 0 mobprogs.
Tue Jul 20 16:03:45 2004 :: Loaded 2 mobprogs.
Tue Jul 20 16:03:45 2004 :: Loaded 2 mobprogs.
Tue Jul 20 16:03:45 2004 :: Loaded 5 mobprogs.
Tue Jul 20 16:03:45 2004 :: Loaded 11 mobprogs.
Tue Jul 20 16:03:45 2004 :: Loaded 11 mobprogs.
Tue Jul 20 16:03:45 2004 :: Loaded 11 mobprogs.
Tue Jul 20 16:03:45 2004 :: Loaded 11 mobprogs.
Tue Jul 20 16:03:45 2004 :: Loaded 11 mobprogs.
Tue Jul 20 16:03:45 2004 :: [*****] BUG: Fix_exits: 240:3 -> 250:1 -> 245.
Tue Jul 20 16:03:45 2004 :: Check Levels:
Tue Jul 20 16:03:45 2004 :: Object: (VNUM 505)(Level 0) {DA Mauser Pistol{x
Tue Jul 20 16:03:45 2004 :: Mob: (VNUM 503)(Level 50) {DThe Mob Boss BigAl{x

Program received signal SIGSEGV, Segmentation fault.
0x004b0a46 in save_struct (fp=0xa042064, tipobase=0x4d9b80, tabla=0x4b02b0, puntero=0x446390) at tablesave.c:472
472 fprintf( fp, "%s %s~\n", temp->campo, !IS_NULLSTR(*pcadena) ? *pcadena : "" );
(gdb) bt
#0 0x004b0a46 in save_struct (fp=0xa042064, tipobase=0x4d9b80, tabla=0x4b02b0, puntero=0x446390) at tablesave.c:472
#1 0x004b0f96 in grabar_razas () at tablesave.c:820
#2 0x0044c163 in boot_db () at db.c:455
#3 0x004404ac in main (argc=1, argv=0xa041f10) at comm.c:443


this is the code im having a problem with.. its has alot to do with pointers and double pointers
but this is what i have.
Quote:

case CAMPO_STRING:
pcadena = (char **) ((int) temp->puntero_campo - (int) tipobase + (int) puntero);
472-> fprintf( fp, "%s %s~\n", temp->campo, !IS_NULLSTR(*pcadena) ? *pcadena : "" );
break;
and
case CAMPO_BOOL:
pbool = (bool *) ((int) temp->puntero_campo - (int) tipobase + (int) puntero);
518-> fprintf( fp, "%s %s\n", temp->campo,
(*pbool == TRUE) ? "true" : "false" );
break;

in the first case all i changed was !IS_NULLSTR(*pcadena) to !IS_NULLSTR(&pcadena) and the mud compiled and ran again, but to no avail. the mud segfaulted at the case CAMPO_BOOL: this is what gdb had to say about that..
Quote:

Program received signal SIGSEGV, Segmentation fault.
0x610ba4c1 in strlen () from /usr/bin/cygwin1.dll
(gdb) bt
#0 0x610ba4c1 in strlen () from /usr/bin/cygwin1.dll
#1 0x610c1294 in vfprintf () from /usr/bin/cygwin1.dll
#2 0x610bfb44 in vfprintf () from /usr/bin/cygwin1.dll
#3 0x610b326f in fprintf () from /usr/bin/cygwin1.dll
#4 0x004b0b75 in save_struct (fp=0xa042064, tipobase=0x4d9b80,
tabla=0x4b02b0, puntero=0x446390) at tablesave.c:518
#5 0x004b0f86 in grabar_razas () at tablesave.c:820
#6 0x0044c163 in boot_db () at db.c:455
#7 0x004404ac in main (argc=1, argv=0xa041f10) at comm.c:443


after that im lost.. thanks for takin a look
-typhon/blade
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 21 Jul 2004 01:09 AM (UTC)
Message
Quote:

in the first case all i changed was !IS_NULLSTR(*pcadena) to !IS_NULLSTR(&pcadena) and the mud compiled and ran again, but to no avail


I wouldn't do that, you are totally changing the meaning. The * dereferences the pointer, however the & takes the address of it, which is the opposite.

In gdb, I would check out temp, eg. p temp, and also pcadena, eg. p pcadena

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Typhon   USA  (112 posts)  Bio
Date Reply #2 on Wed 21 Jul 2004 10:48 AM (UTC)
Message
ok i changed it back to what it was originally and i get...
Quote:

0x004b0a86 in save_struct (fp=0xa042064, tipobase=0x4d9b80, tabla=0x4b02f0, puntero=0x446390) at tablesave.c:473
473 fprintf( fp, "%s %s~\n", temp->campo, !IS_NULLSTR(*pcadena) ? *pcadena : "" );
(gdb) print temp->campo
$1 = 0x4b02b2 "who_name"
(gdb) print pcadena
$2 = (char **) 0x446394
(gdb) print *pcadena
$3 = 0x67616d00 <Address 0x67616d00 out of bounds>
(gdb) print **pcadena
Cannot access memory at address 0x67616d00

but this is still what i get in the race file that is stored...
Quote:

#RAZA
name hylan~
pc true
act 0
aff COTZ
off EFQR
imm 0
res HJNS
vuln BM
form H
parts PUV
remort false
points 5
class_mult 100 100 100 100 @
who_name {YHylan{x ~
skills ~ ~ ~ ~ ~ @~
stats 13 15 15 13 14 @
max_stats 17 22 21 19 20 @
size medium~
#END

#RAZA
nam

:(
thanks again
-typhon/blade-
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #3 on Thu 22 Jul 2004 10:09 PM (UTC)
Message
Dunno. Looks like pcadena has a bad address in it. You'll have to work out why.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,196 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.