Bug 343306 - OS X 10.10: UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option
Summary: OS X 10.10: UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option
Status: CONFIRMED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.10 SVN
Platform: macOS (DMG) macOS
: NOR normal
Target Milestone: ---
Assignee: Rhys Kidd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-26 06:40 UTC by Rhys Kidd
Modified: 2015-11-30 17:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rhys Kidd 2015-01-26 06:40:15 UTC
Significant number (>200) of the regression tests on OS X 10.10 report failure due to:

UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option

The MACH_SEND_TRAILER option was not seen in OS X 10.9 or prior. It is the number one cause of unhandled or unknown platform elements on OS X 10.10 at present.

The relevant code is within the mach_msg handler of coregrind/syswrap-darwin.c, specifically where (mh->msgh_bits & MACH_SEND_TRAILER) is true.

Reproducible: Always

Steps to Reproduce:
1. Run 'make regtest'

Actual Results:  
Although not entirely due to this error, the 'make regtest' output on OS X 10.10 using r14889:
== 585 tests, 567 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

Expected Results:  
The near-equivalent hardware output of 'make regtest' on OS X 10.9 using r14889:
== 585 tests, 240 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==
Comment 1 Rhys Kidd 2015-01-26 09:05:16 UTC
Partial fix in r14890.

Fix incorrect check for presence of unsupported MACH_SEND_TRAILER in mach_msg. This greatly reduces the occurrences of this warning.

With the fix:
(OS X 10.10) == 585 tests, 271 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==
(OS X 10.9) == 585 tests, 240 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

Regression tests that now trigger this warning:
memcheck/tests/overlap
none/tests/res_search
none/tests/resolv
none/tests/syslog
Comment 2 Rhys Kidd 2015-05-31 03:23:12 UTC
Reproduction via regression tests with:

$ perl tests/vg_regtest memcheck/tests/overlap none/tests/res_search none/tests/resolv none/tests/syslog
overlap:         valgrind   -q ./overlap 
sh: line 1: 10042 Illegal instruction: 4  VALGRIND_LIB=/Users/rhyskidd/Documents/Coding/valgrind/trunk/.in_place VALGRIND_LIB_INNER=/Users/rhyskidd/Documents/Coding/valgrind/trunk/.in_place /Users/rhyskidd/Documents/Coding/valgrind/trunk/./coregrind/valgrind --command-line-only=yes --memcheck:leak-check=no --tool=memcheck -q ./overlap > overlap.stdout.out 2> overlap.stderr.out
*** overlap failed (stdout) ***
*** overlap failed (stderr) ***
res_search:      valgrind   -q ./res_search www.yahoo.com
*** res_search failed (stderr) ***
resolv:          valgrind   ./resolv 
*** resolv failed (stderr) ***
syslog:          valgrind   -q ./syslog 
*** syslog failed (stderr) ***

== 4 tests, 4 stderr failures, 1 stdout failure, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
memcheck/tests/overlap                   (stdout)
memcheck/tests/overlap                   (stderr)
none/tests/res_search                    (stderr)
none/tests/resolv                        (stderr)
none/tests/syslog                        (stderr)
Comment 3 Daniel Trebbien 2015-11-23 18:01:40 UTC
I am not sure if the problem I am seeing is related to this, but simply calling the GLib g_get_user_special_dir() function on a Mac OS 10.11.1 system seemingly causes Valgrind to enter an infinite loop using 100% CPU.

```
#include <glib.h>
#include <stdlib.h>

int main()
{
    g_get_user_special_dir(G_USER_DIRECTORY_DOCUMENTS);
    return EXIT_SUCCESS;
}
```

Compiled with:
cc -g -o get_user_special_dir.bin `pkg-config --cflags glib-2.0` get_user_special_dir.c `pkg-config --libs glib-2.0`

Ran with:
valgrind ./get_user_special_dir.bin

Trimmed output:
```
==4088== Memcheck, a memory error detector
==4088== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==4088== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==4088== Command: ./get_user_special_dir.bin
==4088== 
==4088== Conditional jump or move depends on uninitialised value(s)
==4088==    at 0x7FFF5FC24A27: bcmp (in /usr/lib/dyld)
...
==4088== 
==4088== Use of uninitialised value of size 8
==4088==    at 0x7FFF5FC24A3F: bcmp (in /usr/lib/dyld)
...
==4088== 
==4088== Use of uninitialised value of size 8
==4088==    at 0x7FFF5FC24A44: bcmp (in /usr/lib/dyld)
...
==4088== 
==4088== Conditional jump or move depends on uninitialised value(s)
==4088==    at 0x7FFF5FC11907: ImageLoaderMachO::validateFirstPages(linkedit_data_command const*, int, unsigned char const*, unsigned long, long long, ImageLoader::LinkContext const&) (in /usr/lib/dyld)
...
==4088== 
--4088-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option
--4088-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 2 times)
--4088-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 4 times)
--4088-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 8 times)
Killed: 9
```

(I had to force-quit valgrind.)

Using:
- GLib 2.46.2  (installed via Homebrew 'el_capitan' bottle)
- Valgrind 3.11.0  (also installed via Homebrew 'el_capitan' bottle)
Comment 4 Rhys Kidd 2015-11-30 10:55:56 UTC
Daniel,
That does sound like a separate bug report. Can you please create a new bug report with the details you've provided here.
Comment 5 Daniel Trebbien 2015-11-30 17:47:40 UTC
(In reply to Rhys Kidd from comment #4)
> Daniel,
> That does sound like a separate bug report. Can you please create a new bug
> report with the details you've provided here.

Sure, I have created Bug 356122.