Mud stops accepting connections? found 1 possible

Posted by Robert Powell on Sun 12 Jun 2005 11:42 AM — 7 posts, 22,079 views.

Australia #0
Every now and again the mud stops taking conections, you can connect, but it never gets past --- A connection has been established. ---, which is my client responce, seems the server doent know what to do after that.

I know this will be one of those pain in the butt issues to resolve, so im after all thoughts or know issues in SmaugFuss 1.4a, or ideas from those who have had simular issues.

Thanks in advance.
USA #1
Sounds like it's caught in a loop? Attach gdb to it and see what's going on.
USA #2
Ok, I've run into this one too. Attaching GDB to it sounds good, but the problem only happenes every few days (and then only sometimes) though it seems to be, at least in my case, a matter of too many open files, like the mud isn't closing player files after they logon/logoff or any other files it opens for that matter. (The first symptom I've noticed of this getting ready to start being a problem is that the users command starts reflecting connections with descriptors in the higher double digit range even though I've only got maybe 5 people actually online.
Australia #3
Good idea Zeno i will give it a go the next time it happens, any specifics i should do, i have never attached gdb to a running process, do i just backtrace like it was a core or seg fault?

Thanks heaps
USA #4
Check over Nick's gdb guide about how to attach it to a process. When you have it attached, do a backtrace. Then do next a few times. If it goes through the same functions over and over, it's caught in a loop.
Australia #5
Seems i have found a place where it gets stuck in a loop, tho i have no idea as to what would have caused it.

if ( IS_NPC(ch) )
    {
        send_to_char( "Not for NPCs.  Sorry.\n\r", ch );
        return;
    }

    /*
     * Check for trainer.
     */

    for ( mob = ch->in_room->first_person; mob; mob = ch->next_in_room )
      {
        if ( IS_NPC(mob) && xIS_SET(mob->act, ACT_TRAIN) )
        break;
      }

    if ( !mob  )
      {
        send_to_char( "You can't do that here.\n\r", ch );
        return;
      }


It gets stuck in the for loop and the if check within it. touble is, that there were only 2 people logded in and we were both in 1 room with no trainer, and no one typed train. Any thoughts as to what i should be looking out for here, as the above code looks right to me.

Thanks in advance.
USA #6
Well, nobody typed train, but something triggered it one way or another. Look at the gdb backtrace to see how you got into that function; that will give you some good clues.