A couple of (tcp related?) crashes with g++-4.9

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

A couple of (tcp related?) crashes with g++-4.9

Stefano Avallone
Hello,

I noticed that the tcp-datasentcb test suite (current ns-3-dev) crashes under g++-4.9.2
(Ubuntu 15.04 VM).

Also, the example "adaptive-red-tests --testNumber=13" crashes as well (under g++-4.9.2)
on my tc-next branch which includes my recent queue-rework. I know my work should be
the culprit, but running the example under gdb I get:

[...]
Enqueue in packets mode bytesInQueue  0 Qavg 0
packetsInQueue  0 Qavg 0Enqueue in packets mode bytesInQueue  0
        Qavg 18.7979 packetsInQueue  0 Qavg 18.7979Enqueue
in packets mode bytesInQueue  0 Qavg 18.7603
 packetsInQueue  0 Qavg 18.7603Enqueue in packets mode
bytesInQueue  0 Qavg 18.7227 packetsInQueue  0
Qavg 18.7227

Enqueue in packets mode bytesInQueue  0 Qavg 0
packetsInQueue  0 Qavg 0

Enqueue in packets mode bytesInQueue  0 Qavg 0
packetsInQueue  0 Qavg 0Enqueue in packets mode bytesInQueue  0
        Qavg 0 packetsInQueue  0 Qavg 0


src/internet/model/tcp-tx-buffer.cc:1028[1]
_src/internet/model/tcp-tx-buffer.cc:1028_
src/internet/model/tcp-socket-base.cc:3215[2]
src/core/model/event-impl.cc:51[3]
src/core/model/default-simulator-impl.cc:149[4]
src/core/model/default-simulator-impl.cc:202[5]
src/core/model/simulator.cc:230[6]
src/traffic-control/examples/adaptive-red-tests.cc:480[7]

So, maybe it could be the same issue that causes a crash in the tcp-datasentcb test.

Could anyone please have a look into this?

Thanks,
Stefano



--------
[1] http://src/internet/model/tcp-tx-buffer.cc:1028
[2] http://src/internet/model/tcp-socket-base.cc:3215
[3] http://src/core/model/event-impl.cc:51
[4] http://src/core/model/default-simulator-impl.cc:149
[5] http://src/core/model/default-simulator-impl.cc:202
[6] http://src/core/model/simulator.cc:230
[7] http://src/traffic-control/examples/adaptive-red-tests.cc:480
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A couple of (tcp related?) crashes with g++-4.9

Natale Patriciello
On 14/02/17 at 11:36, Stefano Avallone wrote:
> Hello,
>
> I noticed that the tcp-datasentcb test suite (current ns-3-dev) crashes under g++-4.9.2
> (Ubuntu 15.04 VM).
>

Hi Stefano,

Tom reported these problems (including the tcp-datasentcb) but I can't
reproduce them on ArchLinux (gcc 6.3.1). Also valgrind does not report
anything.

I will search an ubuntu machine and then try to see what is happening.
Any hint is appreciated :)

Nat
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A couple of (tcp related?) crashes with g++-4.9

Stefano Avallone
On martedì 14 febbraio 2017 13:04:43 CET Natale Patriciello wrote:

> On 14/02/17 at 11:36, Stefano Avallone wrote:
> > Hello,
> >
> > I noticed that the tcp-datasentcb test suite (current ns-3-dev) crashes
> > under g++-4.9.2 (Ubuntu 15.04 VM).
>
> Hi Stefano,
>
> Tom reported these problems (including the tcp-datasentcb) but I can't
> reproduce them on ArchLinux (gcc 6.3.1). Also valgrind does not report
> anything.
>
> I will search an ubuntu machine and then try to see what is happening.
> Any hint is appreciated :)

Hi Natale,

I am using a VM running Ubuntu 15.04. If you want, I can send you the disk
image I am using. Otherwise, you can set it up by yourself (Ubuntu 15.04 ISO
can be downloaded from http://old-releases.ubuntu.com/releases/15.04/).

Thanks,
Stefano



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A couple of (tcp related?) crashes with g++-4.9

Natale Patriciello
On 14/02/17 at 12:21, Stefano Avallone wrote:
> Hi Natale,
>
> I am using a VM running Ubuntu 15.04. If you want, I can send you the disk
> image I am using. Otherwise, you can set it up by yourself (Ubuntu 15.04 ISO
> can be downloaded from http://old-releases.ubuntu.com/releases/15.04/).
>

Thank you,

but I've managed to install GCC 4.9.4 on Archlinux and effectively I
have these crashes.

The thing is that they are very random. I mean, if you take the
tcp-datasentcb (it is build in order to have many different combinations
of status, but in the end the reported sent data value should be
consistent) and remove the last test, the test passes. If you just run
the last test (commenting the others) the test passes as well.

I tried on Ubuntu 15.10 (gcc 5.2) and everything is fine. There is
something with the memory, but which relates only to that specific gcc
4.9 branch... very strange.

Nat
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A couple of (tcp related?) crashes with g++-4.9

Tom Henderson-2
In reply to this post by Natale Patriciello
On 02/14/2017 04:04 AM, Natale Patriciello wrote:

> On 14/02/17 at 11:36, Stefano Avallone wrote:
>> Hello,
>>
>> I noticed that the tcp-datasentcb test suite (current ns-3-dev) crashes under g++-4.9.2
>> (Ubuntu 15.04 VM).
>>
> Hi Stefano,
>
> Tom reported these problems (including the tcp-datasentcb) but I can't
> reproduce them on ArchLinux (gcc 6.3.1). Also valgrind does not report
> anything.
>
> I will search an ubuntu machine and then try to see what is happening.
> Any hint is appreciated :)
>
> Nat

It reproduces also on gcc-5.3.1; there appears to be a memory access
problem.  Natale, I will send you (off list) the valgrind trace and give
you access to a machine if you need.

- Tom


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A couple of (tcp related?) crashes with g++-4.9

Natale Patriciello
On 14/02/17 at 06:56, Tom Henderson wrote:
> It reproduces also on gcc-5.3.1; there appears to be a memory access
> problem.  Natale, I will send you (off list) the valgrind trace and give you
> access to a machine if you need.
>

Can you please check if the following patch solves the problem on that
compiler? On 4.9.x, it seems yes (and also fixed the crashes in the
other tests). Still, I don't understand why this error is not triggered
by all gccs.

If it works, could you please apply it to ns-3-dev ?

Thanks!

Nat

diff --git i/src/internet/model/tcp-tx-buffer.cc w/src/internet/model/tcp-tx-buffer.cc
index 6ad74cc25..055dec90b 100644
--- i/src/internet/model/tcp-tx-buffer.cc
+++ w/src/internet/model/tcp-tx-buffer.cc
@@ -1022,13 +1022,13 @@ TcpTxBuffer::IsHeadRetransmitted () const
 {
   NS_LOG_FUNCTION (this);

-  TcpTxItem *item = m_sentList.front ();
-  if (item != 0)
+  if (m_sentSize == 0)
     {
-      return item->m_retrans;
+      return false;
     }

-  return false;
+  NS_ASSERT (m_sentList.size () > 0);
+  return m_sentList.front ()->m_retrans;
 }

 Ptr<const TcpOptionSack>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A couple of (tcp related?) crashes with g++-4.9

Tom Henderson-2
On 02/14/2017 09:29 AM, Natale Patriciello wrote:

> On 14/02/17 at 06:56, Tom Henderson wrote:
>> It reproduces also on gcc-5.3.1; there appears to be a memory access
>> problem.  Natale, I will send you (off list) the valgrind trace and give you
>> access to a machine if you need.
>>
> Can you please check if the following patch solves the problem on that
> compiler? On 4.9.x, it seems yes (and also fixed the crashes in the
> other tests). Still, I don't understand why this error is not triggered
> by all gccs.
>
> If it works, could you please apply it to ns-3-dev ?

Natale, your patch clears all of the errors for me, so I will apply it.

Thanks,
Tom
Loading...