title: Instruments won't profile code when a specific library is linked in the C++ binary, OSX
body: <p>I'm having an issue with Instruments. My program requires I link a library and use some of it's functions. However, when trying to use Instruments it quits profiling within 100ms and gives me some garbage output that doesn't represent what's going on when my program runs correctly. I created a small program to see if my instruments version was working. The only issue seems to be when a binary is linked with this particular library (<a href="https://gsjaardema.github.io/seacas/html/index.html" rel="nofollow noreferrer">exodus</a>), Instruments won't profile the code and exits early. I tried linking the small test program against other dylib's, and there was no issue. I even uninstalled an older version of XCode I had and installed the latest one to no avail.</p>
  
  <p>When I build the following simple program without the exodus library, instruments runs it fine. </p>
  
  <pre><code>"main.cpp"
  
  #include &lt;iostream&gt;
  int func() { std::cout &lt;&lt; 1; }
  
  int main()
  {
      while(true) { func(); }
  }
  </code></pre>
  
  <p><code>clang++ -g main.cpp -o main</code></p>
  
  <p>Instruments output looks like this:
  <a href="https://i.stack.imgur.com/p4Jvv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p4Jvv.png" alt="enter image description here"></a></p>
  
  <p>Now if I built the test program like this: </p>
  
  <p><code>clang++ -g main.cpp -o main -L/opt/local/lib/ -lexodus</code></p>
  
  <p>Instruments only runs for 1ms, despite the program being the exact same.
  <a href="https://i.stack.imgur.com/CATXf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CATXf.png" alt="enter image description here"></a></p>
  
  <p>What might the issue be here? Any ideas on circumventing it? Any other information I can provide that might be useful? I don't need any profiling information regarding exodus, I just need to see what my own code is doing.</p>
  
  <p>Thanks for any help</p>