<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.2.3">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#ffffff">
Hi,<BR>
<BR>
For the bad data...&nbsp; I am not sure how I got it into that state.&nbsp; It happened to me today with the old presence code when I was changing my kamailio.cfg and things weren't being cleared out of the DB.&nbsp; I do not think this a bug in the new presence module.&nbsp; I think it is in the current code as well.&nbsp; I have two theories:
<OL TYPE=1>
    <LI TYPE=1 VALUE=1>There is a problem with the code in or around the loop in get_subs_db() so if you end up with more than one matching record you get a crash.
    <LI TYPE=1 VALUE=2>The db result in get_subs_db() is too big and maybe db_fetch_query() should be used.
</OL>
<BR>
The two error message that were coming out (before and separate to the crash) are showing an error in either the new presence module or RLS, and I think it is possible for records to get left in active_watchers between client sessions when those errors occur.&nbsp; If that is what is happening then the crash in the new code could be happening for the same reason it happens in the old code.&nbsp; That is, there is a problem when there are multiple results from the query in get_subs_db().<BR>
<BR>
Peter<BR>
<BR>
<BR>
On Thu, 2012-03-01 at 16:55 +0200, Anca Vamanu wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
    Hi Peter,<BR>
    <BR>
    <BR>
    So the cause was bad data in the db? Was that data corrupted by an external application, or did presence module insert bad data?<BR>
    I would really like to investigate this problem thoroughly to be sure there isn't a bug in the new code.<BR>
    <BR>
    Regards,<BR>
    Anca <BR>
    <BR>
    <BR>
    On 03/01/2012 04:45 PM, Peter Dunkley wrote: <BR>
    <BLOCKQUOTE TYPE=CITE>
        Hi,<BR>
        <BR>
        I've been doing more investigation myself.&nbsp; It seems that even with old presence module I can get it to crash here if the records in the DB are &quot;broken&quot; enough.&nbsp; So I think it was just a co-incidence that I first spotted the crash with the new code.&nbsp; I suspect that with the two errors coming out of the new presence code (and the state things are in when they come out) it is just easier to get the DB records broken in the right way.<BR>
        <BR>
        The error messages are actually the bigger issue as they are stopping presence and RLS working together.<BR>
        <BR>
        Thanks,<BR>
        <BR>
        Peter<BR>
        <BR>
        <TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</PRE>
</TD>
</TR>
</TABLE>
    </BLOCKQUOTE>
    <BR>
<PRE>
_______________________________________________
sr-dev mailing list
<A HREF="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</A>
<A HREF="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</A>
</PRE>
</BLOCKQUOTE>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>