[reSIProcate] Exception encountered when using reSIProcate in a multi-threaded program
kaiduan xie
kaiduanx at yahoo.ca
Mon Jul 18 17:43:20 CDT 2005
The thing is how to guarantee that the generated tid
is unique for each call on all platform? Can we borrow
the idea of generating UUID? For example, combining
MAC address and the NTP time stamp (counting seconds
since January 1, 1900 in the upper 32 bits, with the
lower 32 bits representing fractions of a second), and
then calculate a MD5 hash based on that?
kaiduan
--- david Butcher <david at purplecomm.com> wrote:
> This seems like a dandy way to crash a resiprocate
> based server.
> Thoughts?
>
> david
>
>
> Quoting Andy Agarwal <Andy at ingenio.com>:
>
> >
> > Thanks for the tip Jason. I ran my program with
> logging set to
> > Level::Stack and it seems that the stack is
> generating the same tid for
> > two different calls. The assertion error is
> encountered in the second
> > call.
> > In this particular example tid
> tid=5e3024011c490d44 was used to send the
> > BYE message for a certain call and then attempted
> to be used for an
> > INVITE message for another call.
> > I use the makeInvite function to generate the
> Invite msg -
> > auto_ptr<SipMessage> message(Helper::makeInvite(
> dest, from, contact));
> >
> >
> >
> > Here is an excerpt from the logs -
> >
> > *******************
> > *** Send INVITE ***
> > *******************
> > INFO | 20050718-121512.123 | UAC | RESIP:TRANSPORT
> | 1572 |
> > UdpTransport.cxx:30 | Creating UDP transport host=
> port=6050 ipv4=1
> > DEBUG | 20050718-121512.123 | UAC |
> RESIP:TRANSPORT | 1572 |
> > InternalTransport.cxx:87 | Creating fd=1816 V4/UDP
> > DEBUG | 20050718-121512.123 | UAC |
> RESIP:TRANSPORT | 1572 |
> > InternalTransport.cxx:95 | Binding to 0.0.0.0
> > DEBUG | 20050718-121515.123 | UAC | RESIP | 3592 |
> SipStack.cxx:269 |
> > SEND: SipReq: INVITE 14152484081 at 127.0.0.1:5060
> tid=ae72d62c905f5269
> > cseq=INVITE contact=1 / 1 from(tu)
> > Sent INVITE for port 1
> > STACK | 20050718-121515.138 | UAC |
> RESIP:TRANSACTION | 1572 |
> > TransactionState.cxx:190 | No matching transaction
> for SipReq: INVITE
> > 14152484081 at 127.0.0.1:5060 tid=ae72d62c905f5269
> cseq=INVITE contact=1 /
> > 1 from(tu)
> > STACK | 20050718-121515.138 | UAC |
> RESIP:TRANSACTION | 1572 |
> > TransactionState.cxx:45 | Creating new
> TransactionState:
> > tid=ae72d62c905f5269 [ ClientInvite/Calling
> reliable target=[ V4
> > 0.0.0.0:0 UNKNOWN_TRANSPORT connectionId=0 ]]
> > STACK | 20050718-121515.138 | UAC |
> RESIP:TRANSACTION | 1572 |
> > TransactionState.cxx:570 |
> TransactionState::processClientInvite:
> > SipReq: INVITE 14152484081 at 127.0.0.1:5060
> tid=ae72d62c905f5269
> > cseq=INVITE contact=1 / 1 from(tu)
> tid=ae72d62c905f5269 [
> > ClientInvite/Calling reliable target=[ V4
> 0.0.0.0:0 UNKNOWN_TRANSPORT
> > connectionId=0 ]]
> > DEBUG | 20050718-121515.138 | UAC |
> RESIP:TRANSACTION | 1572 |
> > TimerQueue.cxx:85 | Adding timer: Timer B
> tid=ae72d62c905f5269 ms=32000
> > STACK | 20050718-121515.138 | UAC |
> RESIP:TRANSACTION | 1572 |
> > TransactionState.cxx:1490 | sendToWire with no dns
> result:
> > tid=ae72d62c905f5269 [ ClientInvite/Calling
> reliable target=[ V4
> > 0.0.0.0:0 UNKNOWN_TRANSPORT connectionId=0 ]]
> > DEBUG | 20050718-121515.138 | UAC |
> RESIP:TRANSPORT | 1572 |
> > TransportSelector.cxx:243 | Looking up dns entries
> for
> > sip:14152484081 at 127.0.0.1:5060
> > DEBUG | 20050718-121515.138 | UAC | RESIP:DNS |
> 1572 | DnsResult.cxx:136
> > | DnsResult::lookup sip:14152484081 at 127.0.0.1:5060
> > DEBUG | 20050718-121515.138 | UAC | RESIP:DNS |
> 1572 | DnsResult.cxx:255
> > | Numeric result so return immediately: [ V4
> 127.0.0.1:5060 UDP
> > connectionId=0 ]
> > STACK | 20050718-121515.138 | UAC |
> RESIP:TRANSACTION | 1572 |
> > TransactionState.cxx:1329 | tid=ae72d62c905f5269 [
> ClientInvite/Calling
> > reliable target=[ V4 0.0.0.0:0 UNKNOWN_TRANSPORT
> connectionId=0 ]] got
> > DNS result: 127.0.0.1 --> [[ V4 127.0.0.1:5060 UDP
> connectionId=0 ]]
> > STACK | 20050718-121515.138 | UAC | RESIP:DNS |
> 1572 | DnsResult.cxx:128
> > | Returning next dns entry: [ V4 127.0.0.1:5060
> UDP connectionId=0 ]
> > STACK | 20050718-121515.138 | UAC |
> RESIP:TRANSACTION | 1572 |
> > TransactionState.cxx:1372 | Unreliable transport:
> tid=ae72d62c905f5269 [
> > ClientInvite/Calling unreliable target=[ V4
> 0.0.0.0:0 UNKNOWN_TRANSPORT
> > connectionId=0 ]]
> > DEBUG | 20050718-121515.138 | UAC |
> RESIP:TRANSACTION | 1572 |
> > TimerQueue.cxx:85 | Adding timer: Timer A
> tid=ae72d62c905f5269 ms=500
> > DEBUG | 20050718-121515.138 | UAC |
> RESIP:TRANSPORT | 1572 |
> > TransportSelector.cxx:514 | Looked up source for
> destination: [ V4
> > 127.0.0.1:5060 UDP connectionId=0 ] -> [ V4
> 127.0.0.1:6050 UDP
> > connectionId=0 ] sent-by= sent-port=6050
> > DEBUG | 20050718-121515.138 | UAC |
> RESIP:TRANSPORT | 1572 |
> > TransportSelector.cxx:740 | findTransport([ V4
> 127.0.0.1:6050 UDP
> > connectionId=0 ])
> > DEBUG | 20050718-121515.138 | UAC |
> RESIP:TRANSPORT | 1572 |
> > TransportSelector.cxx:759 | findTransport (any
> interface) => Transport:
> > [ V4 0.0.0.0:6050 UDP connectionId=0 ]
> > DEBUG | 20050718-121515.138 | UAC |
> RESIP:TRANSPORT | 1572 |
> > TransportSelector.cxx:620 | !sipit! Populated
> Contact:
> > <sip:1 at 127.0.0.1:6050>
> > DEBUG | 20050718-121515.138 | UAC |
> RESIP:TRANSPORT | 1572 |
> > TransportSelector.cxx:658 | Transmitting to [ V4
> 127.0.0.1:5060 UDP
> > received on: Transport: [ V4 0.0.0.0:6050 UDP
> connectionId=0 ]
> > connectionId=0 ] via [ V4 127.0.0.1:6050 UDP
> connectionId=0 ]INVITE
> > sip:14152484081 at 127.0.0.1:5060 SIP/2.0 To:
> > <sip:14152484081 at 127.0.0.1:5060>;transport=udp
> From:
> > <sip:1 at 127.0.0.1:6050>;transport=udp;tag=23482900
> Via: SIP/2.0/UDP
> >
>
127.0.0.1:6050;branch=z9hG4bK-d87543-ae72d62c905f5269-1--d87543-;rport
> > Call-ID:
>
8467be186c3de14a at YWdhcndhbC5rZWVuY29ycC5rZWVuLmNvbQ..
> CSeq: 1
> > INVITE Contact: <sip:1 at 127.0.0.1:6050>
> Max-Forwards: 70 Content-Length:
> >
> >
> > *******************
> > *** Recv 200 OK ***
> > *******************
> > DEBUG | 20050718-121515.170 | UAC |
> RESIP:TRANSPORT | 1572 |
> > Transport.cxx:209 | incoming from: [ V4
> 127.0.0.1:5060 UDP received on:
> > Transport: [ V4 0.0.0.0:6050 UDP connectionId=0 ]
> connectionId=0 ]
> > STACK | 20050718-121515.170 | UAC |
> RESIP:TRANSPORT | 1572 |
> > Transport.cxx:210 |
> > SIP/2.0 200 OK To:
> >
>
<sip:14152484081 at 127.0.0.1:5060>;transport=udp;tag=23482900
> From:
> > <sip:1 at 127.0.0.1:6050>;transport=udp;tag=23482900
> Via: SIP/2.0/UDP
> >
>
127.0.0.1:6050;branch=z9hG4bK-d87543-ae72d62c905f5269-1--d87543-;rport=6
> > 050 Call-ID:
>
8467be186c3de14a at YWdhcndhbC5rZWVuY29ycC5rZWVuLmNvbQ..
> CSeq:
> > 1 INVITE Contact:
> <sip:14152484081 at 127.0.0.1:5060>;transport=udp
> > Content-Length: 0
> > STACK | 20050718-121515.170 | UAC |
> RESIP:TRANSACTION | 1572 |
> > TransactionState.cxx:155 | Found matching
> transaction for SipResp: 200
> > tid=ae72d62c905f5269 cseq=INVITE
> contact=14152484081 at 127.0.0.1:5060 / 1
> > from(wire) -> tid=ae72d62c905f5269 [
> ClientInvite/Calling unreliable
> > target=[ V4 0.0.0.0:0 UNKNOWN_TRANSPORT
> connectionId=0
=== message truncated ===
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the resiprocate-devel
mailing list