Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 parse description bug
Yesterday, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Yahoo!, Google, DotBot

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWFOTE FUSS » "help 2" and other help comma...
Forum Rules | Mark all | Recent Posts

"help 2" and other help commands crashing mud
< Newer Topic :: Older Topic >

Pages:<< prev 1, 2 next >>
Post is unread #1 Apr 21, 2010, 5:22 am
Go to the top of the page
Go to the bottom of the page

MagisterXero
Fledgling
GroupMembers
Posts44
JoinedFeb 11, 2010

Okay so, someone recently brought to my attention that typing "help 2" on a smaug mud can crash it.
Being that I'm a coder who likes to prevent bugs like this from being readily usable by malicious players, does anyone know how to fix it?
       
Post is unread #2 Apr 21, 2010, 7:49 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

I don't have this problem, but I use Remcon's Suggested helpfile snippet.
       
Post is unread #3 Apr 21, 2010, 7:57 am
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

I can't say that I've ever encountered anything like this. But if it actually happens in the SWFotEFUSS or SWRFUSS bases, I'd be more than happy to help you find a fix for it.
       
Post is unread #4 Apr 21, 2010, 8:12 am
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

Maybe there is a helpfile in help.are that is named two, and is formated wrong?
       
Post is unread #5 Apr 21, 2010, 8:45 am
Go to the top of the page
Go to the bottom of the page

MagisterXero
Fledgling
GroupMembers
Posts44
JoinedFeb 11, 2010

hm... Just in case, can you point me towards Remcon's help snippet?

And yeah, this bug should be in the SWFoteFuss/SWRFuss bases. I've not made any changes to the way help files work.

Also looking to see if a helpfile "2" exists.
       
Post is unread #6 Apr 21, 2010, 8:53 am
Go to the top of the page
Go to the bottom of the page

MagisterXero
Fledgling
GroupMembers
Posts44
JoinedFeb 11, 2010

Okay, I checked the help.are and I can't seem to find any helpfiles labelled 2.
       
Post is unread #7 Apr 21, 2010, 8:59 am
Go to the top of the page
Go to the bottom of the page

MagisterXero
Fledgling
GroupMembers
Posts44
JoinedFeb 11, 2010

Did some searching, narrowed the problem down a bit more. It seems like somehow the "similar helpfiles" function is causing the crash.

Here's the code:
void similar_help_files( CHAR_DATA * ch, const char *argument )
{
   HELP_DATA *pHelp = NULL;
   char buf[MAX_STRING_LENGTH];
   char *extension;
   short lvl = 0;
   bool single = FALSE;
// char *argnew;

/*
    if ( isdigit(argument[0]) && (index(argument, '.')))
    {
        number_argument( argument, argnew );
        argument = argnew;
    }

*/
   send_to_pager_color( "&C&BSimilar Help Files:\r\n", ch );

   for( pHelp = first_help; pHelp; pHelp = pHelp->next )
   {
      buf[0] = '\0';
      extension = pHelp->keyword;

      if( pHelp->level > get_trust( ch ) )
         continue;

      while( extension[0] != '\0' )
      {
         extension = one_argument( extension, buf );

         if( str_similarity( argument, buf ) > lvl )
         {
            lvl = str_similarity( argument, buf );
            single = TRUE;
         }
         else if( str_similarity( argument, buf ) == lvl && lvl > 0 )
         {
            single = FALSE;
         }
      }
   }

   if( lvl == 0 )
   {
      send_to_pager_color( "&C&GNo similar help files.\r\n", ch );
      return;
   }

   for( pHelp = first_help; pHelp; pHelp = pHelp->next )
   {
      buf[0] = '\0';
      extension = pHelp->keyword;

      while( extension[0] != '\0' )
      {
         extension = one_argument( extension, buf );

         if( str_similarity( argument, buf ) >= lvl && pHelp->level <= get_trust( ch ) )
         {
            if( single )
            {
               send_to_pager_color( "&C&GOpening only similar helpfile.&C\r\n", ch );
               do_help( ch, buf );
               return;
            }

            pager_printf( ch, "&C&G   %s\r\n", pHelp->keyword );
            break;

         }

      }
   }
   return;
}

       
Post is unread #8 Apr 21, 2010, 9:07 am
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

I don't have time at the moment to look into this, completely forgot we're going out with the wife's family for dinner tonight and have to get ready and run errands and what not. Tomorrow should bring time for me to have a look at this if there's still no solution.
       
Post is unread #9 Apr 21, 2010, 9:58 am
Go to the top of the page
Go to the bottom of the page

MagisterXero
Fledgling
GroupMembers
Posts44
JoinedFeb 11, 2010

Okay, no problem Kayle and thanks for the assistance!
       
Post is unread #10 Apr 21, 2010, 12:37 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

I had this problem if anyone remembers. I think... Look through my posts.
       
Post is unread #11 Apr 21, 2010, 12:54 pm
Go to the top of the page
Go to the bottom of the page

ayuri
Magician
GroupMembers
Posts239
JoinedJun 13, 2008

Aye, I'll confirm that "help 2" will crash a non fuss swfote mud :D

ayuri
       
Post is unread #12 Apr 21, 2010, 1:15 pm   Last edited Apr 21, 2010, 1:17 pm by Andril
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

Crashes a FUSS one too. The problem, at least in this exact instance, is the IFCHECKS 2 help file entry. Remove that and the problem should go bye bye. Oddly enough though, help 1 and help 10 both display the following.

Similar Help Files:
LEVEL 1 FIRRERREO
LEVEL 1 KUBAZ
LEVEL 1 PK

Not quite sure why though. Something about the 1.

Someone screwed up and didn't enclose IFCHECKS 2 in quotation marks when that entry was originally created, one_argument wasn't grabbing the 2 WITH IFCHECKS, "IFCHECKS 2", because it wasn't in quotes with IFCHECKS and fun ensued from that point on. :) Of course whoever created that help entry then went ahead and created the IFCHECKS2 help entry, which works just fine. Exact same contents as well heh.
       
Post is unread #13 Apr 21, 2010, 1:25 pm
Go to the top of the page
Go to the bottom of the page

ayuri
Magician
GroupMembers
Posts239
JoinedJun 13, 2008

Hmm, yep, that seems to do the trick. I just edited the help.are file added the missing quotation marks. Great, now off to search the other 835 helps.

ayuri
       
Post is unread #14 Apr 21, 2010, 1:32 pm
Go to the top of the page
Go to the bottom of the page

Andril
Magician
GroupMembers
Posts147
JoinedJun 9, 2009

Why not just remove it completely? Based on my quick glance the entry right beneath it, IFCHECKS2, should have the exact same content.
       
Post is unread #15 Apr 21, 2010, 2:01 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006


Zeno said:

I had this problem if anyone remembers. I think... Look through my posts.


You have 600+ posts. I got up to like page 10 in a search for all your posts before I got bored and gave up... :P
       
Post is unread #16 Apr 21, 2010, 2:11 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

It has been awhile but this one was fixed quite some time ago when it was brought to my attention lol. Give me a few I'll dig up the link to it all.
       
Post is unread #17 Apr 21, 2010, 2:14 pm
Go to the top of the page
Go to the bottom of the page

ayuri
Magician
GroupMembers
Posts239
JoinedJun 13, 2008


Andril said:

Why not just remove it completely? Based on my quick glance the entry right beneath it, IFCHECKS2, should have the exact same content.


Because I'm lazy and wanted to see if the quotation marks would make a difference. Plus I'd then be at 834 help files. That just can't be! Yeah, I need to clean all the damn help files one of these days.

ayuri
       
Post is unread #18 Apr 21, 2010, 2:16 pm   Last edited Apr 21, 2010, 2:17 pm by Keberus
Go to the top of the page
Go to the bottom of the page

Keberus
Conjurer
GroupFUSS Project Team
Posts341
JoinedJun 4, 2005

Crashed my game too, I got a quick, but perhaps not the best, fix for it.

Above similar_help_files function I added:
bool SIMILAR_HELPS = FALSE;


then in the function I changed:
            if( single )
            {
               send_to_pager_color( "&GOpening only similar helpfile.&C\r\n", ch );
               do_help( ch, buf );
               return;
            }


to:
            if( single )
            {
               send_to_pager_color( "&GOpening only similar helpfile.&C\r\n", ch );
               SIMILAR_HELPS = TRUE;
               do_help( ch, buf );
               SIMILAR_HELPS = FALSE;
               return;
            }


then in do_help I changed:
   if( ( pHelp = get_help( ch, argument ) ) == NULL )
   {
      send_to_char( "No help on that word.\r\n", ch );
      similar_help_files( ch, argument );
      append_file( ch, HELP_FILE, "%s", nohelp ); //You may not have a line like this, I installed the nohelps snippet
      return;
   }


to:
   if( ( pHelp = get_help( ch, argument ) ) == NULL )
   {
      send_to_char( "No help on that word.\r\n", ch );
      if( !SIMILAR_HELPS )
      {
         similar_help_files( ch, argument );
         append_file( ch, HELP_FILE, "%s", nohelp ); //You may not have a line like this, I installed the nohelps snippet
      }
      return;
   }


Which should stop any sort of infinite looping, well, it did the trick for me.

Later,
KeB
       
Post is unread #19 Apr 21, 2010, 2:25 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

Ok, all this was discussed way back when and not sure if all the fusses have it etc.... but here is a link to when it was discussed for smaug long ago http://www.smaugmuds.org/index.php?a=topic&t=1420 Towards the end of it is where I talked about the problem and posted the updated code. You can find the snippet itself (Not sure if it ever got updated etc....) in the SmaugFUSS snippet section on the site under files.
       
Post is unread #20 Apr 22, 2010, 6:54 am
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Well, After fiddling with this, SWRFUSS is unaffected. I couldn't get it to crash with the help command. SWFotEFUSS however:

Thu Apr 22 06:52:21 2010 ::  Admin has entered the game.
Thu Apr 22 06:52:26 2010 :: [*****] BUG: Buffer overflow. Closing (Admin).
Thu Apr 22 06:52:26 2010 :: Closing link to Admin.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000455376 in get_help (ch=Cannot access memory at address 0x7fffff3fe448
) at act_info.c:1881
1881    {


That's what I got with "help 2". So. I guess I'll keep digging.
       
Pages:<< prev 1, 2 next >>