|
|
Chromium Code Reviews|
Created:
4 years, 3 months ago by Florian Schneider Modified:
4 years, 3 months ago CC:
reviews_dartlang.org, rmacnak Target Ref:
refs/heads/master Visibility:
Public. |
Descriptiontest.dart: Print stack traces of all threads when a test times out
This helps diagnosing tests timing out when running test.py.
BUG=
R=whesse@google.com
Committed: https://github.com/dart-lang/sdk/commit/30f16437b1fcdcf81748890b486d449136808a4c
Patch Set 1 #
Total comments: 5
Patch Set 2 : addressed comments #Patch Set 3 : use eu-stack #Messages
Total messages: 12 (4 generated)
fschneider@google.com changed reviewers: + whesse@google.com
Would something like this work?
rmacnak@google.com changed reviewers: + rmacnak@google.com
https://codereview.chromium.org/2320473004/diff/1/tools/testing/dart/test_run... File tools/testing/dart/test_runner.dart (right): https://codereview.chromium.org/2320473004/diff/1/tools/testing/dart/test_run... tools/testing/dart/test_runner.dart:1857: io.Process.run('gdb', Only attempt to use gdb on Linux.
asiva@google.com changed reviewers: + asiva@google.com
https://codereview.chromium.org/2320473004/diff/1/tools/testing/dart/test_run... File tools/testing/dart/test_runner.dart (right): https://codereview.chromium.org/2320473004/diff/1/tools/testing/dart/test_run... tools/testing/dart/test_runner.dart:1864: }) Do we also need a catchError handler here to print a diagnostic message if gdb fails to start. We also have to be sure that the bots have the process attach capability set (see /etc/sysctl.d/10-ptrace.conf).
https://codereview.chromium.org/2320473004/diff/1/tools/testing/dart/test_run... File tools/testing/dart/test_runner.dart (right): https://codereview.chromium.org/2320473004/diff/1/tools/testing/dart/test_run... tools/testing/dart/test_runner.dart:1857: io.Process.run('gdb', On 2016/09/07 19:33:47, rmacnak wrote: > Only attempt to use gdb on Linux. Done. https://codereview.chromium.org/2320473004/diff/1/tools/testing/dart/test_run... tools/testing/dart/test_runner.dart:1864: }) On 2016/09/07 19:55:20, siva wrote: > Do we also need a catchError handler here to print a diagnostic message if gdb > fails to start. > Yes. Added printing. Also, I should only invoke gdb if it is available on the system. Is there a standard way in Dart to find if gdb is installed on a system? > We also have to be sure that the bots have the process attach capability set > (see /etc/sysctl.d/10-ptrace.conf).
lgtm https://codereview.chromium.org/2320473004/diff/1/tools/testing/dart/test_run... File tools/testing/dart/test_runner.dart (right): https://codereview.chromium.org/2320473004/diff/1/tools/testing/dart/test_run... tools/testing/dart/test_runner.dart:1864: }) On 2016/09/07 21:02:58, Florian Schneider wrote: > On 2016/09/07 19:55:20, siva wrote: > > Do we also need a catchError handler here to print a diagnostic message if gdb > > fails to start. > > > > Yes. Added printing. Also, I should only invoke gdb if it is available on the > system. Is there a standard way in Dart to find if gdb is installed on a system? > > > We also have to be sure that the bots have the process attach capability set > > (see /etc/sysctl.d/10-ptrace.conf). > I would just run "which gdb" in a subprocess, and check the return code.
/usr/bin/eu-stack also seems to produce a stack trace for a process, something like eu-stack -p 1466 produces PID 1466 - process TID 1466: #0 0x00007fa639c17404 pthread_cond_wait@@GLIBC_2.3.2 #1 0x000000000076b326 dart::Monitor::WaitMicros(long) #2 0x000000000058e07a Dart_RunLoop #3 0x0000000000566bde dart::bin::RunMainIsolate(char const*, dart::bin::CommandLineOptions*) #4 0x0000000000560398 dart::bin::main(int, char**) #5 0x0000000000560549 main #6 0x00007fa638c3bf45 __libc_start_main #7 0x00000000005650cb _start TID 1467: #0 0x00007fa638d14a13 epoll_wait #1 0x000000000059e995 dart::bin::EventHandlerImplementation::Poll(unsigned long) #2 0x0000000000599c39 dart::bin::ThreadStart(void*) #3 0x00007fa639c13184 start_thread #4 0x00007fa638d1437d __clone TID 1468: #0 0x00007fa639c177be pthread_cond_timedwait@@GLIBC_2.3.2 #1 0x000000000076b405 dart::Monitor::WaitMicros(long) #2 0x000000000083b6ec dart::ThreadInterrupter::ThreadMain(unsigned long) #3 0x000000000076a826 dart::ThreadStart(void*) #4 0x00007fa639c13184 start_thread #5 0x00007fa638d1437d __clone TID 1469: #0 0x00007fa639c17404 pthread_cond_wait@@GLIBC_2.3.2 #1 0x000000000076b326 dart::Monitor::WaitMicros(long) #2 0x00000000005e158a dart::BackgroundCompiler::Run() #3 0x000000000083c5ac dart::ThreadPool::Worker::Loop() #4 0x000000000083c76f dart::ThreadPool::Worker::Main(unsigned long) #5 0x000000000076a826 dart::ThreadStart(void*) #6 0x00007fa639c13184 start_thread #7 0x00007fa638d1437d __clone TID 1470: #0 0x00007fa638d0572d write #1 0x00007fa638c92f03 _IO_file_write@@GLIBC_2.2.5 #2 0x00007fa638c943dc _IO_do_write@@GLIBC_2.2.5 #3 0x00007fa638c947b3 _IO_file_overflow@@GLIBC_2.2.5 #4 0x00007fa638c8b4e9 fputc #5 0x00000000005677dd dart::bin::Builtin_Builtin_PrintString(_Dart_NativeArguments*) #6 0x00000000006ffea9 dart::NativeEntry::NativeCallWrapperNoStackCheck(_Dart_NativeArguments*, void (*)(_Dart_NativeArguments*)) #7 0x00007fa639e956af
On 2016/09/08 16:42:41, siva wrote: > /usr/bin/eu-stack also seems to produce a stack trace > for a process, something like > > eu-stack -p 1466 > > produces > > PID 1466 - process > TID 1466: > #0 0x00007fa639c17404 mailto:pthread_cond_wait@@GLIBC_2.3.2 > #1 0x000000000076b326 dart::Monitor::WaitMicros(long) > #2 0x000000000058e07a Dart_RunLoop > #3 0x0000000000566bde dart::bin::RunMainIsolate(char const*, > dart::bin::CommandLineOptions*) > #4 0x0000000000560398 dart::bin::main(int, char**) > #5 0x0000000000560549 main > #6 0x00007fa638c3bf45 __libc_start_main > #7 0x00000000005650cb _start > TID 1467: > #0 0x00007fa638d14a13 epoll_wait > #1 0x000000000059e995 dart::bin::EventHandlerImplementation::Poll(unsigned > long) > #2 0x0000000000599c39 dart::bin::ThreadStart(void*) > #3 0x00007fa639c13184 start_thread > #4 0x00007fa638d1437d __clone > TID 1468: > #0 0x00007fa639c177be mailto:pthread_cond_timedwait@@GLIBC_2.3.2 > #1 0x000000000076b405 dart::Monitor::WaitMicros(long) > #2 0x000000000083b6ec dart::ThreadInterrupter::ThreadMain(unsigned long) > #3 0x000000000076a826 dart::ThreadStart(void*) > #4 0x00007fa639c13184 start_thread > #5 0x00007fa638d1437d __clone > TID 1469: > #0 0x00007fa639c17404 mailto:pthread_cond_wait@@GLIBC_2.3.2 > #1 0x000000000076b326 dart::Monitor::WaitMicros(long) > #2 0x00000000005e158a dart::BackgroundCompiler::Run() > #3 0x000000000083c5ac dart::ThreadPool::Worker::Loop() > #4 0x000000000083c76f dart::ThreadPool::Worker::Main(unsigned long) > #5 0x000000000076a826 dart::ThreadStart(void*) > #6 0x00007fa639c13184 start_thread > #7 0x00007fa638d1437d __clone > TID 1470: > #0 0x00007fa638d0572d write > #1 0x00007fa638c92f03 mailto:_IO_file_write@@GLIBC_2.2.5 > #2 0x00007fa638c943dc mailto:_IO_do_write@@GLIBC_2.2.5 > #3 0x00007fa638c947b3 mailto:_IO_file_overflow@@GLIBC_2.2.5 > #4 0x00007fa638c8b4e9 fputc > #5 0x00000000005677dd > dart::bin::Builtin_Builtin_PrintString(_Dart_NativeArguments*) > #6 0x00000000006ffea9 > dart::NativeEntry::NativeCallWrapperNoStackCheck(_Dart_NativeArguments*, void > (*)(_Dart_NativeArguments*)) > #7 0x00007fa639e956af Thanks. I assume it needs the same permission as gdb, right?
Description was changed from ========== test.dart: Print stack traces of all threads when a test times out This helps diagnosing tests timing out when running test.py. BUG= ========== to ========== test.dart: Print stack traces of all threads when a test times out This helps diagnosing tests timing out when running test.py. BUG= R=whesse@google.com Committed: https://github.com/dart-lang/sdk/commit/30f16437b1fcdcf81748890b486d449136808a4c ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as 30f16437b1fcdcf81748890b486d449136808a4c (presubmit successful). |
