Login
User Name:

Password:



Register

Forgot your password?
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
SWRFUSS 1.4
Author: Various
Submitted by: Samson
Users Online
Remcon, Google

Members: 1
Guests: 31
Stats
Files
Topics
Posts
Members
Newest Member
488
3,788
19,631
595
Khonsu

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Codebases » SmaugFUSS » cleanup_memory
Forum Rules | Mark all | Recent Posts

cleanup_memory
< Newer Topic :: Older Topic > for smaugfuss

Pages:<< prev 1, 2 next >>
Post is unread #21 Aug 27, 2005 8:57 am   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,685
JoinedJan 1, 2002

 
Ah, the dangers of porting code from other bases :P

Nice catch Conner. Fixed.

Post is unread #22 Aug 27, 2005 1:51 pm   
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

 
As much as I appreciate that, I really must defer to Remcon on this one. I installed it as he wrote it, then when I ran into a similiar issue to the one Zeno found, I patched it with your solution of reverting the memory macros, but it still didn't fully solve the problem, so I asked Remcon to help me decipher the core file it had produced and he helped me figure out that this was the problem/solution and when we were done, he asked me to post it here for others too. So, while I love seeing my name in lights like everyone else, I'll pass the credit for this one on to Remcon because it's really where it is due. Besides, overall, this whole cleanup_memory addition is his baby, from cradle to grave. :)

Post is unread #23 Aug 27, 2005 2:31 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
lol thanks but i have to pass it on to samson, or who ever first came up with it :) I just tried to make it fit into stock smaugfuss the problem with some of it is that in stock smaugfuss it doesnt have data in everything and these problems arent noticed until one searched for each part and made sure its done right or there is a problem which makes someone check a part :) thanks for finding the issue and making it known to others :)

Post is unread #24 Aug 28, 2005 6:13 pm   Last edited Aug 28, 2005 6:27 pm by Remcon
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
in deity.c in void free_deity( DEITY_DATA * deity )
change
   DISPOSE( deity->description );

to this
   STRFREE( deity->description );

Post is unread #25 Aug 28, 2005 6:25 pm   Last edited Aug 28, 2005 7:45 pm by Remcon
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
in boards.c in void delete_project( PROJECT_DATA * project )
change
   STRFREE( project->coder );

to this
   DISPOSE( project->coder );


change
   DISPOSE( project->status );

to this
   STRFREE( project->status );

Post is unread #26 Aug 28, 2005 6:51 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
in comm.c
find
void free_all_planes( void );

after that add
void free_councils( void );


find
   /*
    * Clans
    */
   fprintf( stdout, "%s", "Clans.\n" );
   free_clans(  );

after that add
   /*
    * Councils
    */
   fprintf( stdout, "%s", "Councils.\n" );
   free_councils(  );


in clans.c
find
void free_clans( void )
{
   CLAN_DATA *clan, *clan_next;

   for( clan = first_clan; clan; clan = clan_next )
   {
      clan_next = clan->next;
      free_one_clan( clan );
   }
   return;
}

after that add
void free_one_council( COUNCIL_DATA *council )
{
   UNLINK( council, first_council, last_council, next, prev );
   STRFREE( council->description );
   DISPOSE( council->filename );
   STRFREE( council->head );
   STRFREE( council->head2 );
   STRFREE( council->name );
   STRFREE( council->powers );
   DISPOSE( council );
   return;
}

void free_councils( void )
{
   COUNCIL_DATA *council, *council_next;

   for( council = first_council; council; council = council_next )
   {
     council_next = council->next;
     free_one_council( council );
   }
   return;
}

Post is unread #27 Aug 28, 2005 7:16 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
in comments.c
find
      /*
       * act( AT_ACTION, "$n posts a note.", ch, NULL, NULL, TO_ROOM );
       */

      strtime = ctime( ¤t_time );
      strtime[strlen( strtime ) - 1] = '\0';
      ch->pnote->date = STRALLOC( strtime );

replace that with this
      /*
       * act( AT_ACTION, "$n posts a note.", ch, NULL, NULL, TO_ROOM );
       */

      strtime = ctime( ¤t_time );
      strtime[strlen( strtime ) - 1] = '\0';
      STRFREE( ch->pnote->date );
      ch->pnote->date = STRALLOC( strtime );

Its not freeing the date and it appears it is already set elsewhere :)

Post is unread #28 Nov 12, 2005 7:17 pm   
Go to the top of the page
Go to the bottom of the page

Anavel
Apprentice
GroupMembers
Posts24
JoinedMar 6, 2005

 
It seems that item scraps aren't being cleaned up when the MUD is shutdown.

Total strings in hash 24: 1
Len:  28 Lnks:    1 Str: the remnants of A Cup
Total strings in hash 28: 1
Len:  46 Lnks:    1 Str: The remnants of A Cup are strewn about.
Total strings in hash 46: 1
Cleanup complete, exiting.


Any way to fix this? Codebase I'm using is FUSS 1.4.

Post is unread #29 Nov 12, 2005 8:09 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,685
JoinedJan 1, 2002

 
Well the objects were cleaned up but apparently the hashed descriptions weren't. Can you post a copy of your make_scraps() function?

Post is unread #30 Nov 12, 2005 8:34 pm   
Go to the top of the page
Go to the bottom of the page

Anavel
Apprentice
GroupMembers
Posts24
JoinedMar 6, 2005

 
void make_scraps( OBJ_DATA * obj )
{
	char buf[MAX_STRING_LENGTH];
	OBJ_DATA *scraps, *tmpobj;
	CHAR_DATA *ch = NULL;

	separate_obj( obj );
	scraps = create_object( get_obj_index( OBJ_VNUM_SCRAPS ), 0 );
	scraps->timer = number_range( 5, 15 );

	/*
	 * Don't make scraps of scraps of scraps of!
	 */
	if ( obj->pIndexData->vnum == OBJ_VNUM_SCRAPS )
	{
		STRFREE( scraps->short_descr );
		scraps->short_descr = STRALLOC( "some debris" );
		STRFREE( scraps->description );
		scraps->description = STRALLOC( "Bits of debris lie on the ground here." );
	}
	else
	{
		sprintf( buf, scraps->short_descr, obj->short_descr );
		STRFREE( scraps->short_descr );
		scraps->short_descr = STRALLOC( buf );
		sprintf( buf, scraps->description, obj->short_descr );
		STRFREE( scraps->description );
		scraps->description = STRALLOC( buf );
	}

	if ( obj->carried_by )
	{
		act( AT_OBJECT, "$p falls to the ground in scraps!", obj->carried_by, obj, NULL, TO_CHAR );

		if ( obj == get_eq_char( obj->carried_by, WEAR_WIELD )
		&& ( tmpobj = get_eq_char( obj->carried_by, WEAR_DUAL_WIELD ) ) != NULL )
			tmpobj->wear_loc = WEAR_WIELD;

		obj_to_room( scraps, obj->carried_by->in_room );
	}
	else if ( obj->in_room )
	{
		if ( ( ch = obj->in_room->first_person ) != NULL )
		{
			act( AT_OBJECT, "$p is reduced to little more than scraps.", ch, obj, NULL, TO_ROOM );
			act( AT_OBJECT, "$p is reduced to little more than scraps.", ch, obj, NULL, TO_CHAR );
		}
		obj_to_room( scraps, obj->in_room );
	}

	if ( ( obj->item_type == ITEM_CONTAINER || obj->item_type == ITEM_KEYRING
	|| obj->item_type == ITEM_QUIVER || obj->item_type == ITEM_CORPSE_PC ) && obj->first_content )
	{
		if ( ch && ch->in_room )
		{
			act( AT_OBJECT, "The contents of $p fall to the ground.", ch, obj, NULL, TO_ROOM );
			act( AT_OBJECT, "The contents of $p fall to the ground.", ch, obj, NULL, TO_CHAR );
		}
		if ( obj->carried_by )
			empty_obj( obj, NULL, obj->carried_by->in_room );
		else if ( obj->in_room )
			empty_obj( obj, NULL, obj->in_room );
		else if ( obj->in_obj )
			empty_obj( obj, obj->in_obj, NULL );
	}
	extract_obj( obj );
}

Post is unread #31 Nov 12, 2005 9:09 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,685
JoinedJan 1, 2002

 
Well I'm at a loss. I don't see anything wrong with the function. Were there any specific steps you followed to make this happen?

Post is unread #32 Nov 12, 2005 9:39 pm   
Go to the top of the page
Go to the bottom of the page

Anavel
Apprentice
GroupMembers
Posts24
JoinedMar 6, 2005

 
Well not really, I was testing a few modifications I made to the fighting system and fought with a mob, which destroy my my item and I picked it up and shutdown the MUD. Then I saw the output, and the mods I did were changing the message displaying.

I was thinking it could have something to with clean_obj_queue() or extract_obj, but the item scraps are the only things that pop up.

Post is unread #33 Jul 30, 2006 7:57 pm   
Go to the top of the page
Go to the bottom of the page

Anavel
Apprentice
GroupMembers
Posts24
JoinedMar 6, 2005

 
Has anyone had problems with the global boards? Every time I shutdown it shows all gnotes in every board and that can become quite spamful. :(

Total strings in hash 0: 1
Len:   3 Lnks:    2 Str: All
Total strings in hash 3: 1
Len:   7 Lnks:    2 Str: Testing
Total strings in hash 7: 1
Len:  10 Lnks:    1 Str: Testing.
Total strings in hash 10: 1
Len:  24 Lnks:    1 Str: Sun Jul 30 20:44:17 2006
Total strings in hash 24: 1

Memory Cleanup Complete.


I tried to fix it, but I later found out I was approaching the problem the wrong way and got tired of trying. (I thought it was caused by players not reading new gnotes, but I was wrong.) So if any one has any suggestions or anything please let me know.

Post is unread #34 Jul 30, 2006 8:22 pm   
Go to the top of the page
Go to the bottom of the page

kiasyn
Magician
GroupMembers
Posts121
JoinedJun 30, 2006

 
for the load_char_obj memory leak... characters aren't automatically added to the first_char last_char list on load... they are added once they get to CON_PRESS_ENTER i believe. :P search descriptors for d->character.

Post is unread #35 Aug 2, 2006 5:17 pm   
Go to the top of the page
Go to the bottom of the page

Anavel
Apprentice
GroupMembers
Posts24
JoinedMar 6, 2005

 
kiasyn said:

for the load_char_obj memory leak... characters aren't automatically added to the first_char last_char list on load... they are added once they get to CON_PRESS_ENTER i believe. :P search descriptors for d->character.

Thanks for the suggestion, but the problem has been fixed. I've been adding fixes to the MUD from the SMAUG fix list and the obj_queue fix solved the problem. :smile:

As for the global_board problem, it looks like it might have to be changed on how it loads up boards. :/

Post is unread #36 Jan 4, 2007 10:50 pm   
Go to the top of the page
Go to the bottom of the page

InfiniteAxis
Off the Edge of the Map
GroupAdministrators
Posts1,200
JoinedMar 21, 2006

 
So, since this is related to this topic, instead of creating a new one, figured I'd add it here.
Alright, discovered this, as it started today, when an Imm rebooted MW after bombing an area. but MW never came back up, well, I set about finding out why, and low and behold....
Thu Jan  4 22:43:23 2007 :: Log Kayle: shutdown mud now
Thu Jan  4 22:43:23 2007 :: Saving game world time....
Thu Jan  4 22:43:23 2007 :: IMC: Shutting down network.
Thu Jan  4 22:43:23 2007 :: Normal termination of game.
Thu Jan  4 22:43:23 2007 :: Cleaning up Memory.
IMC2 Data.
Project Data.
Ban Data.
Morph Data.
Commands.
Deities.
Clans.
Councils.
Socials.
Watches.
Helps.
Languages.
Boards.
Whacking supermob.
Objects.
Characters.
Descriptors.
Races.
Classes.
Teleport Data.
Area Data Tables.

Program received signal SIGSEGV, Segmentation fault.
0x400a16c3 in strlen () from /lib/libc.so.6


So then I run the backtrace.
Program received signal SIGSEGV, Segmentation fault.
0x400a16c3 in strlen () from /lib/libc.so.6
(gdb) bt
#0  0x400a16c3 in strlen () from /lib/libc.so.6
#1  0x08174531 in str_free (str=0x564a 
) at hashstr.c:115 #2 0x080c9628 in close_area (pArea=0x88cadb8) at act_wiz.c:5845 #3 0x080c99dc in close_all_areas () at act_wiz.c:5873 #4 0x08124a60 in cleanup_memory () at comm.c:325 #5 0x081251ed in main (argc=5, argv=0xbffffb04) at comm.c:570 #6 0x4004254d in __libc_start_main () from /lib/libc.so.6 (gdb) frame 0 #0 0x400a16c3 in strlen () from /lib/libc.so.6 (gdb) frame 1 #1 0x08174531 in str_free (str=0x564a
) at hashstr.c:115 115 len = strlen( str ); (gdb) frame 2 #2 0x080c9628 in close_area (pArea=0x88cadb8) at act_wiz.c:5845 5845 STRFREE( pArea->resetmsg ); (gdb) frame 3 #3 0x080c99dc in close_all_areas () at act_wiz.c:5873 5873 close_area( area ); (gdb) frame 4 #4 0x08124a60 in cleanup_memory () at comm.c:325 325 close_all_areas( ); (gdb) frame 5 #5 0x081251ed in main (argc=5, argv=0xbffffb04) at comm.c:570 570 cleanup_memory( ); (gdb) frame 6 #6 0x4004254d in __libc_start_main () from /lib/libc.so.6


Now, I've stayed pretty on top of this thread since I put this into the Obscurities code, watching for fixes and adding them. And for this to randomly start today, is mind boggling. If there's anything else you need, let me know, and I'll get it. If you want to treat me like I'm retarded, which I probably am, just spell out what you want me to do to get whatever information, and i'll ensure I follow directions. :tongue:

Pages:<< prev 1, 2 next >>