New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 9 users
Status: Available
Owner: ----
Cc:
Components:
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment
SctpDataMediaChannelTest.ReusesAStream flaky on memcheck/lsan locally
Project Member Reported by pbos@webrtc.org, Sep 8 2014 Back to list
Getting memcheck bugs + test failures when running ReusingAStream locally, this is likely timing dependent as I'm getting it on memcheck/asan+lsan but not on a regular compile.

I'm not sure if the conditional jumps are relevant, but '[000:000] Warning(sctpdataengine.cc:658): chan1/connector->Add(Send|Recv)Stream(...): Not adding data stream '' with ssrc=1 because stream is still closing.' seems worth taking a look at, should we be blocking until this stream is closed?

Test run:

pbos@deimos:~/webrtc/trunk$ ninja-webrtc && valgrind out/Debug/libjingle_media_unittest --gtest_filter=SctpDataMediaChannelTest.ReusesAStream
ninja: Entering directory `out/Debug'
ninja: no work to do.
==36794== Memcheck, a memory error detector
==36794== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==36794== Using Valgrind-3.9.0.SVN and LibVEX; rerun with -h for copyright info
==36794== Command: out/Debug/libjingle_media_unittest --gtest_filter=SctpDataMediaChannelTest.ReusesAStream
==36794== 
==36794== Conditional jump or move depends on uninitialised value(s)
==36794==    at 0x4019B68: index (strchr.S:106)
==36794==    by 0x4007DED: expand_dynamic_string_token (dl-load.c:425)
==36794==    by 0x4008D71: _dl_map_object (dl-load.c:2538)
==36794==    by 0x40014BD: map_doit (rtld.c:627)
==36794==    by 0x400FFF3: _dl_catch_error (dl-error.c:187)
==36794==    by 0x4000B2E: do_preload (rtld.c:816)
==36794==    by 0x400446C: dl_main (rtld.c:1633)
==36794==    by 0x4017564: _dl_sysdep_start (dl-sysdep.c:249)
==36794==    by 0x4004CF7: _dl_start (rtld.c:332)
==36794==    by 0x40012D7: ??? (in /lib/x86_64-linux-gnu/ld-2.19.so)
==36794==    by 0x1: ???
==36794==    by 0xFFEFFFE16: ???
==36794== 
Note: Google Test filter = SctpDataMediaChannelTest.ReusesAStream
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from SctpDataMediaChannelTest
[ RUN      ] SctpDataMediaChannelTest.ReusesAStream
==36794== Conditional jump or move depends on uninitialised value(s)
==36794==    at 0x973C7F: sctp_findassociation_ep_addr (sctp_pcb.c:1479)
==36794==    by 0x998223: sctp_setopt (sctp_usrreq.c:5773)
==36794==    by 0x94085C: usrsctp_setsockopt (user_socket.c:2235)
==36794==    by 0x70A7D3: cricket::SctpDataMediaChannel::OpenSctpSocket() (sctpdataengine.cc:386)
==36794==    by 0x70AF9A: cricket::SctpDataMediaChannel::Connect() (sctpdataengine.cc:444)
==36794==    by 0x70B33B: cricket::SctpDataMediaChannel::SetSend(bool) (sctpdataengine.cc:479)
==36794==    by 0x4E7C99: SctpDataMediaChannelTest::SetupConnectedChannels() (sctpdataengine_unittest.cc:256)
==36794==    by 0x4E6584: SctpDataMediaChannelTest_ReusesAStream_Test::TestBody() (sctpdataengine_unittest.cc:482)
==36794==    by 0x8B0FF2: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2362)
==36794==    by 0x89EE0D: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2415)
==36794==    by 0x892C94: testing::Test::Run() (gtest.cc:2434)
==36794==    by 0x89339A: testing::TestInfo::Run() (gtest.cc:2610)
==36794== 
==36794== Conditional jump or move depends on uninitialised value(s)
==36794==    at 0x999403: sctp_setopt (sctp_usrreq.c:6064)
==36794==    by 0x94085C: usrsctp_setsockopt (user_socket.c:2235)
==36794==    by 0x70A7D3: cricket::SctpDataMediaChannel::OpenSctpSocket() (sctpdataengine.cc:386)
==36794==    by 0x70AF9A: cricket::SctpDataMediaChannel::Connect() (sctpdataengine.cc:444)
==36794==    by 0x70B33B: cricket::SctpDataMediaChannel::SetSend(bool) (sctpdataengine.cc:479)
==36794==    by 0x4E7C99: SctpDataMediaChannelTest::SetupConnectedChannels() (sctpdataengine_unittest.cc:256)
==36794==    by 0x4E6584: SctpDataMediaChannelTest_ReusesAStream_Test::TestBody() (sctpdataengine_unittest.cc:482)
==36794==    by 0x8B0FF2: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2362)
==36794==    by 0x89EE0D: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2415)
==36794==    by 0x892C94: testing::Test::Run() (gtest.cc:2434)
==36794==    by 0x89339A: testing::TestInfo::Run() (gtest.cc:2610)
==36794==    by 0x893999: testing::TestCase::Run() (gtest.cc:2728)
==36794== 
==36794== Conditional jump or move depends on uninitialised value(s)
==36794==    at 0x999465: sctp_setopt (sctp_usrreq.c:6070)
==36794==    by 0x94085C: usrsctp_setsockopt (user_socket.c:2235)
==36794==    by 0x70A7D3: cricket::SctpDataMediaChannel::OpenSctpSocket() (sctpdataengine.cc:386)
==36794==    by 0x70AF9A: cricket::SctpDataMediaChannel::Connect() (sctpdataengine.cc:444)
==36794==    by 0x70B33B: cricket::SctpDataMediaChannel::SetSend(bool) (sctpdataengine.cc:479)
==36794==    by 0x4E7C99: SctpDataMediaChannelTest::SetupConnectedChannels() (sctpdataengine_unittest.cc:256)
==36794==    by 0x4E6584: SctpDataMediaChannelTest_ReusesAStream_Test::TestBody() (sctpdataengine_unittest.cc:482)
==36794==    by 0x8B0FF2: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2362)
==36794==    by 0x89EE0D: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2415)
==36794==    by 0x892C94: testing::Test::Run() (gtest.cc:2434)
==36794==    by 0x89339A: testing::TestInfo::Run() (gtest.cc:2610)
==36794==    by 0x893999: testing::TestCase::Run() (gtest.cc:2728)
==36794== 
==36794== Conditional jump or move depends on uninitialised value(s)
==36794==    at 0x95FCB2: sctp_med_chunk_output (sctp_output.c:8807)
==36794==    by 0x95C93C: sctp_chunk_output (sctp_output.c:10581)
==36794==    by 0x94457A: sctp_common_input_processing (sctp_input.c:6126)
==36794==    by 0x941857: usrsctp_conninput (user_socket.c:3225)
==36794==    by 0x70C58E: cricket::SctpDataMediaChannel::OnPacketReceived(rtc::Buffer*, rtc::PacketTime const&) (sctpdataengine.cc:599)
==36794==    by 0x4ECCA7: SctpFakeNetworkInterface::OnMessage(rtc::Message*) (sctpdataengine_unittest.cc:88)
==36794==    by 0x4ECE5E: non-virtual thunk to SctpFakeNetworkInterface::OnMessage(rtc::Message*) (sctpdataengine_unittest.cc:91)
==36794==    by 0x7CFB81: rtc::MessageQueue::Dispatch(rtc::Message*) (messagequeue.cc:381)
==36794==    by 0x801975: rtc::Thread::ProcessMessages(int) (thread.cc:518)
==36794==    by 0x4E68EB: SctpDataMediaChannelTest_ReusesAStream_Test::TestBody() (sctpdataengine_unittest.cc:489)
==36794==    by 0x8B0FF2: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2362)
==36794==    by 0x89EE0D: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2415)
==36794== 
==36794== Conditional jump or move depends on uninitialised value(s)
==36794==    at 0x95FCB2: sctp_med_chunk_output (sctp_output.c:8807)
==36794==    by 0x95C93C: sctp_chunk_output (sctp_output.c:10581)
==36794==    by 0x9960B3: sctp_setopt (sctp_usrreq.c:5294)
==36794==    by 0x94085C: usrsctp_setsockopt (user_socket.c:2235)
==36794==    by 0x70DA1F: cricket::SctpDataMediaChannel::SendQueuedStreamResets() (sctpdataengine.cc:927)
==36794==    by 0x70BB9E: cricket::SctpDataMediaChannel::ResetStream(unsigned int) (sctpdataengine.cc:691)
==36794==    by 0x70B87A: cricket::SctpDataMediaChannel::RemoveSendStream(unsigned int) (sctpdataengine.cc:497)
==36794==    by 0x4E6B32: SctpDataMediaChannelTest_ReusesAStream_Test::TestBody() (sctpdataengine_unittest.cc:491)
==36794==    by 0x8B0FF2: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2362)
==36794==    by 0x89EE0D: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2415)
==36794==    by 0x892C94: testing::Test::Run() (gtest.cc:2434)
==36794==    by 0x89339A: testing::TestInfo::Run() (gtest.cc:2610)
==36794== 
[000:000] Warning(sctpdataengine.cc:658): chan1/connector->Add(Send|Recv)Stream(...): Not adding data stream '' with ssrc=1 because stream is still closing.
[000:027] Warning(sctpdataengine.cc:533): chan1/connector->SendData(...): Not sending data because ssrc is unknown: 1
../../talk/media/sctp/sctpdataengine_unittest.cc:497: Failure
Value of: SendData(channel1(), 1, "hi?", &result)
  Actual: false
Expected: true
[  FAILED  ] SctpDataMediaChannelTest.ReusesAStream (1506 ms)
[----------] 1 test from SctpDataMediaChannelTest (1524 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (2295 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] SctpDataMediaChannelTest.ReusesAStream

 1 FAILED TEST
==36794== 
==36794== HEAP SUMMARY:
==36794==     in use at exit: 80,518 bytes in 717 blocks
==36794==   total heap usage: 8,172 allocs, 7,455 frees, 1,063,177 bytes allocated
==36794== 
==36794== LEAK SUMMARY:
==36794==    definitely lost: 72 bytes in 1 blocks
==36794==    indirectly lost: 0 bytes in 0 blocks
==36794==      possibly lost: 31,154 bytes in 115 blocks
==36794==    still reachable: 49,292 bytes in 601 blocks
==36794==         suppressed: 0 bytes in 0 blocks
==36794== Rerun with --leak-check=full to see details of leaked memory
==36794== 
==36794== For counts of detected and suppressed errors, rerun with: -v
==36794== Use --track-origins=yes to see where uninitialised values come from
==36794== ERROR SUMMARY: 9 errors from 6 contexts (suppressed: 0 from 0)
 
Project Member Comment 1 by jiayl@webrtc.org, Sep 8 2014
Owner: lally@webrtc.org
Lally,

Do you have cycles to take a look? You are the one most familiar with the closing procedure.
Thanks!
Comment 2 by vrk@webrtc.org, Sep 29 2014
Labels: Area-Network
Comment 3 by vrk@webrtc.org, Nov 3 2014
Labels: EngTriaged Mstone-41
Project Member Comment 4 by pthatcher@webrtc.org, Jan 7 2015
Labels: -Mstone-41 Mstone-42
Project Member Comment 5 by pthatcher@webrtc.org, Feb 19 2015
Labels: -Mstone-42 Mstone-44
This looks like it's not hitting m42.  Update it if I'm wrong.
Comment 6 by lally@webrtc.org, Feb 20 2015
Yeah it's a timing issue, and it's because we're specifically asking for the same stream identifier (SID) while it's still busy closing.  We don't have blocking functionality when asking for a specific SID.  Essentially, we're sending a stream reset to the peer, and are waiting for the stream reset to come back to acknowledge it.  As we can only have a single stream reset on the wire at a time, we may actually be waiting for a prior stream reset to finish before even sending this one out.

Normally, apps just ask for a new stream without specifying the SID, and we get one that's not busy.

The right thing to do here is to either block the creation until the SID's available, or to fully error-out of the channel creation.
Project Member Comment 7 by braveyao@webrtc.org, May 19 2015
Cc: jiayl@webrtc.org lally@webrtc.org
 Issue 4505  has been merged into this issue.
Project Member Comment 8 by pbos@webrtc.org, May 19 2015
Cc: pthatcher@webrtc.org juberti@webrtc.org
Some more eyes.
Project Member Comment 9 by pbos@webrtc.org, May 19 2015
Should this be retriaged? I don't like that we have as many outstanding timing-related bugs that we seem to have.
Project Member Comment 10 by tnakamura@webrtc.org, Jan 29 2016
Labels: -Mstone-44
I don't see any CLs linked to this bug, so I don't think it's been fixed. Removing milestone label since this bug hasn't been updated in quite some time.
Project Member Comment 11 by juberti@webrtc.org, Jan 30 2016
Labels: -EngTriaged
Setting for retriage per #9
Project Member Comment 12 by pthatcher@webrtc.org, Feb 1 2016
Labels: EngTriaged
Lally, can you take a fresh look at this bug and let us know if it's still and issue or not, and if so what we should do?
Project Member Comment 13 by juberti@webrtc.org, Feb 2 2016
Labels: Hotlist-Testing
Project Member Comment 14 by pthatcher@webrtc.org, Nov 8 2016
Labels: Pri-3
Project Member Comment 15 by kjellander@webrtc.org, Dec 1 2016
Owner: ----
Status: Available
Removing lally@webrtc.org since he left Google a while ago.
Project Member Comment 16 by kjellander@webrtc.org, Dec 1 2016
Cc: -lally@webrtc.org
Sign in to add a comment