Bug 304259 - support Darwin 12 (Mac OS 10.8, Mountain Lion)
Summary: support Darwin 12 (Mac OS 10.8, Mountain Lion)
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.7.0
Platform: Compiled Sources macOS
: NOR normal
Target Milestone: ---
Assignee: Rhys Kidd
URL:
Keywords:
Depends on: 302630 326797 347151 347379
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-29 22:06 UTC by Francisco Souza
Modified: 2015-07-25 08:10 UTC (History)
12 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 Francisco Souza 2012-07-29 22:06:19 UTC
When trying to compile valgrind on Mac OS X 10.8 (Mountain Lion), I get the following error when configuring:



Reproducible: Always

Steps to Reproduce:
1. Download valgrind 2.7.0 on Mac OS X 10.8
2. Run ./configure
Actual Results:  
checking for a supported OS... ok (darwin)
checking for the kernel version... unsupported (12.0.0)
configure: error: Valgrind works on Darwin 10.x and 11.x (Mac OS X 10.6/7)

Expected Results:  
Valgrind configured to compile.
Comment 1 Julian Seward 2012-08-02 18:27:22 UTC
Some initial support was added in r12814 just now.  This makes it
compile and able to run small programs on OSX 10.8.  Be warned however
that it still asserts with bigger apps, and 32 bit programs are not
checked properly at all (most errors are missed by Memcheck).

Feedback welcomed.  Especially if you have small test cases that cause
it to assert.
Comment 2 Daniel Svensson 2013-05-13 18:09:45 UTC
Any update on Mountain Lion support? I'm running 3.9.0-r13189 and it says it finds leaks in snprintf which seems a bit weird, but it still finds some real leaks so it's not completely useless.
Comment 3 Julian Seward 2013-08-30 13:04:13 UTC
Just to note that

(1) I'm using this as the central "Make V work on OSX 10.8" properly
    bug

(2) I made some progress in the past couple of days and am now able to
    run large graphical applications (Calculator, Textedit, Firefox)
    in 64 bit mode, without crashing.  The fixes are not yet in a
    state where they can be committed, but I hope to get them to that
    point in the next few days.
Comment 4 Daniel Svensson 2013-09-03 18:38:38 UTC
I don't suppose you have a private repo/branch somewhere with your current code to try before it hits valgrind trunk?
Comment 5 Julian Seward 2013-09-04 07:37:32 UTC
I pushed all the fixes I have at the moment in to the trunk (right
now, r13531).  It's somewhat usable for graphical applications --
Memcheck can find possible bugs in Firefox, for example -- but still
very kludged up and not very satisfactory.
Comment 6 Daniel Svensson 2013-09-05 07:04:10 UTC
Excellent, now my GTK application starts, but as soon as the application decides to go apeshit, valgrind gets stuck in an infinite loop:

==22253== Invalid read of size 1
==22253==    at 0x4325F6: gtk_tree_view_column_button_event (in /Users/dsvensson/abraca-target/inst/lib/libgtk-3.0.dylib)
==22253==    by 0x2370DB: _gtk_marshal_BOOLEAN__BOXEDv (in /Users/dsvensson/abraca-target/inst/lib/libgtk-3.0.dylib)
==22253==    by 0xD93603: _g_closure_invoke_va (in /Users/dsvensson/abraca-target/inst/lib/libgobject-2.0.0.dylib)
==22253==    by 0xDB8FFC: g_signal_emit_valist (in /Users/dsvensson/abraca-target/inst/lib/libgobject-2.0.0.dylib)
==22253==    by 0xDBA941: g_signal_emit (in /Users/dsvensson/abraca-target/inst/lib/libgobject-2.0.0.dylib)
==22253==    by 0x44CB9C: gtk_widget_event_internal (in /Users/dsvensson/abraca-target/inst/lib/libgtk-3.0.dylib)
==22253==    by 0x44C283: gtk_widget_event (in /Users/dsvensson/abraca-target/inst/lib/libgtk-3.0.dylib)
==22253==    by 0x46129F: gtk_widget_send_focus_change (in /Users/dsvensson/abraca-target/inst/lib/libgtk-3.0.dylib)
==22253==    by 0x4763EE: do_focus_change (in /Users/dsvensson/abraca-target/inst/lib/libgtk-3.0.dylib)
==22253==    by 0x476C7C: gtk_window_real_set_focus (in /Users/dsvensson/abraca-target/inst/lib/libgtk-3.0.dylib)
==22253==    by 0xD9A282: g_cclosure_marshal_VOID__OBJECTv (in /Users/dsvensson/abraca-target/inst/lib/libgobject-2.0.0.dylib)
==22253==    by 0xD93C19: g_type_class_meta_marshalv (in /Users/dsvensson/abraca-target/inst/lib/libgobject-2.0.0.dylib)
==22253==  Address 0xaaaaaaaaaaaaab5a is not stack'd, malloc'd or (recently) free'd
==22253==
==22253== Signal 11 being dropped from thread 0's queue
==22253== Signal 11 being dropped from thread 0's queue
==22253== Signal 11 being dropped from thread 0's queue
==22253== Signal 11 being dropped from thread 0's queue

Last message will print forever.
Comment 7 Julian Seward 2013-09-05 07:20:08 UTC
Try running with --smc-check=all.  MacOS now generates so much code
at runtime that not using it is really asking for trouble.

That said, I know it is still seriously borked and needs perhaps another
week's worth of work.
Comment 8 Julian Seward 2013-09-05 07:21:24 UTC
Try running with --smc-check=all.  MacOS now generates so much code
at runtime that not using it is really asking for trouble.

That said, I know it is still seriously borked and needs perhaps another
week's worth of work.
Comment 9 Daniel Svensson 2013-10-17 17:38:52 UTC
Any updates on this? Just built today and here's the output of a run with an empty main(): http://d456c2b06144a9cf.paste.se/
Comment 10 Daniel Svensson 2013-10-17 17:44:46 UTC
Right.. missing in the above output is the following:

$ file test
test: Mach-O 64-bit x86_64 executable

So it is indeed a 64bit binary. Just noticed the 32bit warning in the beginning of the execution and wanted to make it clear that this is not a problem in this case.
Comment 11 Per Mildner 2013-10-18 08:47:14 UTC
Should support for OS X 10.9 be a separate ticket? The GM version is available from developer.apple.com now.
Comment 12 Benson Margulies 2013-10-23 22:03:38 UTC
I just pulled the trunk from svn onto Mavericks and configure says:

checking for the kernel version... unsupported (13.0.0)
configure: error: Valgrind works on Darwin 10.x and 11.x (Mac OS X 10.6/7)

Is there a way to override the check and try?
Comment 13 Daniel Svensson 2013-11-10 19:05:19 UTC
Benson: Just tried overriding and removing some deprecated fcntl flags which got it to compile. When running a test application a call (used by the OS) to fcntl with F_ADDFILESIGS as argument causes valgrind to bail. sys/fcntl.h seems to indicate that it's similar to F_ADDSIGS, but naively treating them the same way does not work. Guess there's something new with application signatures in Maverick. New development needed rather than just overriding a version check. Worth noting is that I have basically no idea what I'm doing so take what I say with a big grain of salt.
Comment 14 Mark Browning 2014-09-11 22:27:23 UTC
r13523 added a fix for darwin-amd64. The same fix is needed for darwin-x86.
Comment 15 Rhys Kidd 2015-06-12 12:15:21 UTC
Hi Mark,
That fix was cross-ported for darwin-x86 in r14888.
Comment 16 Rhys Kidd 2015-06-28 04:58:25 UTC
Looking through the comments here, are there any OS X 10.8 Mountain Lion *specific* issues any more?

I know there remain a number of OS X platform issues, but I'm kind of inclined to close this bug report now that Valgrind can be built and run on the OS X 10.8 platform without issues.

To be clear: this is not me saying that we are abandoning support for OS X 10.8 and earlier. I will continue to:
1. Address the regression test failures, with issues being tracked in separate bug reports; and
2. When the above are resolved that will apply across many OS X releases.

Thoughts? Please shout out if there are an pressing 10.8 specific bugs.
Comment 17 Rhys Kidd 2015-07-25 08:10:22 UTC
I'm going to mark this as completed. Based on the regression test suite there are no further OS X 10.8 specific bug reports.