Issue 85 in memory-sanitizer: Add MacOs support

38 views
Skip to first unread message

memory-s...@googlecode.com

unread,
Feb 9, 2015, 11:53:13 AM2/9/15
to memory-s...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 85 by gonzalob...@gmail.com: Add MacOs support
https://code.google.com/p/memory-sanitizer/issues/detail?id=85

Add support for taget: 'x86_64-apple-darwin14.1.0'




--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

memory-s...@googlecode.com

unread,
Feb 23, 2015, 8:53:17 PM2/23/15
to memory-s...@googlegroups.com
Updates:
Status: WontFix

Comment #1 on issue 85 by konstant...@gmail.com: Add MacOs support
https://code.google.com/p/memory-sanitizer/issues/detail?id=85

We are not planing any work here.
MSan is usable only if *all* the code is instrumented.
On Mac this is impossible except for really tiny programs.

I am closing this bug because it is not actionable, not because we don't
want this to happen. If you know how to proceed and are ready to help --
please reopen.

memory-s...@googlecode.com

unread,
Feb 24, 2015, 9:30:55 AM2/24/15
to memory-s...@googlegroups.com

Comment #2 on issue 85 by gonzalob...@gmail.com: Add MacOs support
https://code.google.com/p/memory-sanitizer/issues/detail?id=85

How is this not the case under Linux?
Don't you have to recompile all the code above libc with msan?
That is as easy to do under linux as it is under MacOS.

memory-s...@googlecode.com

unread,
Feb 24, 2015, 9:34:07 AM2/24/15
to memory-s...@googlegroups.com

Comment #3 on issue 85 by euge...@google.com: Add MacOs support
https://code.google.com/p/memory-sanitizer/issues/detail?id=85

I've heard that MacOS has a number of proprietary "frameworks" that must be
used by any GUI application.

memory-s...@googlecode.com

unread,
Feb 24, 2015, 10:47:19 AM2/24/15
to memory-s...@googlegroups.com

Comment #4 on issue 85 by gonzalob...@gmail.com: Add MacOs support
https://code.google.com/p/memory-sanitizer/issues/detail?id=85

be used by any GUI application.

Might be, but nor did I ask support for MacOS GUI frameworks, nor this
would be the right place to ask for that.

I asked for support for the 'x86_64-apple-darwin14.1.0' target.

The documentation says that the memory sanitizer provides libc wrappers.
However, using clang tip-of-trunk under MacOS with -fsanitize=memroy fails
to compile the following C++ program:

int main() { return 0; }

The error is just: target 'x86_64-apple-darwin14.1.0' is not supported.

I would like to be able to compile:

#include <stdio.h>
int main() { puts("Hello World!"); }

Since that would mean the libc wrapper works, and that I can compile
non-trivial non-tiny applications like llvm/clang from source using the
memory sanitizer.

memory-s...@googlecode.com

unread,
Feb 25, 2015, 4:39:36 AM2/25/15
to memory-s...@googlegroups.com

Comment #5 on issue 85 by euge...@google.com: Add MacOs support
https://code.google.com/p/memory-sanitizer/issues/detail?id=85

Right, of course. LLVM/Clang is doable on Mac.
Still, that's a non-trivial amount of work that we don't have free cycles
for.
It would require, at a minimum:
(1) figuring out shadow/origin mapping compatible with MacOS process memory
layout
(2) tweaking the runtime library for libc differencies

Patches are welcome.

memory-s...@googlecode.com

unread,
Feb 25, 2015, 4:53:32 AM2/25/15
to memory-s...@googlegroups.com

Comment #6 on issue 85 by gonzalob...@gmail.com: Add MacOs support
https://code.google.com/p/memory-sanitizer/issues/detail?id=85

Thanks, for the TODO list.

I cannot contribute patches but it would be helpful if the issue would stay
open in case someone wants to contribute to the memory sanitizer. I think a
lot of people could benefit from this.

Maybe one could get apple interested (e.g. Chris Lattner?) in the next
meetups.

memory-s...@googlecode.com

unread,
Feb 25, 2015, 4:56:13 AM2/25/15
to memory-s...@googlegroups.com
Updates:
Status: Accepted
Labels: -Priority-Medium Priority-Low

Comment #7 on issue 85 by euge...@google.com: Add MacOs support
https://code.google.com/p/memory-sanitizer/issues/detail?id=85

(No comment was entered for this change.)

memory-s...@googlecode.com

unread,
Feb 25, 2015, 5:04:54 PM2/25/15
to memory-s...@googlegroups.com

Comment #8 on issue 85 by konstant...@gmail.com: Add MacOs support
https://code.google.com/p/memory-sanitizer/issues/detail?id=85

As Eugeniy said, enabling msan for Mac only for 'hello world' apps will not
solve any problem for us, but will require non-trivial effort.

I don't mind keeping this bug open, but we really need support from Apple
here.
Would you like to file a bug against Apple to request msan support?

memory-s...@googlecode.com

unread,
Feb 25, 2015, 6:07:31 PM2/25/15
to memory-s...@googlegroups.com

Comment #9 on issue 85 by gonzalob...@gmail.com: Add MacOs support
https://code.google.com/p/memory-sanitizer/issues/detail?id=85

not
solve any problem for us, but will require non-trivial effort.

Sorry to hear that. I think that for any graphical application, even if you
use XQuartz as an X replacement directly, you will have to, at some point,
interface with Apple's libraries. So without wrappers provided by Apple
that won't work. There is still, however, a lot of useful complex software
(without GUI) that could use `msan` on MacOS.

Yes I can do that.
Reply all
Reply to author
Forward
0 new messages