Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex, Bing, DotBot

Members: 0
Guests: 1
Stats
Files
Topics
Posts
Members
Newest Member
481
3,734
19,366
618
Micheal64X
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » General Discussions » room_is_dark bug
Forum Rules | Mark all | Recent Posts

room_is_dark bug
< Newer Topic :: Older Topic > Anyone seen this?

Pages:<< prev 1 next >>
Post is unread #1 Oct 7, 2005, 6:08 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

I have never seen this happen except on the DBSaga codebases. But it suddenly came up on my MUD in the last few days. Here's all I've seen of it:
1001.log:Tue Oct  4 19:17:03 2005 :: [*****] BUG: room_is_dark: NULL pRoomIndex
1003.log:Fri Oct  7 14:31:52 2005 :: [*****] BUG: room_is_dark: NULL pRoomIndex


I really have no idea how to debug this. Anyone experienced this before or have any suggestions?
       
Post is unread #2 Oct 7, 2005, 7:16 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

You are seeing one of the most elusive bugs in all of Smaug. At some point or another, I'd say pretty much any Smaug developer has seen it. I'd say we all pretty much have no idea why it happens. And many of us are often only reminded of it on rare occasions. Then there are those of us who haven't seen it in months or even years and don't know how we stopped it.

So what am I trying to say? That you've joined a special group. Or something. There's really not much advice I can offer except to check on anything recent you might have done if this only now began coming up.
       
Post is unread #3 Oct 7, 2005, 7:40 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

My best guess is it's a new area. I haven't installed any code lately being busy with college and all, but 2 new areas have gone in.

There isn't some kind of information we can print with that bug message? No ch, no exit data?
       
Post is unread #4 Oct 7, 2005, 7:48 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

bool room_is_dark( ROOM_INDEX_DATA * pRoomIndex )
{
   if( !pRoomIndex )
   {
      bug( "%s", "room_is_dark: NULL pRoomIndex" );
      return TRUE;
   }

   if( pRoomIndex->light > 0 )
      return FALSE;

   if( IS_SET( pRoomIndex->room_flags, ROOM_DARK ) )
      return TRUE;

   if( pRoomIndex->sector_type == SECT_INSIDE || pRoomIndex->sector_type == SECT_CITY )
      return FALSE;

   if( time_info.sunlight == SUN_SET || time_info.sunlight == SUN_DARK )
      return TRUE;

   return FALSE;
}


Not by default, no. room_is_dark only accepts a ROOM_INDEX_DATA argument. IF you truly wish to hunt this down you'll need to add some way to trace backwards. Best possibility being an addition that makes the bug() function log a backtrace.

And this is a code bug. One that tends to lurk for a long time before something finally sets it off. If you just added 2 areas which did this, check over the mobs in each one VERY carefully to see if there is anything different about them that other mobs in other areas don't have. Maybe something can be narrowed down from that.
       
Post is unread #5 Oct 7, 2005, 7:59 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Hrm, wouldn't this relate to prototype areas too? If so, it'll take a long time to go over all proto areas as well.
       
Post is unread #6 Oct 7, 2005, 11:40 pm
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

I do have stack tracing in my bug, and I have seen the path for this bug, but my logs got corrupted. If I get it again, I will post with it.
       
Post is unread #7 Oct 8, 2005, 11:48 am   Last edited Oct 8, 2005, 11:55 am by Remcon
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,873
JoinedJul 26, 2005

You could do it a few ways for this.
Personaly i went with adding in for room_is_dark to take a filename and linenumber like this
bool room_is_dark( ROOM_INDEX_DATA * pRoomIndex, char *filename, int linenumber )
{
   if( !pRoomIndex )
   {
      bug( "room_is_dark: NULL pRoomIndex from %s@%d", filename, linenumber );
      return TRUE;
   }

   if( pRoomIndex->light > 0 )
      return FALSE;

   if( IS_SET( pRoomIndex->room_flags, ROOM_DARK ) )
      return TRUE;

   if( pRoomIndex->sector_type == SECT_INSIDE || pRoomIndex->sector_type == SECT_CITY )
      return FALSE;

   if( time_info.sunlight == SUN_SET || time_info.sunlight == SUN_DARK )
      return TRUE;

   return FALSE;
}

Then its just as simple as adding into mud.h for those and on all calls to room_is_dark tossing in for it to send
the filename and linenumber to it. I havent gotten the bug message since I set all this up so I have no idea where the actual issue is yet. Another way would be where all room_is_dark calls are used to toss in a check
null room data and output what function its in etc...
       
Post is unread #8 Oct 8, 2005, 12:20 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

If memory serves, the bug isn't actually with room_is_dark itself. I had something similar to Remcon's setup in place and had always tracked the underlying problem to be from the can_see function. Now obviously this isn't going to be practical to also hack up can_see to do the tracking. So it's definitely best to use some kind of backtracing in the bug() function assuming your OS will support that.
       
Post is unread #9 Oct 8, 2005, 2:04 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,873
JoinedJul 26, 2005

Yea i fiqure can_see will be the one to end up giving it, if i ever manage to get it to report one from can_see i'll fiqure out someway to get can_see to give me better info about where its coming from too lol
       
Pages:<< prev 1 next >>