XMPP SRV records and related crash

Bug #141344 reported by sander on 2007-09-20
4
Affects Status Importance Assigned to Milestone
Coccinella
Critical
Mats

Bug Description

Support for XMPP SRV records helps in a clustered server setup using SRV Records. It also may fix a crash of Coccinella in some scenarios. See also: http://coccinella.im/node/87

sander (s-devrieze) on 2007-09-20
Changed in coccinella:
assignee: nobody → matsben
importance: Undecided → High
sander (s-devrieze) wrote :
Download full text (74.9 KiB)

When connecting to 3gnt.net (using SRV records) using 0.96.4 on Mac OS X 10.4, I get the following error:

too many nested evaluations (infinite loop?)
too many nested evaluations (infinite loop?)
    while executing
"set node {}"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 [list set $nodeVar $node]"
    (procedure "splitjidex" line 24)
    invoked from within
"splitjidex $jid node domain resource"
    (procedure "jlib::jidmap" line 8)
    invoked from within
"jlib::jidmap $jid"
    (procedure "types" line 5)
    invoked from within
"$cmd $jlibname 3gnt.net"
    ("eval" body line 1)
    invoked from within
"eval {$cmd $jlibname} $args"
    (procedure "::jlib::disco::cmdproc" line 4)
    invoked from within
"::jlib::disco::cmdproc ::jlib::jlib1 types 3gnt.net"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 $ensamble($cmd,cmd) $jlibname $args"
    (procedure "jlib::cmdproc" line 6)
    invoked from within
"jlib::cmdproc ::jlib::jlib1 disco types 3gnt.net"
    ("eval" body line 1)
    invoked from within
"eval jlib::cmdproc {::jlib::jlib1} $cmd $args"
    (procedure "::jlib::jlib1" line 1)
    invoked from within
"$jstate(jlib) disco types $jid"
    (procedure "IsJidBranchCategory" line 7)
    invoked from within
"IsJidBranchCategory $jid"
    (procedure "IsBranchCategory" line 5)
    invoked from within
"IsBranchCategory $jid $node"
    (procedure "TreeItem" line 40)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
    invoked from within
"TreeItem $cv"
    (procedure "TreeItem" line 92)
...

Changed in coccinella:
importance: High → Critical
sander (s-devrieze) wrote :

update: sergio will translate Coccinella to Portuguese when this bug is fixed B-)

Mats (matsben) wrote :

This problem is unrelated to DNS SRV records (which is indeed supported).
It seems that there is a circular reference in the disco tree somehow, where a (JID node) combination references itself. This is the only way I can see this happen.
I have therefore added a fallback for this case to ease debugging:

    incr treeRefCount
    if {$treeRefCount > 20} {
 puts "+++ max refCount had been reached, likely a circular reference in disco tree: vstruct=$vstruct"
    }

This shall be used together with
set debugLevel 4
in Coccinella.tcl as usual.
Best would be if I could get an account there myself, but there is no online registration.

You can use the test account; see the end of my previous comment!

2007/12/19, Mats <email address hidden>:
> This problem is unrelated to DNS SRV records (which is indeed supported).
> It seems that there is a circular reference in the disco tree somehow, where a (JID node) combination references itself. This is the only way I can see this happen.
> I have therefore added a fallback for this case to ease debugging:
>
> incr treeRefCount
> if {$treeRefCount > 20} {
> puts "+++ max refCount had been reached, likely a circular reference in disco tree: vstruct=$vstruct"
> }
>
> This shall be used together with
> set debugLevel 4
> in Coccinella.tcl as usual.
> Best would be if I could get an account there myself, but there is no online registration.
>
> --
> XMPP SRV records and related crash
> https://bugs.launchpad.net/bugs/141344
> You received this bug notification because you are a direct subscriber
> of the bug.
>
>

--
Mvg, Sander Devrieze.

Mats (matsben) wrote :

What I suspected!
There is a circular reference!
I get:

RECV: <iq from='3gnt.net' to='sander@3gnt.net/coci' id='1004' type='result'>
          <query xmlns='http://jabber.org/protocol/disco#items'>
       <item jid='3gnt.net'/><item jid='aim.3gnt.org'/>...

The server adds itself as a child of itself. This goes coconuts!

I need to think of better protection for circular references like this that works in more general cases.

Mats (matsben) wrote :

 * [Bugfix]: Bug #141344; allow only single recursion of TreeItem in order to avoid circular
   references where a disco item has itself as a child. NB; the reported bug had nothing to do with any
   DNS records.

See attached shot for a real case.

Changed in coccinella:
status: New → Fix Committed
sander (s-devrieze) on 2007-12-20
Changed in coccinella:
milestone: none → 0.96.4.1
Sérgio Araújo (sergio-3gnt) wrote :
Download full text (6.8 KiB)

Hi,

I still can't login to the 3gnt.net server:

I get the following output in the debug window:

SEND: <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' xml:lang='en' to='3gnt.net'>
RECV: <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='3278485249' from='3gnt.net' xml:lang='pt'>
SEND: <iq type='set' id='1044'><query xmlns='jabber:iq:auth'><username>sergio</username><resource>Coccinella@SERGIO-ARAUJO</resource><password>XXX</password></query></iq>
RECV: <iq type='result' id='1044'/>
SEND: <iq type='get' id='1045' to='3gnt.net'><query xmlns='http://jabber.org/protocol/disco#items'/></iq>
SEND: <iq type='get' id='1046' to='3gnt.net'><query xmlns='http://jabber.org/protocol/disco#info'/></iq>
SEND: <iq type='get' id='1047'><query xmlns='jabber:iq:private'><storage xmlns='storage:bookmarks'/></query></iq>
SEND: <iq type='get' id='1048'><query xmlns='jabber:iq:roster'/></iq>
SEND: <presence><x xmlns='http://coccinella.sourceforge.net/protocol/servers' ver='0.96.5'><ip protocol='putget' port='8235'>10.0.12.6</ip><ip protocol='http' port='8077'>10.0.12.6</ip></x><c xmlns='http://jabber.org/protocol/caps' node='http://coccinella.sourceforge.net/protocol/caps' ver='aImx072yQt0U2xRZEDcq3T3a4DM=' ext='activity geoloc iax mood nick whiteboard'/><x xmlns='http://jabber.org/protocol/jingle/media/audio' type='available'/></presence>
RECV: <iq from='3gnt.net' to='sergio@3gnt.net/Coccinella@SERGIO-ARAUJO' id='1045' type='result'><query xmlns='http://jabber.org/protocol/disco#items'><item jid='3gnt.net'/><item jid='aim.3gnt.org'/><item jid='conference.3gnt.org'/><item jid='echo.3gnt.org'/><item jid='icq.3gnt.org'/><item jid='irc.3gnt.org'/><item jid='irc2.3gnt.org'/><item jid='jud.3gnt.org'/><item jid='msn.3gnt.org'/><item jid='pubsub.3gnt.org'/><item jid='yahoo.3gnt.org'/><item jid='3gnt.net' node='announce' name='Announcements'/><item jid='3gnt.net' name='Configuration' node='config'/><item jid='3gnt.net' name='Online Users' node='online users'/><item jid='3gnt.net' name='All Users' node='all users'/><item jid='3gnt.net' name='Outgoing s2s Connections' node='outgoing s2s'/><item jid='3gnt.net' name='Running Nodes' node='running nodes'/><item jid='3gnt.net' name='Stopped Nodes' node='stopped nodes'/></query></iq>

I also get the following warning message:

wrong # args: should be "AccessIsCategoryType jid ?node?"
wrong # args: should be "AccessIsCategoryType jid ?node?"
    while executing
"AccessIsCategoryType "hierarchy/leaf" $jid $node"
    (procedure "IsBranchNode" line 12)
    invoked from within
"IsBranchNode $jid $node"
    (procedure "IsBranchCategory" line 9)
    invoked from within
"IsBranchCategory $jid $node"
    (procedure "TreeItem" line 41)
    invoked from within
"TreeItem $cv $level"
    (procedure "TreeItem" line 100)
    invoked from within
"TreeItem $vstruct"
    (procedure "::Disco::ItemsCB" line 41)
    invoked from within
"::Disco::ItemsCB {} ::jlib::jlib1 result 3gnt.net {query {xmlns http://jabber.org/protocol/disco#items} 0 {} {{item {jid 3gnt.net} 1 {} {}} {item {jid..."
    ("uplevel" body line 1)
 ...

Read more...

Mats (matsben) wrote :

Thanks for you report.
This bug was unrelated to your previous issue but came from some brand
new code we are using to cache disco-info results. It was more or less
a typo by me. Fixed in cvs.

/Mats

sander (s-devrieze) on 2008-01-09
Changed in coccinella:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers