GDB and copyover

From: Josh Anderson (joshua18@home.com)
Date: 03/25/01


I'm having a spot of trouble with the copyover code released for bpl17.  I'm
running on Win98 using Cygwin, bpl17, Oasis 2.0, DG v7a, and ascii pfiles
2.1.  The copyover code is installed and compiles fine.  The mud boots as
normal, and I can log in fine.  Here's where it gets a little concerning.

When I run the copyover command, it starts the routine.  It then, however,
closes my connection and gives me these error messages:

   SYSERR: Write to socket: The descriptor  is a file, not a socket
   Mar 25 14:13:15 No connections.  Going to sleep.
   Mar 25 14:13:15 New connection.  Waking up.
   Mar 25 14:13:15 No connections.  Going to sleep.
   Mar 25 14:13:15 New connection.  Waking up.
   Mar 25 14:13:15 No connections.  Going to sleep.
   Mar 25 14:13:15 New connection.  Waking up.

Etc ad nauseum.

Now, this is what really gets me.  I crank up GDB, log into the mud, and run
copyover.

It works fine.

I both step through the code line by line and run it fully without stopping,
and it works perfectly each time.  So my question is, why would it run fine
in GDB but not during normal running?  Since it's an infinite loop, I used
some logging statements and tracked down the problem to this part of
copyover_recovery():

    if (write_to_descriptor (desc, "\n\rFolding initiated...\n\r") < 0)
    {
      close (desc);
      continue;
    }

My connection is being closed because write_to_descriptor is failing.  It's
failing here, and there's my error message, in part:

  while (total > 0) {
    bytes_written = perform_socket_write(desc, txt, total);

    if (bytes_written < 0) {
      /* Fatal error.  Disconnect the player. */
      perror("SYSERR: Write to socket");
      return (-1);

Why would perform_socket_write be going nutty on me, but only in GDB mode?
Any ideas, from those smarter about this than me?  Thanks.

Josh Anderson
joshua18@home.com

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/04/01 PST