Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
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
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, DotBot

Members: 0
Guests: 12
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » Possible bug in build.cpp
Forum Rules | Mark all | Recent Posts

Possible bug in build.cpp
< Newer Topic :: Older Topic > problems with room progs

Pages:<< prev 1 next >>
Post is unread #1 Jan 10, 2007, 1:43 am
Go to the top of the page
Go to the bottom of the page

Kekkonen

GroupMembers
Posts3
JoinedApr 10, 2005

All room progs seems to crash mud.

rpedit add ....

Bugs: [*****] BUG: mpedit: build.cpp@5239 trying to allocate an empty/null string
Bugs: Obtained 10 stack frames.
Bugs: ./afkmud(_Z3bugPKcz+0x1bb) [0x81ee2a9]
Bugs: ./afkmud(_Z9str_allocPKcS0_S0_i+0x38) [0x82312b0]
Bugs: ./afkmud(_Z6mpeditP9char_dataP13mud_prog_dataiPc+0x13c) [0x818e460]
Bugs: ./afkmud(do_rpedit+0x4ab) [0x818e95f]
Bugs: ./afkmud(_Z9interpretP9char_dataPc+0x168f) [0x81e402d]
Bugs: ./afkmud(_Z13process_inputv+0x5d2) [0x81d642e]
Bugs: ./afkmud(_Z9game_loopv+0x64) [0x81d6e70]
Bugs: ./afkmud(main+0x299) [0x81d79bd]
Bugs: /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xdc) [0xb7cd48cc]
Bugs: ./afkmud(__gxx_personality_v0+0xf9) [0x80ba4f1]
Begin entering your text now (/? = help /s = save /c = clear /l = list)
-----------------------------------------------------------------------
> Bugs: [*****] BUG: start_editing: data is NULL!
Bugs: Obtained 10 stack frames.
Bugs: ./afkmud(_Z3bugPKcz+0x1bb) [0x81ee2a9]
Bugs: ./afkmud(_ZN9char_data13start_editingEPc+0x130) [0x8215dbc]
Bugs: ./afkmud(_Z6mpeditP9char_dataP13mud_prog_dataiPc+0x189) [0x818e4ad]
Bugs: ./afkmud(do_rpedit+0x4ab) [0x818e95f]
Bugs: ./afkmud(_Z9interpretP9char_dataPc+0x168f) [0x81e402d]
Bugs: ./afkmud(_Z13process_inputv+0x5d2) [0x81d642e]
Bugs: ./afkmud(_Z9game_loopv+0x64) [0x81d6e70]
Bugs: ./afkmud(main+0x299) [0x81d79bd]
Bugs: /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xdc) [0xb7cd48cc]
Bugs: ./afkmud(__gxx_personality_v0+0xf9) [0x80ba4f1]


system: ubuntu server 6.10
       
Post is unread #2 Jan 13, 2007, 9:20 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002


[30000hp 30836m 30000mv] [1exp] rpedit
Syntax: rpedit <command> [number] <program> <value>

Command being one of:
add delete insert edit list
Program being one of:
act speech rand sleep rest rfight enter
leave death keyword

You should be standing in the room you wish to edit.

[30000hp 30836m 30000mv] [1exp] rpedit add speech
Begin entering your text now (/? = help /s = save /c = clear /l = list)
-----------------------------------------------------------------------
> say lalalalala
> /s

[30000hp 30836m 30000mv] [1exp] rpstat
Name: Parlor of the Immortals. Vnum: 11406.
>speech_prog (null)
say lalalalala


[30000hp 30836m 30000mv] [1exp]


Aside from the (null) because I didn't add an argument to detect, adding the prog to the room does not crash in a stock checkout from the SVN trunk. This code hasn't changed since release so I'm not sure what the problem is? Do you have some more specific steps to reproduce this?
       
Post is unread #3 Jan 13, 2007, 9:41 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Er, nevermind. I see what you're getting at now. Bug spam :P
Should be easy enough to shoot down and get committed to the trunk.
       
Post is unread #4 Jan 13, 2007, 10:12 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Here we go. Bit more than I expected, but eliminates the bug spam without introducing crashes instead:
Index: afkmud/src/build.cpp
===================================================================
--- afkmud/src/build.cpp	(revision 20)
+++ afkmud/src/build.cpp	(working copy)
@@ -5231,12 +5231,12 @@
    {
       mprg->type = mptype;
       STRFREE( mprg->arglist );
-      mprg->arglist = STRALLOC( argument );
+      if( argument && argument[0] != '\0' )
+         mprg->arglist = STRALLOC( argument );
    }
    ch->substate = SUB_MPROG_EDIT;
    ch->pcdata->dest_buf = mprg;
-   if( !mprg->comlist )
-      mprg->comlist = STRALLOC( "" );
+
    ch->editor_desc_printf( "Program '%s %s'.", mprog_type_to_name( mprg->type ), mprg->arglist );
    ch->start_editing( mprg->comlist );
    return;
Index: afkmud/src/editor.cpp
===================================================================
--- afkmud/src/editor.cpp	(revision 18)
+++ afkmud/src/editor.cpp	(working copy)
@@ -1049,9 +1049,8 @@
    size = 0;
    lpos = 0;
    lines = 0;
-   if( !data )
-      bug( "%s: data is NULL!", __FUNCTION__ );
-   else
+   if( data )
+   {
       for( ;; )
       {
          c = data[size++];
@@ -1075,6 +1074,7 @@
             break;
          }
       }
+   }
 
    if( lpos > 0 && lpos < 78 && lines < 49 )
    {
@@ -1143,7 +1143,11 @@
       mudstrlcat( buf, tmp, MSL );
    }
    if( hash )
-      return STRALLOC( buf );
+   {
+      if( buf && buf[0] != '\0' )
+         return STRALLOC( buf );
+      return NULL;
+   }
    return str_dup( buf );
 }
       
Pages:<< prev 1 next >>