Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ SWfOTE Issue - Link Dead character crashes at reconnect
|
SWfOTE Issue - Link Dead character crashes at reconnect
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Kursh
(10 posts) Bio
|
| Date
| Thu 08 Mar 2018 11:05 AM (UTC) |
| Message
| Hello there,
I'm looking for some help.
I'm trying SWfOTE and I'm modyfing it pretty hard..
Unfortunatly since the day 1 I have a standard bug that I cannot fix in anyway..
When I reconnect even if I'm already online, system should disconnect the link dead character and login again.
The system has a segmentation dump because ch->name is not there.
When I reconnect I have a: EOF error because probably a descriptor is missing (cleared dunno where).
When I perform the check_playing it seems that the system can never find the original character.
Can someone help me? I don't really get how to fix or debug this...I flooded the code with BUG messages, but I can't really find the solution...
I suck I know :)
Thank you! | | Top |
|
| Posted by
| Fiendish
USA (2,541 posts) Bio
Global Moderator |
| Date
| Reply #1 on Thu 08 Mar 2018 02:43 PM (UTC) Amended on Thu 08 Mar 2018 02:44 PM (UTC) by Fiendish
|
| Message
| Post a link to a zip of the code that you're working with that has the problems, please.
(Note: not the original code, but the version of it that you have right now with all of your changes.)
In order to help fix the code, we need to be able to see it. |
https://github.com/fiendish/aardwolfclientpackage | | Top |
|
| Posted by
| Kursh
(10 posts) Bio
|
| Date
| Reply #2 on Thu 08 Mar 2018 07:18 PM (UTC) |
| Message
| Hi there!
Thank you for your help...I didn't expected that much.
This is my git repo:
https://github.com/paolofrancioso/SynMUD
There is the whole MUD code..it's completely WIP and I'm working on a copy.
Thank you again :)
in conn.c You can find bug("%s", ch->name) that i use to check where the descriptor is whiped...
I checked also today but...still no clue.
I also checked this code with other smaug code that are working but they are too much different.
Thanks again! | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Thu 08 Mar 2018 08:49 PM (UTC) |
| Message
| I can't reproduce that. Compiling under Ubuntu 16.04 with gcc 5.4.0 I can successfully connect as "admin" and then start a new session with "admin" and have the old one get kicked off and the new one keeps working.
I modified the Makefile to add -std=c++11 to the C_FLAGS directive otherwise I got a compile error.
You'll need to describe in more detail exactly what causes this issue. Also I suggest changing the C_FLAGS from "-g2" to "-g3", recompile all, and then use gdb as described here:
http://www.gammon.com.au/gdb
When it crashes do a backtract (bt) and copy/paste that. It should at least show what is going on. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Kursh
(10 posts) Bio
|
| Date
| Reply #4 on Thu 08 Mar 2018 09:06 PM (UTC) Amended on Thu 08 Mar 2018 10:35 PM (UTC) by Nick Gammon
|
| Message
|
Nick Gammon said:
I can't reproduce that. Compiling under Ubuntu 16.04 with gcc 5.4.0 I can successfully connect as "admin" and then start a new session with "admin" and have the old one get kicked off and the new one keeps working.
I modified the Makefile to add -std=c++11 to the C_FLAGS directive otherwise I got a compile error.
You'll need to describe in more detail exactly what causes this issue. Also I suggest changing the C_FLAGS from "-g2" to "-g3", recompile all, and then use gdb as described here:
http://www.gammon.com.au/gdb
When it crashes do a backtract (bt) and copy/paste that. It should at least show what is going on.
Hello Nick :)
I'm under Ubuntu 1704 and using GCC 7.2.
I have a perfect clean compiling.
This is my log If I try to connect, crash the client and connect again.
Thu Mar 8 22:03:08 2018 :: Initializing socket...
Thu Mar 8 22:03:08 2018 :: SynMUD ready on port 9500.
------------> First Connection
Thu Mar 8 22:03:14 2018 :: [*****] BUG: 1 Admin
Thu Mar 8 22:03:14 2018 :: [*****] BUG: 2 Admin
Thu Mar 8 22:03:14 2018 :: [*****] BUG: 3 Admin
Thu Mar 8 22:03:14 2018 :: [*****] BUG: 4 Admin
Thu Mar 8 22:03:14 2018 :: Admin (local-host) has connected.
Thu Mar 8 22:03:16 2018 :: Admin has entered the game.
----------->Crashing Client
----------->Reconnecting
Thu Mar 8 22:03:19 2018 :: EOF encountered on read.
Thu Mar 8 22:03:19 2018 :: Closing link to Admin.
Thu Mar 8 22:03:28 2018 :: [*****] BUG: 1 Admin
Thu Mar 8 22:03:28 2018 :: [*****] BUG: 2 Admin
Thu Mar 8 22:03:28 2018 :: Admin (local-host) reconnected.
Thu Mar 8 22:03:28 2018 :: [*****] BUG: 3 (null)
Thu Mar 8 22:03:28 2018 :: [*****] BUG: 4 (null)
Segmentation fault (core dumped)
As you can see for some reason i loose ch->name in...I think... check_reconnect method.
In the meanwhile I'll try to use GDB :) | | Top |
|
| Posted by
| Kursh
(10 posts) Bio
|
| Date
| Reply #5 on Thu 08 Mar 2018 09:46 PM (UTC) Amended on Thu 08 Mar 2018 10:35 PM (UTC) by Nick Gammon
|
| Message
| And here we go for the backtrace:
Program received signal SIGSEGV, Segmentation fault.
__strcpy_sse2_unaligned ()
at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:298
298 ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S: No such file or directory.
(gdb) bt
#0 __strcpy_sse2_unaligned ()
at ../sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S:298
#1 0x0000555555611bca in ?? ()
#2 0x00007fffffffda20 in ?? ()
#3 0x0000555555b58830 in ?? ()
#4 0x0000000000000002 in ?? ()
#5 0x0000555555b56220 in ?? ()
#6 0x0000555555b56220 in ?? ()
#7 0x0000000000000000 in ?? ()
(gdb)
not so usefull maybe | | Top |
|
| Posted by
| Kursh
(10 posts) Bio
|
| Date
| Reply #6 on Thu 08 Mar 2018 10:26 PM (UTC) Amended on Thu 08 Mar 2018 10:36 PM (UTC) by Nick Gammon
|
| Message
| Ok I Solved this!
Phew....
I don't know yet why, but maybe I'm not sure I want to know about it :D
chk = check_reconnect( d, ch->name, TRUE );
//if( check_reconnect( d, ch->name, TRUE ) == BERR )
if ( chk == BERR )
{
if( d->character && d->character->desc )
d->character->desc = NULL;
close_socket( d, FALSE );
return;
}
//if( check_reconnect( d, ch->name, TRUE ) == TRUE )
if ( chk == TRUE )
return;
if( check_multi( d, ch->name ) )
{
close_socket( d, FALSE );
return;
}
As you can see I commented out the check_recconnect methods and now I call it only once and I store the value in the variable chk.
Somehow the ch->name variable was lost at the end of the first function (even if with bug command i was able to see it filled till the end of the method) and then when the second call was performed something was failing and the return was not triggered...
Now works as expected.
Still I don't understand why the variable was cleared..but...it works :)
Thanks for your help! | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #7 on Thu 08 Mar 2018 10:37 PM (UTC) |
| Message
|
Kursh said:
And here we go for the backtrace:
...
not so usefull maybe
Did you change the Makefile to have "-g3" and then recompile all files? That should have given you function names. To recompile all type "make clean". |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #8 on Thu 08 Mar 2018 10:39 PM (UTC) |
| Message
| You can't call check_reconnect multiple times and expect it to work. Inside that function:
if( fConn && ch->switched )
{
write_to_buffer( d, "Already playing.\r\nName: ", 0 );
d->connected = CON_GET_NAME;
if( d->character )
{
/*
* clear descriptor pointer to get rid of bug message in log
*/
d->character->desc = NULL;
free_char( d->character );
d->character = NULL;
}
The first time you call it, it frees the character and sets d->character to NULL. The second time through you are using a NULL pointer. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Kursh
(10 posts) Bio
|
| Date
| Reply #9 on Thu 08 Mar 2018 11:28 PM (UTC) |
| Message
| Aoh :(
I miss the pointer! That's why.
Thank you :) Now I have also a reason!
Thanks again! I supposed no one would have responded about "muds" nowdays, but here you are :)
Thank you to you and also to Fiendish :) | | Top |
|
| Posted by
| Joeyfogas
(41 posts) Bio
|
| Date
| Reply #10 on Tue 13 Mar 2018 09:32 AM (UTC) |
| Message
| not too sure how similar this is to smaugfuss but I had the same issue and my problem was not only this, but also in the "void nanny_get_old_password" section.
it was called twice in a row there as well which was causing my link-dead/reconnect crashes
my fix
chk = check_reconnect( d, ch->pcdata->filename, TRUE );
if ( chk == BERR )
{
if( d->character && d->character->desc )
d->character->desc = NULL;
close_socket( d, FALSE );
return;
}
if ( chk )
return;
| | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
32,527 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top