Pretitle snippet

Posted by USER007 on Tue 15 Jun 2004 04:32 AM — 42 posts, 138,504 views.

#0
I downloaded a pretitle snippet and I installed it succesfully... it compiled with one error but that was an easy fix so I compiled it again and I got no errors this time. Then I started up the mud and everything went fine, I got no bug messages. I type in my name and password, right after I type in my pass it crashes. Heres what it told me:

Tue Jun 15 00:21:38 2004 :: Sock.sinaddr: 127.0.0.1, port 4726.
Tue Jun 15 00:21:39 2004 :: [*****] BUG: Auth_check: exception found for (unknow
n)@127.0.0.1.
Tue Jun 15 00:21:40 2004 :: Preloading player data for: Anavel (9K)
Tue Jun 15 00:21:40 2004 :: Creating area entry for Anavel
Segmentation fault (core dumped)

Any clues? Heres some of the code if you need it...



1. Act_info.c

Need to drop this function into the file, it is the actual
command for setting pretitle.

/* Orginal done by Azalin for ???
Converted to Smaug by Xerves 8/2/99 */
void do_pretitle( CHAR_DATA *ch, char *argument )
{
char buf[MAX_STRING_LENGTH];
int value;

if ( IS_NPC(ch) )
{
send_to_char( "Not on NPC's.\n\r", ch );
return;
}
/* Used the notitle flag to ban abuse of the command, if you want to make
your own flags and put them in, you can -- Xerves */
if ( IS_SET( ch->pcdata->flags, PCFLAG_NOTITLE ))
{
set_char_color( AT_IMMORT, ch );
send_to_char( "The Gods prohibit you from changing your title or pretitle.\n\r", ch );
return;
}

if ( ch->pcdata->pretit == '\0' )
ch->pcdata->pretit = "&G"; /* Hard-coded Color part here, change if needed -- Xerves */

if ( argument[0] == '\0' )
{
send_to_char("Syntax: pretitle show\n\r", ch);
send_to_char("Syntax: pretitle clear\n\r", ch);
send_to_char("Syntax: pretitle <text>\n\r", ch);
return;
}

if ( !str_cmp( argument, "show" ) )
{
sprintf(buf, "Your current pretitle is '%s&g'.\n\r",ch->pcdata->pretit);
send_to_char(buf,ch);/* Above is hard-coded also -- Xerves */
return;
}

if ( !str_cmp( argument, "clear" ) )
{
ch->pcdata->pretit = "&G"; /* Hard-coded Color -- Xerves */
send_to_char("Pretitle Removed.\n\r",ch);
return;
}
/* Will only allow for 25 characters in the pretitle, color code included
If you want to have a longer pretitle (or shorter) change the number below
and change the number in the arrays to match -- Xerves */
if ( strlen(argument) > 25 )
{
argument[25] = '&'; /* Hard-coded Color again */
argument[26] = 'G';
argument[27] = '\0';
}
else
{
value = strlen(argument);
argument[value] = '&';
argument[value+1] = 'G'; /* Color again */
argument[value+2] = '\0';
}

smash_tilde( argument );
ch->pcdata->pretit = str_dup( argument );
send_to_char("Done.\n\r",ch);
return;

}

In do_who find this code.......

sprintf( buf, "%*s%-15s %s%s%s%s%s%s%s%s.%s%s%s\n\r",
(fGroup ? whogr->indent : 0), "",
class,
invis_str,
(wch->desc && wch->desc->connected) ? "[WRITING] " : "",
xIS_SET(wch->act, PLR_AFK) ? "[AFK] " : "",
xIS_SET(wch->act, PLR_ATTACKER) ? "(ATTACKER) " : "",
xIS_SET(wch->act, PLR_KILLER) ? "(KILLER) " : "",
xIS_SET(wch->act, PLR_THIEF) ? "(THIEF) " : "",
char_name,
wch->pcdata->title,
extra_title,
clan_name,
council_name );


You need to tact up another %s right before the . (the %s.%s%s%s) that
dot.

And then before char_name, you need to put wch->pcdata->pretit

It should look like this after you get done...

sprintf( buf, "%*s%-15s %s%s%s%s%s%s%s%s%s.%s%s%s\n\r",
(fGroup ? whogr->indent : 0), "",
class,
invis_str,
(wch->desc && wch->desc->connected) ? "[WRITING] " : "",
xIS_SET(wch->act, PLR_AFK) ? "[AFK] " : "",
xIS_SET(wch->act, PLR_ATTACKER) ? "(ATTACKER) " : "",
xIS_SET(wch->act, PLR_KILLER) ? "(KILLER) " : "",
xIS_SET(wch->act, PLR_THIEF) ? "(THIEF) " : "",
wch->pcdata->pretit,
char_name,
wch->pcdata->title,
extra_title,
clan_name,
council_name );
#1
Second part... sorry if its too long...

IN do_whois, you need to find this code

set_pager_color( AT_GREY, ch );
pager_printf(ch, "\n\r'%s%s.\n\r",
victim->name, victim->pcdata->title);

AND change it to look like this

set_pager_color( AT_GREY, ch );
pager_printf(ch, "\n\r'%s&c&w%s%s.\n\r",
victim->pcdata->pretit, victim->name, victim->pcdata->title);

(NOTE ON ABOVE: My mud has a fun time with the &w color, so I use
&c&w for the &w code. Again, this is hard coded, and if you want
to remove the color, remove that one also)


FINALLY, in show_char_to_char_0 Find this Code

if ( victim->morph != NULL && victim->morph->morph != NULL &&
!IS_IMMORTAL( ch ) )
strcat( buf, MORPHPERS( victim, ch ) );
else
strcat( buf, PERS( victim, ch ) );
}

if ( !IS_NPC(victim) && !xIS_SET(ch->act, PLR_BRIEF) )
strcat( buf, victim->pcdata->title );

And change it to look like this


if ( victim->morph != NULL && victim->morph->morph != NULL &&
!IS_IMMORTAL( ch ) )
strcat( buf, MORPHPERS( victim, ch ) );
else
if (!IS_NPC(victim) && victim->pcdata->pretit != NULL)
{
strcat (buf, victim->pcdata->pretit );
strcat (buf, "&P");
}
strcat( buf, PERS( victim, ch ) );
}

if ( !IS_NPC(victim) && !xIS_SET(ch->act, PLR_BRIEF) )
strcat( buf, victim->pcdata->title );

2. MUD.H
In the declare_do_fun section, you need to add pretitle to it.

In the pc_data structure, you need to add this to it
char * pretit;

(I added this after the pointer for title)

3. TABLES.C
You need to add the pretitle commands into the tables. Remember, there
are two spots which it needs to be added!

4. Save.c

IN fwrite_char, you need to add this

fprintf( fp, "Pretit %s~\n", ch->pcdata->pretit ); /* Xerves 8-2-99 */

You will most likely want to put it after the one for title

In load_char_obj you need to put it in two spots, first...

Right below
ch->pcdata->bestowments = str_dup( "" );
ch->pcdata->title = STRALLOC( "" );
Add This Line
ch->pcdata->pretit = str_dup( "" ); /* Xerves 8-2-99 */

Next, down about 20 lines or so, find this

if ( !ch->pcdata->deity_name )
{
ch->pcdata->deity_name = STRALLOC( "" );
ch->pcdata->deity = NULL;
}
if ( !ch->pcdata->bio )
ch->pcdata->bio = STRALLOC( "" );

Right below it add this...

if ( !ch->pcdata->pretit )
ch->pcdata->pretit = str_dup( "" ); /* Xerves 8-2-99 */


IN fread_char, there are once again two spots...First

Right below this line..
KEY( "Practice", ch->practice, fread_number( fp ) );
Add all of this

if ( !str_cmp( word, "Ptit" ) || !str_cmp( word, "pretit"))
{
ch->pcdata->pretit = fread_string( fp );
if (ch->pcdata->pretit[0] != '.' && ch->pcdata->pretit[0] != ','
&& ch->pcdata->pretit[0] != '!' && ch->pcdata->pretit[0] != '?')
{
sprintf( buf, "%s", ch->pcdata->pretit );
STRFREE( ch->pcdata->pretit );
ch->pcdata->pretit = str_dup( buf );
}
fMatch = TRUE;
break;
}

(NOTE: The above will check to see if there is an . , ! ? in the pretitle, if
one is found, it will not save the pretitle, remove this if you want, or
feel free to add on to it )

Lastly, down about a few pages, there should be a bunch of checks to see if
titles/bios/etc exsist, it looks like this

if (!ch->pcdata->bestowments)
ch->pcdata->bestowments = str_dup( "" );
if (!ch->pcdata->title)
ch->pcdata->title = STRALLOC( "" );

You need to add right after that

if (!ch->pcdata->pretit)
ch->pcdata->pretit = str_dup( "" );

5. (Optional, if you have finger.c (the finger command) in your code)
If you still have the finger function in finger.c, you will probably want
to add pretitle support there also, if you moved the finger code, or have
your own, you might want to find it again, and add this to it.

ch_printf(ch, "&c&wSex : &G%-20s &w Race: &G%s\n\r",
victim->sex == SEX_MALE ? "Male" :
victim->sex == SEX_FEMALE ? "Female" : "Neutral",
capitalize( npc_race[victim->race] ) );
ch_printf(ch, "&c&wTitle: &G%s\n\r", victim->pcdata->title );

This is what the code I have looks like, again the &c&w is used to for &w in
my code. Anyway, you will probably want to add the Pretitle right below that

ch_printf(ch, "&c&wPreTitle: &G%s\n\r", victim->pcdata->pretit );
USA #2
So er, what does gdb say when you debug it?
#3
Hmmm... that could be a problem... I don't know how to use gdb, I'll just search for the guide thats some where in this forum. Oh and I typed this yesterday if it helps any:

$ ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited

I remember someone saying to make the core file size around 163514 or somewhere around there, so that could be the problem...
Amended on Tue 15 Jun 2004 07:21 PM by USER007
USA #4
Attach gdb to the process, then crash the MUD. See the manual of gdb. (man gdb)
#5
I can't find my core file... where is it?
$ ls -lt core*
ls: core*: No such file or directory
Amended on Tue 15 Jun 2004 08:52 PM by USER007
USA #6
Core dumps are usually found in the area directory.

Try something like this from the src directory:

gdb smaug ../area/core

Then type 'bt' without quotes and show us what it spits out. Then we will be able to help you more.
Amended on Tue 15 Jun 2004 09:00 PM by Zhamel
#7
Ok heres what I got:

Tue Jun 15 17:04:20 2004 :: Preloading player data for: Anavel (9K)

Program received signal SIGSEGV, Segmentation fault.
free_char (ch=0x10384b30) at db.c:2869
2869 next = temp->next;
(gdb) bt
#0 free_char (ch=0x10384b30) at db.c:2869
#1 0x004b4053 in nanny (d=0x1038a3d8, argument=0x22f8d0 "L#900")
at comm.c:1687
#2 0x004b1073 in game_loop () at comm.c:629
#3 0x004b0686 in main (argc=1, argv=0x10021540) at comm.c:286
USA #8
free_char eh? Did you install the pretitle fix too?
#9
Yes it came with it... :P was I not suppose to? :D
USA #10
Anavel, you said you made a "bug fix". Perhaps your creative bug fix actually broke it. :) Just what did you change?
USA #11
No, you were. I think there are some old topics on this about free_char... Try searching, I'll look around.
#12
Lol, I just did what the snippet told me and it compiled without any errors... and I change quite a few things to some files... so I can't post them all here cause it will spam the thread. :p
USA #13
Quote:
downloaded a pretitle snippet and I installed it succesfully... it compiled with one error but that was an easy fix so I compiled it again and I got no errors this time. Then I started up the mud and everything went fine, I got no bug messages.


So was there an error or not??
#14
I got an error cause it had a typo and I realized what it was, so then I changed it. Then everything compiled alright.
Amended on Tue 15 Jun 2004 11:23 PM by USER007
Australia Forum Administrator #15
Did you compile *everything*? ie. do rm *.o, then compile?
#16
...OMG! It works now, from now on I'll do that. Thanks :)
USA #17
More importantly, do you understand why that is something you need to do?
#18
It helps the files link up better, instead of just the ones that you edited... something around there.
Canada #19
That, plus any changes in static variables or changes to a .h file need to be changed in all files that reference them. If you change a variable from char to int, for example, in the object structure, and only compile one .c file, all the others will still think its a char.

Most makefiles have a "make clean" option to help out
USA #20
Hello ... i installed the same snippet on smaug1.4a FUSS
and got some errors...after fixing a few of them listed here, I did a make clean and then a make smaug.....here is what i got

Bill@DDKXK661 ~/smaug/src
$ make clean
rm -f o/*.o smaug.exe *~

Bill@DDKXK661 ~/smaug/src
$ make
make -s smaug
Compiling o/imc.o....
Compiling o/i3.o....
Compiling o/act_comm.o....
Compiling o/act_info.o....
Compiling o/act_move.o....
Compiling o/act_obj.o....
Compiling o/act_wiz.o....
Compiling o/ban.o....
Compiling o/boards.o....
Compiling o/build.o....
Compiling o/clans.o....
Compiling o/color.o....
Compiling o/comm.o....
Compiling o/comments.o....
Compiling o/const.o....
Compiling o/db.o....
Compiling o/deity.o....
Compiling o/fight.o....
Compiling o/handler.o....
Compiling o/hashstr.o....
Compiling o/hotboot.o....
Compiling o/imm_host.o....
Compiling o/interp.o....
Compiling o/magic.o....
Compiling o/makeobjs.o....
Compiling o/mapout.o....
Compiling o/md5.o....
Compiling o/misc.o....
Compiling o/mpxset.o....
make[1]: *** No rule to make target `o/mud_comm.o', needed by `smaug'. Stop.
make: *** [all] Error 2

Bill@DDKXK661 ~/smaug/src
$ make
make -s smaug
make[1]: *** No rule to make target `o/mud_comm.o', needed by `smaug'. Stop.
make: *** [all] Error 2

Any ideas?? Thanks


USA #21
Well it looks like you changed your Makefile for some reason. Make sure mud_comm.o and mud_comm.c are in the Makefile.
USA #22
Hello agian... yeah..I found the error..mud_comm.c was really named mud_comm.c.o Fixed it, and it compiled. However, now after I login..(it actually takes in the password).. I belive the pfile is corrupt..Any ideas on just what is happening??


From gdb


Bill@DDKXK661 ~
$ cd smaug/area

Bill@DDKXK661 ~/smaug/area
$ gdb ../src/smaug.exe
GNU gdb 6.3.50_2004-12-28-cvs (cygwin-special)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) run
Sun Feb 13 01:38:03 2005 :: IMC: IMC2Sun Feb 13 01:38:00 2005 :: [*****] BOOT: ---------------------[ Boot Log ]-----
---------------
Sun Feb 13 01:38:00 2005 :: Loading commands
Sun Feb 13 01:38:00 2005 :: Loading sysdata configuration...
Sun Feb 13 01:38:00 2005 :: Loading socials
Sun Feb 13 01:38:00 2005 :: Loading skill table
Sun Feb 13 01:38:00 2005 :: Sorting skill table...
Sun Feb 13 01:38:00 2005 :: Remapping slots to sns
Sun Feb 13 01:38:00 2005 :: Loading classes
Sun Feb 13 01:38:00 2005 :: Loading races
Sun Feb 13 01:38:00 2005 :: Loading herb table
Sun Feb 13 01:38:00 2005 :: Loading tongues
Sun Feb 13 01:38:00 2005 :: Making wizlist
Sun Feb 13 01:38:00 2005 :: Initializing random number generator
Sun Feb 13 01:38:00 2005 :: Setting time and weather
Sun Feb 13 01:38:00 2005 :: Assigning gsn's
Sun Feb 13 01:38:00 2005 :: Reading in area files...
(help.are)
gods.are      : Rooms:  1200 - 1203  Objs:  1200 - 1203  Mobs:  1200 - 1200
limbo.are     : Rooms:     2 - 99    Objs:     2 - 99    Mobs:     1 - 99
newacad.are   : Rooms: 10300 - 10499 Objs: 10300 - 10499 Mobs: 10300 - 10499
newgate.are   : Rooms:   100 - 199   Objs:   100 - 199   Mobs:   100 - 199
newdark.are   : Rooms: 21000 - 21499 Objs: 21000 - 21435 Mobs: 21000 - 21499
Sun Feb 13 01:38:00 2005 :: Fixing exits
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Get_room_index: bad vnum 9850.
Sun Feb 13 01:38:00 2005 :: [*****] BOOT: Fix_exits: room 21019, exit north lead
s to bad vnum (9850)
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Deleting north exit in room 21019
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Get_room_index: bad vnum 24800.
Sun Feb 13 01:38:00 2005 :: [*****] BOOT: Fix_exits: room 21021, exit north lead
s to bad vnum (24800)
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Deleting north exit in room 21021
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Get_room_index: bad vnum 3504.
Sun Feb 13 01:38:00 2005 :: [*****] BOOT: Fix_exits: room 21075, exit south lead
s to bad vnum (3504)
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Deleting south exit in room 21075
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Get_room_index: bad vnum 7030.
Sun Feb 13 01:38:00 2005 :: [*****] BOOT: Fix_exits: room 21075, exit down leads
 to bad vnum (7030)
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Deleting down exit in room 21075
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Get_room_index: bad vnum 6000.
Sun Feb 13 01:38:00 2005 :: [*****] BOOT: Fix_exits: room 21087, exit west leads
 to bad vnum (6000)
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Deleting west exit in room 21087
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Get_room_index: bad vnum 3503.
Sun Feb 13 01:38:00 2005 :: [*****] BOOT: Fix_exits: room 21112, exit east leads
 to bad vnum (3503)
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Deleting east exit in room 21112
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Get_room_index: bad vnum 7914.
Sun Feb 13 01:38:00 2005 :: [*****] BOOT: Fix_exits: room 21291, exit up leads t
o bad vnum (7914)
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Deleting up exit in room 21291
Sun Feb 13 01:38:00 2005 :: [*****] BUG: Get_room_index: bad vnum 3600.
Sun Feb 13 01:38:00 2005 :: [*****] BOOT: Fix_exits: room 21293, exit south lead
s to bad vnum (3600 network data loaded. Autoconnect not set.
IMC2 will need to be connected manually.
Sun Feb 13 01:38:00 2005 :: Keldar ready at address DDKXK661 on port 4000.
Sun Feb 13 01:38:08 2005 :: Sock.sinaddr:  127.0.0.1, port 1200.
Sun Feb 13 01:38:11 2005 :: EOF encountered on read.
Sun Feb 13 01:38:19 2005 :: Sock.sinaddr:  127.0.0.1, port 1203.
Sun Feb 13 01:38:21 2005 :: Preloading player data for: Rakon (9K)
Sun Feb 13 01:38:23 2005 :: Loading player data for: Rakon (9K)
Sun Feb 13 01:38:23 2005 :: Rakon (127.0.0.1) has connected.
Sun Feb 13 01:39:30 2005 :: Rakon has quit (Room 1201).

Program received signal SIGSEGV, Segmentation fault.
0x610b4704 in random () from /usr/bin/cygwin1.dll
(gdb)



USA #23
sorry... more info coming :D

This is what happens when I log into my nud

Type [MORE] or [C] to continue. <-------Pager thing going of the hizzy

Press [ENTER]


Welcome to Keldar...
Before a gigantic wooden door
A huge oak door serves as the entrance to the most magnificent palace you've
ever seen. A blue orb hovers near the door.
You see exits leading: none.
(Hidden) (Buried) A key of diamond glistens.


<Type HELP START><------- Immortal prompt shouldn't be this


<Type HELP START>
help start
Help level: 1
If you are new to the Realms, here are a few help files that will help you
get acquainted with our world. Please remember that during peak times
we host upwards of 300 players online, so we have tried to make the help
Type [MORE] or [C] to continue.

system as detailed as possible for everyone's benefit:

GUIDE - Will help you learn to use your Adventurers Guide Book.
RULES - Will lead you through the laws of the land.
Type [MORE] or [C] to continue.

SPAM - Will explain what spam is, and why you should not do it.
CONFIG - Will teach you about our configuration menu.
SCORE - Will tell you about your character's personal score sheet.
MOVEMENT - Will teach you various commands for moving about the Realms.
Type [MORE] or [C] to continue.

OBJECTS - Will teach you various commands to use your equipment.
CONTAINER - Will teach you about using containers to hold belongings.
CHANNELS - Will teach you about communication with other players.
GROUP - Will help you with grouping with other adventurers.
Type [MORE] or [C] to continue.

COMBAT - Will teach you how to choose, start and stop a fight.
DEATH - Will tell you about the death experience in the Realms.
PRACTICE - Will teach you about training spells, skills, and weapons.
INFORMATION - Will cover ways to find certain types of information.
Type [MORE] or [C] to continue.

To use these files, type HELP <topic>. Type 'help' for general commands.

<Type HELP START>


<Type HELP START>
score

Score for Rakon,Immortal of Justice.
You are trusted at level 51.<---------- Eh...why?? Rakon's level 65..why how did trust get to 51?
----------------------------------------------------------------------------
Type [MORE] or [C] to continue.

LEVEL: 65 Race : Dwarf Played: 2784 hours
YEARS: 1409 Class: Warrior Log In: Sun Feb 13 01:38:23 2005
STR : 17(17) HitRoll: 3 Saved: no save this session
INT : 13(13) DamRoll: 3 Time: Sun Feb 13 01:38:39 2005
Type [MORE] or [C] to continue.

WIS : 15(15) Armor: 0100, improper for adventure
DEX : 13(13) Align: +0000, neutral Items: 00002 (max 10200)
CON : 12(12) Pos'n: standing Weight: 00003 (max 1000000)
CHA : 12(12) Wimpy: 0 Style: standard
Type [MORE] or [C] to continue.

LCK : 13(13)
Glory: 0000(0000)
PRACT: 100 Hitpoints: 4000 of 4000 Pager: (X) 0 AutoExit(X)
XP : 2000 MKills: 00000 AutoLoot( )
Type [MORE] or [C] to continue.

GOLD : 500,047 Move: 4000 of 4000 Mdeaths: 00000 AutoSac ( )

You are drunk.<---------- --------------See below **
You are in danger of dehydrating.<--- How did these semptons get here? was fine before**
You feel fine.<-----------------See above **
Type [MORE] or [C] to continue.

Languages: common elvish dwarven pixie ogre orcish trollese rodent insectoid mammal reptile dragon spiritual magical goblin gods ancient halfling clan gith gnome


You are bestowed with the command(s): (null).<--------- Never bestowed a thing an PC **
----------------------------------------------------------------------------
IMMORTAL DATA: Wizinvis [ ] Wizlevel (0)
Type [MORE] or [C] to continue.

Bamfin:
Bamfout:


<Type HELP START>


<Type HELP START>
You drool on yourself.
--------------------------------------

Any advice on why this is happening? or what might remedy it? I've tried adding an ifcheck to see if pretit was null but that wouldnt let me log in that way..... Also added the ch->pcdata->pretit in the save.c function however I think its messing up. Thanks in advance

If you have any more questions about any information I' ve failed to give you..please gmail me <penquincoder at gmail dot com> or reply here..Thanks!
USA #24
Have you tried to debug the core? What does the backtrace say?
USA #25
All that is in the area dir s a smaug.exe.stackdump and I dont know how to read that. as for debuggin the core, how would I go about doing that?
USA #26
The link on how to debug is at the top of the page under coding.

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=3653
USA #27
more Gdb stuff.. I've no clue what to make of it

Sun Feb 13 01:38:11 2005 :: EOF encountered on read.
Sun Feb 13 01:38:19 2005 :: Sock.sinaddr: 127.0.0.1, port 1203.
Sun Feb 13 01:38:21 2005 :: Preloading player data for: Rakon (9K)
Sun Feb 13 01:38:23 2005 :: Loading player data for: Rakon (9K)
Sun Feb 13 01:38:23 2005 :: Rakon (127.0.0.1) has connected.
Sun Feb 13 01:39:30 2005 :: Rakon has quit (Room 1201).

Program received signal SIGSEGV, Segmentation fault.
0x610b4704 in random () from /usr/bin/cygwin1.dll
(gdb) q
The program is running. Exit anyway? (y or n) y

Bill@DDKXK661 ~/smaug/area
$ gdb ../src/smaug.exe
GNU gdb 6.3.50_2004-12-28-cvs (cygwin-special)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) run
Starting program: /home/Bill/smaug/src/smaug.exe
...
Blah
...
Sun Feb 13 02:03:37 2005 :: Sock.sinaddr: 127.0.0.1, port 1278.
Sun Feb 13 02:03:39 2005 :: Preloading player data for: Rakon (9K)
Sun Feb 13 02:03:40 2005 :: Loading player data for: Rakon (9K)
Sun Feb 13 02:03:40 2005 :: Creating area entry for Rakon<---- Need to know why here..no vnums assigned.
Sun Feb 13 02:03:40 2005 :: Rakon (127.0.0.1) has connected.

<connected and played here Did only what was in log, Below>

Sun Feb 13 02:03:58 2005 :: Log Rakon: mset self drunk 0
Sun Feb 13 02:04:06 2005 :: Log Rakon: mset self full 100
Sun Feb 13 02:04:20 2005 :: Rakon has quit (Room 1201).

<tried to reconnect>

Program received signal SIGSEGV, Segmentation fault.
0x610b4704 in random () from /usr/bin/cygwin1.dll

(gdb) bt
#0 0x610b4704 in random () from /usr/bin/cygwin1.dll
#1 0x610b51d5 in random () from /usr/bin/cygwin1.dll
#2 0x6105bc88 in dll_entry@12 () from /usr/bin/cygwin1.dll
#3 0x61001e89 in getprogname () from /usr/bin/cygwin1.dll
#4 0x6108a90c in cygwin1!aclcheck () from /usr/bin/cygwin1.dll
#5 0x61087436 in cygwin1!aclcheck () from /usr/bin/cygwin1.dll
#6 0x61086dbb in cygwin1!aclcheck () from /usr/bin/cygwin1.dll
#7 0x61062cf8 in inet_makeaddr () from /usr/bin/cygwin1.dll
#8 0x6108e1ef in cygwin1!aclcheck () from /usr/bin/cygwin1.dll
#9 0x004a9c05 in accept_new (ctrl=5) at comm.c:541
#10 0x004a9c6e in game_loop () at comm.c:564
#11 0x004a9542 in main (argc=1, argv=0xa0519c8) at comm.c:309
(gdb)

[/code]
Thanks
USA #28
Make sure you have debugging enabled.

Add -G3 on the compile line in the Makefile.
USA #29
I went to the post you listed, but when I do a make clean, then make... I get the following

Bill@DDKXK661 ~/smaug/area
$ cd ../src

Bill@DDKXK661 ~/smaug/src
$ make clean
rm -f o/*.o smaug.exe *~

Bill@DDKXK661 ~/smaug/src
$ make
make -s smaug
  Compiling o/imc.o....
cc1: warning: -Wuninitialized is not supported without -O
...
<Goes through compling with the same message for each file>

Done compiling mud.

Bill@DDKXK661 ~/smaug/src
$

I will getthe core file readout in the next post
USA #30
I don't think Wuninitialized matters very much. Someone else could explain more about it, I'm not familar with Cygwin or how Wuninitialized works.
USA #31
attached gdb to smaug via
~/smaug/area
$gdb ../src/smaug.exe
run
...
blah
...
Agian the commands below are all i did while connected.

Sun Feb 13 02:22:10 2005 :: Sock.sinaddr: 127.0.0.1, port 1338.
Sun Feb 13 02:22:13 2005 :: Preloading player data for: Rakon (9K)
Sun Feb 13 02:22:14 2005 :: Loading player data for: Rakon (9K)
Sun Feb 13 02:22:14 2005 :: Rakon (127.0.0.1) has connected.
Sun Feb 13 02:22:29 2005 :: Log Rakon: cedit pretitle create
Sun Feb 13 02:22:55 2005 :: Rakon has quit (Room 1201).

Here i attempted to reconnect and when i put my password in --------->|
|
Sun Feb 13 02:22:56 2005 :: Sock.sinaddr: 127.0.0.1, port 1342. |
Sun Feb 13 02:22:58 2005 :: Preloading player data for: Rakon (9K) |
<-------------------------------------------------------|
Program received signal SIGSEGV, Segmentation fault. <problem.... i cannot find SIGSEGV anywhere>
0x610b4d71 in random () from /usr/bin/cygwin1.dll
(gdb) c
Continuing.
6 [main] smaug 3732 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
1337 [main] smaug 3732 open_stackdumpfile: Dumping stack trace to smaug.exe.s
tackdump

Program exited with code 0305400.
(gdb) q

Bill@DDKXK661 ~/smaug/area
$ ls -li core*
ls: core*: No such file or directory

Bill@DDKXK661 ~/smaug/area
$ ls
Build.are export.are help.are newdark.are smaug.exe.stackdump<-----core file??? Stackdump... gdb won't procces it
area.lst gallery.are help.are.bak newgate.are srefuge.are
astral.are gods.are limbo.are pixie.are unholy.are
boot.txt grave.are limbo.are2 plains.are
chapel.are grind manor.are redferne.are
daycare.are grove.are midennir.are sewer.are
dwarven.are haon.are newacad.are shutdown.txt

Bill@DDKXK661 ~/smaug/area
$ gdb ../area/smaug.exe.stackdump

GNU gdb 6.3.50_2004-12-28-cvs (cygwin-special)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"..."/home/Bill/smaug/area/smaug.exe.s
tackdump": not in executable format: File format not recognized<----- Not a core file maybe??

(gdb) run
Starting program:
No executable specified, use `target exec'.

(gdb) q

------------
Thanks Agian Zeno
USA #32
You have to specify the core and exec file in gdb. For example:
gdb ../src/smaug.exe stackdump
USA #33
When I do that it says "no such file or directory" yet i can see it with LS in the area dir.
USA #34
Make sure you're typing it correctly, what I posted was just an example.
USA #35
Ok, in the area dir
ls
Smaug.exe.stackdump <is that what we want??

so i should use
gdb ../area/smaug.exe stackdump | or
gdb ../area/smaug.exe.stackdump?
there is no SD in the SRC dir
USA #36
You want:
gdb ../area/smaug.exe Smaug.exe.stackdump
USA #37
This is what I got. FWIW I can log in now, however if i log out. and try to log back in... the mud crashes
Bill@DDKXK661 ~/smaug/area
$ gbd ../area/smaug.exe smaug.exe.stackdump
bash: gbd: command not found

Bill@DDKXK661 ~/smaug/area
$ gdb ../area/smaug.exe smaug.exe.stackdump
GNU gdb 6.3.50_2004-12-28-cvs (cygwin-special)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...../area/smaug.exe: No such file or
directory.

"/home/Bill/smaug/area/smaug.exe.stackdump" is not a core dump: File format not
recognized
(gdb)q
--------
USA #38
I moved the stackdump to the SRC dir and tried the gdb agian. this time all it said was. 'is not a core file. File format unrecogonized'
USA #39
File format not regonized.....rather..in the last post... ok ran gdb *sigh* did all the info stack and other stuff..heres what it listed

The following is what gdb spat out..Any insights?

Sun Feb 13 02:52:31 2005 :: Keldar ready at address DDKXK661 on port 4000.
Sun Feb 13 02:52:36 2005 :: Sock.sinaddr: 127.0.0.1, port 1423.
Sun Feb 13 02:52:38 2005 :: Preloading player data for: Rakon (9K)
Sun Feb 13 02:52:40 2005 :: Loading player data for: Rakon (9K)
Sun Feb 13 02:52:40 2005 :: Rakon (127.0.0.1) has connected.
Sun Feb 13 02:53:31 2005 :: Rakon has quit (Room 1201).
Sun Feb 13 02:53:32 2005 :: Sock.sinaddr: 127.0.0.1, port 1427.
Sun Feb 13 02:53:35 2005 :: Preloading player data for: Rakon (9K)

Program received signal SIGSEGV, Segmentation fault.
0x610b4d71 in random () from /usr/bin/cygwin1.dll
(gdb) bt
#0 0x610b4d71 in random () from /usr/bin/cygwin1.dll
#1 0x610b4b07 in random () from /usr/bin/cygwin1.dll
#2 0x610b51d5 in random () from /usr/bin/cygwin1.dll
#3 0x6105bc88 in dll_entry@12 () from /usr/bin/cygwin1.dll
#4 0x6108e1ef in cygwin1!aclcheck () from /usr/bin/cygwin1.dll
#5 0x004ac824 in nanny (d=0xa234420, argument=0x22eab0 "Cyco1")<-------arg shows password???
at comm.c:1736
#6 0x004aa0c3 in game_loop () at comm.c:649
#7 0x004a9582 in main (argc=1, argv=0xa0519d0) at comm.c:309
(gdb) info w32
List of info w32 subcommands:

(gdb) list
152 #ifdef IMC
153 int imcsocket = -1;
154 #endif
155
156 /*
157 * Memory debugging if needed.
158 */
159 #if defined(MALLOC_DEBUG)
160 malloc_debug( 2 );
161 #endif
(gdb) list
162
163 DONT_UPPER = FALSE;
164 num_descriptors = 0;
165 first_descriptor = NULL;
166 last_descriptor = NULL;
167 sysdata.NO_NAME_RESOLVING = TRUE;
168 sysdata.WAIT_FOR_AUTH = TRUE;
169
170 /*
171 * Init time.
(gdb) list
172 */
173 gettimeofday( &now_time, NULL );
174 current_time = (time_t) now_time.tv_sec;
175 /* gettimeofday( &boot_time, NULL); okay, so it's kludgy, sue me :) *
/
176 boot_time = time(0); /* <-- I think this is what you wanted
*/
177 strcpy( str_boot_time, ctime( &current_time ) );
178
179 /*
180 * Init boot time.
181 */
(gdb) list
-------------
man... What is happing to the code??? :>
USA #40
As far as I know, Cygwin cannot generate core dumps that work in GDB. That is why it was not recognizing the files.

As for your problem, you need to show us the code being run in your code:
#5 0x004ac824 in nanny (d=0xa234420, argument=0x22eab0 "Cyco1")<-------arg shows password???
at comm.c:1736

That line and its surrounding lines is what you need to show us. Typing in 'list' without going to the right stack frame isn't very useful. :)
USA #41
Heres comm.c A few lines before the error and a few after.

strcpy( buf, ch->pcdata->filename );
d->character->desc = NULL;
free_char( d->character );
d->character = NULL;
fOld = load_char_obj( d, buf, FALSE, FALSE );
ch = d->character;

I just took out the pretitle for now but hopefully I'll figure it out. Now theres a couple more errors. When an Imm character switches into a Mob, and does any command that calls act_info. such as who, whois, where, the game crashes. Thanks for your help.