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, Google, Yandex, Majestic-12

Members: 0
Guests: 4
Stats
Files
Topics
Posts
Members
Newest Member
481
3,735
19,370
618
Micheal64X
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » General Discussions » Crash in Cronel's Editor Code
Forum Rules | Mark all | Recent Posts

Crash in Cronel's Editor Code
< Newer Topic :: Older Topic > Possible Crash Bug

Pages:<< prev 1 next >>
* #1 Dec 7, 2005, 5:07 pm
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005

I installed this code, relating to my previous issue with the stock SWR buffer. I also noticed it doesn't have a format feature .. which may have caused this, but I don't know.

Log Entry:
Wed Dec  7 12:40:01 2005 :: Zedd@ppp-85-7.dfnow.com(unknown) has connected.
Wed Dec  7 12:40:10 2005 :: Seon has quit.
Wed Dec  7 12:44:19 2005 :: Log Zedd: badname baise
Wed Dec  7 12:47:48 2005 :: Log Baise: name
Wed Dec  7 12:47:54 2005 :: Log Baise: name tallaes'us
Wed Dec  7 12:54:34 2005 :: Log Lorek: give legs guur
Wed Dec  7 12:54:37 2005 :: Log Lorek: give arms guu
Wed Dec  7 12:54:39 2005 :: Log Lorek: give about guu
Wed Dec  7 12:54:41 2005 :: Log Lorek: give waist guu
Wed Dec  7 12:54:43 2005 :: Log Lorek: give hands guu
Wed Dec  7 12:54:45 2005 :: Log Lorek: give feet guu
Wed Dec  7 12:54:47 2005 :: Log Lorek: give body guu
Wed Dec  7 12:55:26 2005 :: Log Zedd: redit desc
*** glibc detected *** double free or corruption (!prev): 0x088a16f0 ***


GDB entry:
#0  0x4009b861 in kill () from /lib/libc.so.6
(gdb) bt
#0  0x4009b861 in kill () from /lib/libc.so.6
#1  0x4009b60a in raise () from /lib/libc.so.6
#2  0x4009c981 in abort () from /lib/libc.so.6
#3  0x400ce980 in __fsetlocking () from /lib/libc.so.6
#4  0x400d4309 in malloc_usable_size () from /lib/libc.so.6
#5  0x400d4da1 in free () from /lib/libc.so.6
#6  0x081c5980 in discard_editdata (edd=0x8867e80) at editor.c:150
#7  0x081c618c in stop_editing (ch=0x88a9c30) at editor.c:391
#8  0x080ae631 in do_redit (ch=0x88a9c30, argument=0x8238c97 "";) at build.c:4218
#9  0x081c728c in editor_save (ch=0x88a9c30, edd=0x8867e80, argument=0xbffff5c6 "";) at editor.c:959
#10 0x081c6506 in edit_buffer (ch=0x88a9c30, argument=0xbffff5c6 "";) at editor.c:468
#11 0x080cfc6f in game_loop () at comm.c:732
#12 0x080ced0f in main (argc=9, argv=0xbffffa64) at comm.c:275
(gdb) 


I have no idea what to do, so if someone could point me in the right direction it would help. Much thanks beforehand :P

Completely off the point, but if someone could also help me make a format function for the editor, it would help. When editing, it seems as if the editor allows the lines go to the edge of the screen.
       
Post is unread #2 Dec 7, 2005, 7:44 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Does it crash right on "redit desc"? If not, when does it crash?
       
Post is unread #3 Dec 8, 2005, 12:07 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,873
JoinedJul 26, 2005

I believe its crashing on the saving.
The main parts of the core, that are useful, are these:
#5  0x400d4da1 in free () from /lib/libc.so.6
#6  0x081c5980 in discard_editdata (edd=0x8867e80) at editor.c:150
#7  0x081c618c in stop_editing (ch=0x88a9c30) at editor.c:391
#8  0x080ae631 in do_redit (ch=0x88a9c30, argument=0x8238c97 "";) at build.c:4218
#9  0x081c728c in editor_save (ch=0x88a9c30, edd=0x8867e80, argument=0xbffff5c6 "";) at editor.c:959
#10 0x081c6506 in edit_buffer (ch=0x88a9c30, argument=0xbffff5c6 "";) at editor.c:468
#11 0x080cfc6f in game_loop () at comm.c:732

In game_loop the character was transfered to edit_buffer (because they are in editing).
Then /s (or whatever the code uses to save the info) was done.
It then passed it to editor_save which then returns it to do_redit.
In do_redit it calls for stop_editing which called discard_editdata.
So what you should mainly check out is the part in discard_editdata at the line specified to see whats wrong there.
Considering the info from 0-5 is mainly system functions not to much you can do about them.
I would say that the line shown in #6 needs to check for valid data or something.
The data seems to have already been freed at that point, sometimes its done in other functions like the main ones calling that function, but its a good starting point. Look to make sure its not freed more then once.
Hope that helps at least a little, hard to say without all the code in front of us for testing :)
       
Post is unread #4 Dec 8, 2005, 2:04 am
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005

The editor code is available on this website under smaug snippets somwhere, but I found the same one in a different area, but I'll post this anyway:

GDB entry:
(gdb) frame 6
#6  0x081c5980 in discard_editdata (edd=0x8867e80) at editor.c:150
150                     DISPOSE( eline->line );
(gdb) list
145
146             eline = edd->first_line;
147             while( eline )
148             {
149                     elnext = eline->next;
150                     DISPOSE( eline->line );
151                     DISPOSE( eline );
152                     eline = elnext;
153             }
154             if( edd->desc )
(gdb) list
155                     STRFREE( edd->desc );
156             DISPOSE( edd );
157     }
158
159     EDITOR_DATA *clone_editdata( EDITOR_DATA *edd )
160     {
161             EDITOR_DATA *new_edd;
162             EDITOR_LINE *new_line, *eline, root_line;
163
164             CREATE( new_edd, EDITOR_DATA, 1 );
(gdb) 
       
Post is unread #5 Dec 8, 2005, 7:49 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,873
JoinedJul 26, 2005

So it looks like eline->line was NULL.
Try something as simple as tossing in an if check above it
so like on line 150 make it look like this or something.
                    if( eline->line )
                       DISPOSE( eline->line );

After that see if it still crashes on doing this.
Before doing that you could (if you still have the core) type
frame 6
print eline
print eline->line
Just to see if either one had bad data or something.
       
Post is unread #6 Dec 8, 2005, 1:47 pm
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005

Erm, I didn't do anything to it but the core I had got overwrote with another one looking like this:

#0  0x4009b861 in kill () from /lib/libc.so.6
(gdb) bt
#0  0x4009b861 in kill () from /lib/libc.so.6
#1  0x4009b60a in raise () from /lib/libc.so.6
#2  0x4009c981 in abort () from /lib/libc.so.6
#3  0x400ce980 in __fsetlocking () from /lib/libc.so.6
#4  0x400d4309 in malloc_usable_size () from /lib/libc.so.6
#5  0x400d4da1 in free () from /lib/libc.so.6
#6  0x081c5980 in do_homepage (ch=0x8867e80, argument=0x88a9c30 "p?\212\b(r\212\b";) at finger.c:610
#7  0x081c618c in start_editing_nolimit (ch=0x88a9c30, old_text=0x88a9c30 "p?\212\b(r\212\b", max_total=29696) at editor.c:351
#8  0x080ae631 in do_redit (ch=0x88a9c30, argument=0x8238c97 "";) at build.c:4219
#9  0x081c728c in editor_list (ch=0x88a9c30, edd=0x8867e80, argument=0xbffff5c6 "";) at editor.c:915
#10 0x081c6506 in edit_buffer (ch=0x88a9c30, argument=0xbffff5c6 "";) at editor.c:454
#11 0x080cfc6f in game_loop () at comm.c:740
#12 0x080ced0f in main (argc=9, argv=0xbffffa64) at comm.c:275
(gdb) print ch->name
       
Post is unread #7 Dec 8, 2005, 3:35 pm
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

Just means that you had another crash form a different reason. If you recreate the redit crash, you should be the core you want back.
       
Post is unread #8 Dec 8, 2005, 10:00 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,873
JoinedJul 26, 2005

Something is odd in that last core display.
Why in the world would it go from do_redit to start_editing_nolimit and then to do_homepage?
Something is definaly odd there, Its like you have changed the exe file or something considering that info.
Like Greven said I would advise deleting the current core file and reproducing the crash for a better core file to work with.
       
Post is unread #9 Dec 9, 2005, 4:53 am
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005

The problem is, I don't know what was done to cause that crash. I added the fix you suggested, Remcon. So I'll just wait to see if it happens again.
       
Post is unread #10 Dec 9, 2005, 7:14 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,873
JoinedJul 26, 2005

K, the orginal crash was during the saving of something that is done in the buffer. doing this (if its a constant crashing issue should cause it to crash):
redit desc
<Put in some room description, I would suggest what ever description you were putting in the other time it crashed.
Or maybe trying a /c (to clear it) and then doing /s (to save it), I would suggest trying alot of different things for this part>

At that point it should crash.
       
Post is unread #11 Dec 10, 2005, 7:27 am
Go to the top of the page
Go to the bottom of the page

Banner
Magician
GroupMembers
Posts169
JoinedNov 29, 2005

I didn't crash it the first time ,it was one of the builders. I tried inputting and saving, clearing and saving. Clearing a clear buffer and saving, and doing nothing and saving. I've tried filling it to the max and saving it and that works. So maybe the fix did work.
       
Pages:<< prev 1 next >>