[Ns-bugs] [Bug 131] New: Sending data in the TCP send callback causes infinite recursion

bugzilla-daemon@nsnam-www.ece.gatech.edu bugzilla-daemon at nsnam-www.ece.gatech.edu
Wed Feb 6 04:35:07 PST 2008


http://www.nsnam.org/bugzilla/show_bug.cgi?id=131

           Summary: Sending data in the TCP send callback causes infinite
                    recursion
           Product: ns-3
           Version: pre-release
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P3
         Component: internet-node
        AssignedTo: ns-bugs at isi.edu
        ReportedBy: gjcarneiro at gmail.com


In my simulation, I connect a TCP socket and then try to send data as fast as
TCP allows.  I register a "send callback", and in the callback I send more
data.  This causes TCP to call me again, recursively:

#3321 0x00000000004135f0 in BenchNode::TcpClientSendCallback (this=0x62dfd0,
socket=@0x7fffea70c140, dataSent=576)
    at ../utils/bench-olsr.cc:308
#3322 0x00000000004111ca in ns3::MemPtrCallbackImpl<BenchNode*, void
(BenchNode::*)(ns3::Ptr<ns3::Socket>, unsigned int), void,
ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty,
ns3::empty>::operator() (this=0x6344b0, 
    a1=@0x7fffea70c190, a2=576) at debug/ns3/callback.h:205
#3323 0x00002b26c08d9874 in ns3::Callback<void, ns3::Ptr<ns3::Socket>, unsigned
int, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()
(this=0x6ba4a0, a1=@0x7fffea70c1e0, a2=576) at debug/ns3/callback.h:314
#3324 0x00002b26c08d81e1 in ns3::Socket::NotifyDataSent (this=0x6ba450,
size=576) at ../src/node/socket.cc:198
#3325 0x00002b26c0918bef in ns3::TcpSocket::SendPendingData (this=0x6ba450,
withAck=false)
    at ../src/internet-node/tcp-socket.cc:740
#3326 0x00002b26c091d1fe in ns3::TcpSocket::ProcessAction (this=0x6ba450,
a=ns3::TX_DATA)
    at ../src/internet-node/tcp-socket.cc:525
#3327 0x00002b26c091f38a in ns3::TcpSocket::Send (this=0x6ba450,
p=@0x7fffea70c4b0) at ../src/internet-node/tcp-socket.cc:273
#3328 0x00000000004135f0 in BenchNode::TcpClientSendCallback (this=0x62dfd0,
socket=@0x7fffea70c510, dataSent=576)
    at ../utils/bench-olsr.cc:308

Some questions:

1. Is the "send callback" working correctly, i.e. are flow and congestion
control already implemented?  I would expect TCP to eventually stop calling me
to send more data, for some time...

2. Shouldn't there be a Schedule somewhere to break this loop and avoid
recursion?  Even if recursion were not "infinite", it's not very good to abuse
the call stack when it's easy to avoid via event schedule.


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Ns-bugs mailing list