[JDEV] phew

David Le Corfec david.le-corfec at idealx.com
Fri Dec 1 10:08:41 CST 2000


Schuyler Heath wrote:

> > >From the jabberd -D point of view:
> >  logging in went fine
> >  received the roster information from xdbperl, sent it to jabber
> >  received the <presence/> tag from gabber
> >  delivering to instance xdbperl
> >  base_load.c:323 xdb_get() waiting for dennis at domain jabber:iq:roster
> >  at this point jabberd has died. No segfault, no error, just gone
> 
> Is your connection lost before you send the result?  If so, your result is
> never received so the request is timed out.  You will still see the
> "delivering to instance xdbperl" even though packet are not reaching your
> script.  Packet are buffered for a default of 30 seconds before they
> are bounced.  This is to give the client a chance to reconnect.  Unfortunately,
> there seems to be a bug that makes jabberd die when a xdb request is resent after
> 5 seconds (or something along those lines).

I've posted about this some time ago :
http://mailman.jabber.org/pipermail/jdev/2000-November/003768.html

Here's the related patch to avoid segfault on the xdb_get :

--- jsm/modules.c.orig  Mon Oct 23 11:08:27 2000
+++ jsm/modules.c   Mon Nov 20 10:44:34 2000
@@ -121,6 +121,8 @@ int js_mapi_call(jsmi si, event e, jpack
     mlist l;
     _mapi m;           /* mapi structure to be passed to the call back */
 
+    if (user)
+        user->ref++;
     log_debug(ZONE,"mapi_call %d",e);
 
     /* this is a session event */
@@ -155,11 +157,15 @@ log_debug(ZONE,"MAPI %X",l);
             break;
         /* this module handled the packet */
         case M_HANDLED:
+            if (user)
+                user->ref--;
             return 1;
         default:
         }
     }
 
+    if (user)
+        user->ref--;
     log_debug(ZONE,"mapi_call returning unhandled");
 
     /* if we got here, no module handled the packet */


However, in the case where you have a xdb_get followed by a xdb_set
(eg. to store an offline message), the xdb_get will timeout nicely,
then the xdb_set will do a segfault on the following line :

[jabberd/io/base_load.c:xdb_set()]

        pth_mutex_acquire(&mutex, FALSE, NULL);

But there I've no clue :(

For now, handling correctly all namespaces seems the safest way ...

-- 
David Le Corfec




More information about the JDev mailing list