From: Rhys Kidd Date: Sat, 13 Jun 2015 22:59:47 +0000 (+0000) Subject: Fix UNKNOWN task message [id 3410, to mach_task_self(), reply 0x........] (task_set_s... X-Git-Tag: svn/VALGRIND_3_11_0~294 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=700aa31d8dea8b2ed78c70487e121d03344387d2;p=thirdparty%2Fvalgrind.git Fix UNKNOWN task message [id 3410, to mach_task_self(), reply 0x........] (task_set_special_port) bz#349087 On OS X 10.10 Before: == 592 tests, 222 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures == After: == 592 tests, 222 stderr failures, 14 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures == git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15339 --- diff --git a/NEWS b/NEWS index 40089f93ac..f9ae0ba8fc 100644 --- a/NEWS +++ b/NEWS @@ -239,6 +239,8 @@ where XXXXXX is the bug number as listed below. 348949 Bogus "ERROR: --ignore-ranges: suspiciously large range" 349086 Fix UNKNOWN task message [id 3406, to mach_task_self(), reply 0x........] (task_set_info) +349087 Fix UNKNOWN task message [id 3410, to mach_task_self(), + reply 0x........] (task_set_special_port) n-i-bz Provide implementations of certain compiler builtins to support compilers who may not provide those n-i-bz Old STABS code is still being compiled, but never used. Remove it. diff --git a/coregrind/m_syswrap/priv_syswrap-darwin.h b/coregrind/m_syswrap/priv_syswrap-darwin.h index 051d0f55a4..7295cf45ea 100644 --- a/coregrind/m_syswrap/priv_syswrap-darwin.h +++ b/coregrind/m_syswrap/priv_syswrap-darwin.h @@ -591,6 +591,7 @@ DECL_TEMPLATE(darwin, mach_port_get_attributes); DECL_TEMPLATE(darwin, mach_port_set_attributes); DECL_TEMPLATE(darwin, mach_port_insert_member); DECL_TEMPLATE(darwin, task_get_special_port); +DECL_TEMPLATE(darwin, task_set_special_port); DECL_TEMPLATE(darwin, task_get_exception_ports); DECL_TEMPLATE(darwin, semaphore_create); DECL_TEMPLATE(darwin, semaphore_destroy); diff --git a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c index 2953d0c982..9eba933126 100644 --- a/coregrind/m_syswrap/syswrap-darwin.c +++ b/coregrind/m_syswrap/syswrap-darwin.c @@ -5851,6 +5851,48 @@ POST(task_get_special_port) } +PRE(task_set_special_port) +{ +#pragma pack(4) + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t special_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + int which_port; + } Request; +#pragma pack() + + Request *req = (Request *)ARG1; + + PRINT("got port %#x ", req->special_port.name); + + // MACH_ARG(task_set_special_port.which_port) = req->which_port; + PRINT("%s", name_for_port(req->special_port.name)); + + AFTER = POST_FN(task_set_special_port); +} + +POST(task_set_special_port) +{ +#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(semaphore_create) { #pragma pack(4) @@ -8032,10 +8074,12 @@ PRE(mach_msg_task) case 3408: CALL_PRE(task_resume); return; - case 3409: CALL_PRE(task_get_special_port); return; + case 3410: + CALL_PRE(task_set_special_port); + return; case 3411: CALL_PRE(thread_create); return;