]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix bz#343523, OS X mach_ports_register: UNKNOWN task message [id 3403, to mach_task_...
authorRhys Kidd <rhyskidd@gmail.com>
Sun, 22 Feb 2015 00:42:52 +0000 (00:42 +0000)
committerRhys Kidd <rhyskidd@gmail.com>
Sun, 22 Feb 2015 00:42:52 +0000 (00:42 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14952

NEWS
coregrind/m_syswrap/priv_syswrap-darwin.h
coregrind/m_syswrap/syswrap-darwin.c

diff --git a/NEWS b/NEWS
index afcfb81fea02ccf35fefce6c9282e2923bd8a9fe..14784fcbcae7d13fb4c3e2dd6e6e6f9344992b1b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -92,6 +92,8 @@ where XXXXXX is the bug number as listed below.
 343306  OS X 10.10: UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option
 343332  Unhandled instruction 0x9E310021 (fcvtmu) on aarch64
 343335  unhandled instruction 0x1E638400 (fccmp) aarch64
+343523  OS X mach_ports_register: UNKNOWN task message [id 3403, to 
+        mach_task_self(), reply 0x30f]
 343732  Unhandled syscall 144 (setgid) on aarch64
 343733  Unhandled syscall 187 (msgctl and related) on aarch64
 343802  s390x: Fix false positives "conditional jump or move depends on
index 1a40633ea5a960ab01d2f5ec4b5574aa48ce9164..9351b81b7578dd590b1122cedc24d320b7d2c4eb 100644 (file)
@@ -593,6 +593,7 @@ DECL_TEMPLATE(darwin, task_get_exception_ports);
 DECL_TEMPLATE(darwin, semaphore_create);
 DECL_TEMPLATE(darwin, semaphore_destroy);
 DECL_TEMPLATE(darwin, task_policy_set);
+DECL_TEMPLATE(darwin, mach_ports_register);
 DECL_TEMPLATE(darwin, mach_ports_lookup);
 DECL_TEMPLATE(darwin, task_threads);
 DECL_TEMPLATE(darwin, task_suspend);
index 4da31a65236e45f495c064486e2298d30719ad71..cd4043aa5f5c5d55cbfe3452a4e9172ad74012a8 100644 (file)
@@ -5781,6 +5781,46 @@ POST(task_policy_set)
    }
 }
 
+
+PRE(mach_ports_register)
+{
+#pragma pack(4)
+    typedef struct {
+       mach_msg_header_t Head;
+       /* start of the kernel processed data */
+       mach_msg_body_t msgh_body;
+       mach_msg_ool_ports_descriptor_t init_port_set;
+       /* end of the kernel processed data */
+       NDR_record_t NDR;
+       mach_msg_type_number_t init_port_setCnt;
+    } Request;
+#pragma pack()
+    
+    // Request *req = (Request *)ARG1;
+    
+    PRINT("mach_ports_register(%s)", name_for_port(MACH_REMOTE));
+    
+    AFTER = POST_FN(mach_ports_register);
+}
+
+POST(mach_ports_register)
+{
+#pragma pack(4)
+    typedef struct {
+       mach_msg_header_t Head;
+       NDR_record_t NDR;
+       kern_return_t RetCode;
+    } Reply;
+#pragma pack()
+    
+    Reply *reply = (Reply *)ARG1;
+    if (!reply->RetCode) {
+    } else {
+        PRINT("mig return %d", reply->RetCode);
+    }
+}
+
+
 PRE(mach_ports_lookup)
 {
 #pragma pack(4)
@@ -7696,6 +7736,9 @@ PRE(mach_msg_task)
    case 3402:
       CALL_PRE(task_threads);
       return;
+   case 3403:
+      CALL_PRE(mach_ports_register);
+      return;
    case 3404:
       CALL_PRE(mach_ports_lookup);
       return;