Author Topic: bug with call_out and shadows  (Read 3035 times)

Offline Stavros

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
bug with call_out and shadows
« on: November 23, 2013, 10:03:03 AM »
Here is one of the issues we've run into. Looks like an infinite loop in certain situations. I think this patch fixes it, but I'll leave it up to Fallentree to say for sure.  :)

Code: [Select]
diff --git a/src/call_out.cc b/src/call_out.cc
index ed1bd51..cbef2d1 100644
--- a/src/call_out.cc
+++ b/src/call_out.cc
@@ -170,9 +170,9 @@ void call_out(pending_call_t *cop)
   }
 
 #ifndef NO_SHADOWS
-  if (cop->ob)
-    while (cop->ob->shadowing) {
-      ob = cop->ob->shadowing;
+  if (ob)
+    while (ob->shadowing) {
+      ob = ob->shadowing;
     }
 #endif
   new_command_giver = 0;

Offline Stavros

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Re: bug with call_out and shadows
« Reply #1 on: November 23, 2013, 11:42:41 AM »
Another issue we've run into (but which I'm not sure how to fix) is that in get_user_data() in comm.cc, in some circumstances, when num_bytes == -1 (line 1308), it will try to do remove_interactive(), which ends up trying to flush messages, but if the connection is gone (presumably one of the reasons num_bytes could be -1), it errors with "broken pipe" and the whole driver hangs.

I saw this in a backtrace, but I wasn't able to recreate it in any controlled situations. If I can figure out some LPC code that forces it, I'll post here.

Here's the backtrace, for the record:

Code: [Select]
#0  0xf57fe416 in __kernel_vsyscall ()
#1  0xb7730e61 in send () from /lib/i386-linux-gnu/libpthread.so.0
#2  0x080e14de in flush_compressed_output (ip=0xdfceb10) at comm.cc:2706
#3  0x080e13e2 in end_compression(interactive_s*) [clone .13871] (ip=0xdfceb10) at comm.cc:2648
#4  0x080e30d2 in remove_interactive (ob=0xe085c18, dested=0) at comm.cc:2101
#5  0x080eaa1a in get_user_data (ip=0xdfceb10) at comm.cc:1318
#6  0x080ea4b5 in on_user_read(int, short, void*) [clone .30107] (fd=23, what=2, arg=0xd59e510) at event.cc:146
#7  0xb74f6ce9 in event_base_loop () from /usr/lib/libevent-2.0.so.5
#8  0x081010fb in run_for_at_most_one_second (base=0xd4e9b58) at event.cc:66
#9  0x080e7c77 in backend (base=0xd4e9b58) at backend.cc:205
#10 0x080ecc17 in main (argc=2, argv=0xbff2a834) at main.cc:394

Offline FallenTree

  • BFF
  • ***
  • Posts: 484
    • View Profile
Re: bug with call_out and shadows
« Reply #2 on: November 23, 2013, 10:44:23 PM »
Broken PIPE (SIGPIPE) error will only hang driver in GDB .

you should type this after enter in gdb

$ handle SIGPIPE nostop noprint pass

then run the driver inside GDB , it would not be affected by SIGPIPE.



Offline FallenTree

  • BFF
  • ***
  • Posts: 484
    • View Profile
Re: bug with call_out and shadows
« Reply #3 on: November 23, 2013, 10:52:03 PM »
the first patch looks good, I've already applied it to the HEAD.

Cheers.

Offline Stavros

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Re: bug with call_out and shadows
« Reply #4 on: November 24, 2013, 02:47:41 PM »
Awesome, thanks for the tip re: SIGPIPE.

Offline FallenTree

  • BFF
  • ***
  • Posts: 484
    • View Profile
Re: bug with call_out and shadows
« Reply #5 on: January 13, 2014, 01:24:11 PM »
I assume this has been fixed?

Offline Stavros

  • Acquaintance
  • *
  • Posts: 36
    • View Profile
Re: bug with call_out and shadows
« Reply #6 on: January 13, 2014, 03:25:26 PM »
Yes, definitely fixed, sorry I didn't follow up. We ran 3.0 alpha on our test mud for a while with the patch and had had no crashes. So we made the upgrade on our live mud a couple weeks ago, and everything's running great.

Offline FallenTree

  • BFF
  • ***
  • Posts: 484
    • View Profile
Re: bug with call_out and shadows
« Reply #7 on: January 13, 2014, 04:55:37 PM »
glad to hear!!  I want to get network multithreading done and we should start beta for 3.0!