[PATCH] D49694: [sanitizer] Transition from _zx_vmar_... to _zx_vmar_..._old calls

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 23 19:34:45 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT337802: [sanitizer][fuzzer] Temporarily transition to ZX_TIME_INFINITE_OLD (authored by phosek, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D49694?vs=156869&id=156962#toc

Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D49694

Files:
  lib/fuzzer/FuzzerUtilFuchsia.cpp
  lib/sanitizer_common/sanitizer_fuchsia.cc


Index: lib/fuzzer/FuzzerUtilFuchsia.cpp
===================================================================
--- lib/fuzzer/FuzzerUtilFuchsia.cpp
+++ lib/fuzzer/FuzzerUtilFuchsia.cpp
@@ -49,6 +49,9 @@
 
 namespace {
 
+// TODO(phosek): remove this and replace it with ZX_TIME_INFINITE
+#define ZX_TIME_INFINITE_OLD INT64_MAX
+
 // A magic value for the Zircon exception port, chosen to spell 'FUZZING'
 // when interpreted as a byte sequence on little-endian platforms.
 const uint64_t kFuzzingCrash = 0x474e495a5a5546;
@@ -234,7 +237,7 @@
             "_zx_object_signal");
 
   zx_port_packet_t Packet;
-  ExitOnErr(_zx_port_wait(Port.Handle, ZX_TIME_INFINITE, &Packet),
+  ExitOnErr(_zx_port_wait(Port.Handle, ZX_TIME_INFINITE_OLD, &Packet),
             "_zx_port_wait");
 
   // At this point, we want to get the state of the crashing thread, but
@@ -312,8 +315,8 @@
   ExitOnErr(_zx_event_create(0, &Event), "_zx_event_create");
 
   std::thread T(CrashHandler, &Event);
-  zx_status_t Status =
-      _zx_object_wait_one(Event, ZX_USER_SIGNAL_0, ZX_TIME_INFINITE, nullptr);
+  zx_status_t Status = _zx_object_wait_one(Event, ZX_USER_SIGNAL_0,
+                                           ZX_TIME_INFINITE_OLD, nullptr);
   _zx_handle_close(Event);
   ExitOnErr(Status, "_zx_object_wait_one");
 
@@ -437,7 +440,7 @@
 
   // Now join the process and return the exit status.
   if ((rc = _zx_object_wait_one(ProcessHandle, ZX_PROCESS_TERMINATED,
-                                ZX_TIME_INFINITE, nullptr)) != ZX_OK) {
+                                ZX_TIME_INFINITE_OLD, nullptr)) != ZX_OK) {
     Printf("libFuzzer: failed to join '%s': %s\n", Argv[0],
            _zx_status_get_string(rc));
     return rc;
Index: lib/sanitizer_common/sanitizer_fuchsia.cc
===================================================================
--- lib/sanitizer_common/sanitizer_fuchsia.cc
+++ lib/sanitizer_common/sanitizer_fuchsia.cc
@@ -29,6 +29,9 @@
 
 namespace __sanitizer {
 
+// TODO(phosek): remove this and replace it with ZX_TIME_INFINITE
+#define ZX_TIME_INFINITE_OLD INT64_MAX
+
 void NORETURN internal__exit(int exitcode) { _zx_process_exit(exitcode); }
 
 uptr internal_sched_yield() {
@@ -120,7 +123,7 @@
     return;
   while (atomic_exchange(m, MtxSleeping, memory_order_acquire) != MtxUnlocked) {
     zx_status_t status = _zx_futex_wait(reinterpret_cast<zx_futex_t *>(m),
-                                        MtxSleeping, ZX_TIME_INFINITE);
+                                        MtxSleeping, ZX_TIME_INFINITE_OLD);
     if (status != ZX_ERR_BAD_STATE)  // Normal race.
       CHECK_EQ(status, ZX_OK);
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49694.156962.patch
Type: text/x-patch
Size: 2621 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180724/254b48af/attachment.bin>


More information about the llvm-commits mailing list