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

Issue 852469 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 30
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 849369

Blocking:
issue 759794



Sign in to add a comment

Investigate whether test termination can break code coverage dumping

Project Member Reported by mmoroz@chromium.org, Jun 13 2018

Issue description

See https://bugs.chromium.org/p/chromium/issues/detail?id=851230#c25 and c#26.

I'm not actually sure that this is a real issue, but sometimes we have the following messages in the log:

BrowserTestBase received signal: Terminated. Backtrace:
#0 0x000018672630 base::debug::StackTrace::StackTrace()
#1 0x00001a4e28fe content::(anonymous namespace)::DumpStackTraceSignalHandler()
#2 0x7fc8dcf76030 <unknown>
#3 0x7fc8e3ae62b0 do_fcntl
#4 0x7fc8e3ae63a2 __libc_fcntl
#5 0x00002e466895 lprofOpenFileEx
#6 0x00002e4649ec __llvm_profile_write_file
#7 0x7fc8dcf78910 <unknown>
#8 0x7fc8dcf7896a exit
#9 0x7fc8dcf632b8 __libc_start_main
#10 0x0000088c202a __llvm_coverage_mapping

For example, https://chromium-coverage.appspot.com/reports/563951/linux/metadata/browser_tests.log :

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (29212 ms total)
[  PASSED  ] 1 test.
BrowserTestBase received signal: Terminated. Backtrace:
#0 0x0000182fa7e0 base::debug::StackTrace::StackTrace()
#1 0x00001a167ffe content::(anonymous namespace)::DumpStackTraceSignalHandler()
#2 0x7f10caea04b0 <unknown>
#3 0x00002e09a1c5 writeOneValueProfData
#4 0x00002e09a08b lprofWriteDataImpl
#5 0x00002e099e8c lprofWriteData
#6 0x00002e097cb7 __llvm_profile_write_file
#7 0x7f10caea4ff8 <unknown>
#8 0x7f10caea5045 exit
#9 0x7f10cae8b837 __libc_start_main
#10 0x00000886c02a __llvm_coverage_mapping

Obviously, interrupting a process in the middle of writing a file is a bad idea. It seems reasonable that LLVM Profiler doesn't try to avoid being terminated, as it's a right of the user to do so. That means, if this is a problem indeed, we have to fix it on Chromium side. Maybe we can increase some timeouts and avoid sending SIGTERM to test processes.
 

Comment 1 by mmoroz@chromium.org, Jun 13 2018

Even if the problem is real, I think the worst case is that we could miss coverage from a particular testcase, but the whole thing would not be corrupted.

In https://bugs.chromium.org/p/chromium/issues/detail?id=851230#c25 I said that it could be very bad as it could reset the counters, but that happened locally on my machine as I was trying to call __llvm_profile_write_file() + __llvm_profile_reset_counters() before I had added a thread-safety protection. Now, I don't see that issue reproducing anymore, which means this particular problem is no worse than any crash that could happen and leave us without coverage info as well.
Blockedon: 849369
Blocking: 759794
Owner: mmoroz@chromium.org
Status: Fixed (was: Untriaged)
Should be fixed as per c#1 and  issue 849369 .

Sign in to add a comment