[compiler-rt] r308984 - Revert "[compiler-rt] Include thread ID into sanitizers logs"

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 16:11:02 PDT 2017


D'oh, r308637 wasn't on the branch, because we branched at r308441.
Sorry for the noise.

On Thu, Aug 10, 2017 at 3:48 PM, Vitaly Buka <vitalybuka at google.com> wrote:
> Yes please.
> Reverted change conflicted with sandboxes which block GetTid calls. I am not
> sure how frequent this setup, but revert is definitely the safest approach.
> Also it's unlikely that I will try to resubmit it, so 6.0 will have 4.0
> format anyway.
>
> On Thu, Aug 10, 2017 at 3:39 PM, Hans Wennborg <hans at chromium.org> wrote:
>>
>> Should this be merged to 5.0?
>>
>> On Tue, Jul 25, 2017 at 9:56 AM, Vitaly Buka via llvm-commits
>> <llvm-commits at lists.llvm.org> wrote:
>> > Author: vitalybuka
>> > Date: Tue Jul 25 09:56:22 2017
>> > New Revision: 308984
>> >
>> > URL: http://llvm.org/viewvc/llvm-project?rev=308984&view=rev
>> > Log:
>> > Revert "[compiler-rt] Include thread ID into sanitizers logs"
>> >
>> > This improvement introduce additional dependencies on sandboxed
>> > environments.
>> >
>> > This reverts commit r308637.
>> >
>> > Removed:
>> >     compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/vreport.cc
>> > Modified:
>> >     compiler-rt/trunk/lib/sanitizer_common/sanitizer_printf.cc
>> >
>> > Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_printf.cc
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_printf.cc?rev=308984&r1=308983&r2=308984&view=diff
>> >
>> > ==============================================================================
>> > --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_printf.cc
>> > (original)
>> > +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_printf.cc Tue Jul
>> > 25 09:56:22 2017
>> > @@ -257,15 +257,15 @@ static void NOINLINE SharedPrintfCodeNoB
>> >                        "Buffer in Report is too short!\n"); \
>> >        }
>> >      if (append_pid) {
>> > +      int pid = internal_getpid();
>> >        const char *exe_name = GetProcessName();
>> >        if (common_flags()->log_exe_name && exe_name) {
>> >          needed_length += internal_snprintf(buffer, buffer_size,
>> >                                             "==%s", exe_name);
>> >          CHECK_NEEDED_LENGTH
>> >        }
>> > -      needed_length +=
>> > -          internal_snprintf(buffer + needed_length, buffer_size -
>> > needed_length,
>> > -                            "==%d:%d==", internal_getpid(), GetTid());
>> > +      needed_length += internal_snprintf(
>> > +          buffer + needed_length, buffer_size - needed_length,
>> > "==%d==", pid);
>> >        CHECK_NEEDED_LENGTH
>> >      }
>> >      needed_length += VSNPrintf(buffer + needed_length,
>> > @@ -307,7 +307,7 @@ void Printf(const char *format, ...) {
>> >    va_end(args);
>> >  }
>> >
>> > -// Like Printf, but prints the current PID:TID before the output
>> > string.
>> > +// Like Printf, but prints the current PID before the output string.
>> >  FORMAT(1, 2)
>> >  void Report(const char *format, ...) {
>> >    va_list args;
>> >
>> > Removed:
>> > compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/vreport.cc
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/vreport.cc?rev=308983&view=auto
>> >
>> > ==============================================================================
>> > --- compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/vreport.cc
>> > (original)
>> > +++ compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/vreport.cc
>> > (removed)
>> > @@ -1,23 +0,0 @@
>> > -// RUN: %clangxx -O0 %s -o %t && %env_tool_opts=verbosity=10 %run %t
>> > 2>&1 | FileCheck %s
>> > -
>> > -#include <pthread.h>
>> > -#include <stdio.h>
>> > -#include <sys/syscall.h>
>> > -#include <unistd.h>
>> > -
>> > -void *thread(void *unused) {
>> > -  printf("PID: %d\n", getpid());
>> > -  printf("TID: %ld\n", syscall(SYS_gettid));
>> > -  fflush(stdout);
>> > -  return 0;
>> > -}
>> > -
>> > -int main() {
>> > -  pthread_t t;
>> > -  pthread_create(&t, 0, thread, 0);
>> > -  pthread_join(t, 0);
>> > -  return 0;
>> > -}
>> > -// CHECK: PID: [[PID:[0-9]+]]
>> > -// CHECK: TID: [[TID:[0-9]+]]
>> > -// CHECK: ==[[PID]]:[[TID]]==
>> >
>> >
>> > _______________________________________________
>> > llvm-commits mailing list
>> > llvm-commits at lists.llvm.org
>> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>


More information about the llvm-commits mailing list