New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 708968 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug-Regression



Sign in to add a comment

libjingle_xmpp_unittests tests crash

Reported by milko.le...@imgtec.com, Apr 6 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Steps to reproduce the problem:
1. Run libjingle_xmpp_unittests on Ubuntu 16.04

What is the expected behavior?
Unittests should execute

What went wrong?
Tests crashed with Segmentation fault

Did this work before? Yes Chromium r452779

Chrome version: 59.0.3063.0  Channel: n/a
OS Version: Ubuntu 16.04
Flash Version: 

Tests started crashing after this change landed: https://codereview.chromium.org/2694903005

gdb info:

Program received signal SIGSEGV, Segmentation fault.
0x000000000049b6c0 in rtc::Thread::ProcessMessages(int) ()
(gdb) bt
#0  0x000000000049b6c0 in rtc::Thread::ProcessMessages(int) ()
#1  0x0000000000413732 in rtc::TaskTest::Start() ()
#2  0x0000000000412dd5 in rtc::start_task_test_Timeout_Test::TestBody() ()
#3  0x000000000047c216 in testing::Test::Run() ()
#4  0x000000000047c9e0 in testing::TestInfo::Run() ()
#5  0x000000000047ceb7 in testing::TestCase::Run() ()
#6  0x0000000000483dc7 in testing::internal::UnitTestImpl::RunAllTests() ()
#7  0x0000000000483a47 in testing::UnitTest::Run() ()
#8  0x0000000000412cfc in main ()

(gdb) disassemble $pc-16, $pc+16
Dump of assembler code from 0x49b6b0 to 0x49b6d0:
   0x000000000049b6b0 <_ZN3rtc6Thread15ProcessMessagesEi+64>:	movl   $0x0,0x20(%rsp)
   0x000000000049b6b8 <_ZN3rtc6Thread15ProcessMessagesEi+72>:	xorps  %xmm0,%xmm0
   0x000000000049b6bb <_ZN3rtc6Thread15ProcessMessagesEi+75>:	movups %xmm0,0x28(%rsp)
=> 0x000000000049b6c0 <_ZN3rtc6Thread15ProcessMessagesEi+80>:	mov    (%rbx),%rax
   0x000000000049b6c3 <_ZN3rtc6Thread15ProcessMessagesEi+83>:	mov    $0x1,%ecx
   0x000000000049b6c8 <_ZN3rtc6Thread15ProcessMessagesEi+88>:	mov    %rbx,%rdi
   0x000000000049b6cb <_ZN3rtc6Thread15ProcessMessagesEi+91>:	mov    %rbp,%rsi
   0x000000000049b6ce <_ZN3rtc6Thread15ProcessMessagesEi+94>:	mov    %r15d,%edx
End of assembler dump.

(gdb) info r
rax            0x4bf9ae	4979118
rbx            0x0	0
rcx            0x431bde82d7b634db	4835703278458516699
rdx            0x2c8525b6	746923446
rsi            0x7fffffffd230	140737488343600
rdi            0x7fffffffd258	140737488343640
rbp            0x7fffffffd258	0x7fffffffd258
rsp            0x7fffffffd250	0x7fffffffd250
r8             0x1	1
r9             0x7ffff7dd22c0	140737351852736
r10            0x1	1
r11            0x246	582
r12            0x4b5ae5	4938469
r13            0x7fffffffd4f0	140737488344304
r14            0x2c85299e	746924446
r15            0x3e8	1000
rip            0x49b6c0	0x49b6c0 <rtc::Thread::ProcessMessages(int)+80>
eflags         0x10202	[ IF RF ]
cs             0x33	51
ss             0x2b	43
ds             0x0	0
es             0x0	0
fs             0x0	0
gs             0x0	0
 
Correction:

Did this work before? Yes Chromium r452778
Cc: kjellander@chromium.org
Owner: nisse@chromium.org
Status: Assigned (was: Unconfirmed)
*sigh* I forgot to add that test to Chromium when we moved the code in there as part of https://bugs.chromium.org/p/webrtc/issues/detail?id=5539.

I'll make it happen, so I filed 708983 for that.

Comment 3 by nisse@chromium.org, Apr 6 2017

Cc: nisse@chromium.org
Owner: henrika@chromium.org
I can reproduce this. Crash is caused by Thread::Current() returning null.

Calling ThreadManager::WrapCurrentThread (from within the debugger) makes Thread::Current return non-null.

I have little clue about how webrtc threads are handled in chromium. Is WrapCurrentThread supposed to be called automagically? Are there any expected differences in behavior when these unit tests were moved from webrtc to chromium?

I could try adding WrapCurrentThread calls to the test, but it's not clear to me if that is the right solution.

Henrik, do you know how rtc::Thread are supposed to work in chromium, or who I should ask about it? (I'd ask tommi if he weren't ooo).

Comment 4 by nisse@chromium.org, Apr 6 2017

Owner: nisse@chromium.org

Comment 5 by nisse@chromium.org, Apr 6 2017

Cc: henrika@chromium.org

Comment 6 by nisse@chromium.org, Apr 6 2017

I guess the changed behavior after move is due to webrtc's

config("rtc_base_chromium_config") {
  defines = [ "NO_MAIN_THREAD_WRAPPING" ]
}

See https://cs.chromium.org/chromium/src/third_party/webrtc/base/BUILD.gn?rcl=052975e1c555cdc2414d93b7965368367274a936&l=39
Components: Blink>WebRTC
Project Member

Comment 8 by bugdroid1@chromium.org, Apr 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/679c2b37f46e5542996e26304218bf922a4eb43e

commit 679c2b37f46e5542996e26304218bf922a4eb43e
Author: nisse <nisse@chromium.org>
Date: Fri Apr 07 07:32:52 2017

Add calls to WrapCurrentThread and UnwrapCurrentThread.

Needed after the move of the rtc::Task class and its tests, because
webrtc in chrome is built with NO_MAIN_THREAD_WRAPPING.

BUG= 708968 

Review-Url: https://codereview.chromium.org/2803023002
Cr-Commit-Position: refs/heads/master@{#462802}

[modify] https://crrev.com/679c2b37f46e5542996e26304218bf922a4eb43e/third_party/libjingle_xmpp/task_runner/task_unittest.cc

Comment 9 by nisse@chromium.org, Apr 7 2017

Should be fixed with the above commit. Can you check it works for you too?
Yes, it is working with https://codereview.chromium.org/2803023002
Status: Fixed (was: Assigned)
Thanks for testing. Marking as fixed.

Sign in to add a comment