Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8756891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:10:39+00:00 2026-06-13T14:10:39+00:00

The title says it most, really. On Linux it would be easy with strace

  • 0

The title says it most, really. On Linux it would be easy with strace and possibly lsof or /proc, and it used to be easy on OSX until truss was removed from OSX Leopard, along with underlying system calls (afaik).

The obvious approach is to tackle this problem with dtrace, but alas as far as I understand dtrace won’t do because it catches events as they happen – and in my case, the blocking system call has already started. I’d love to stand corrected if this can be solved with dtrace, by the way.

I saw Xcode’s Instruments has a monitor which achieves something similar by taking periodic samples of a process’ stack (not sure what system calls it relies on to do that!), maybe something similar on the command line could be good enough (as it would display the stack all the way to the library call that wraps the system call). To be useful for my usecase, this “sampling commandline tool” would have to find and parse the arguments it finds on the stack to be useful to determine what file/file descriptor are we blocked on.

One last thing – on Linux, you could usually do this as a regular user (assuming no ptrace_scope tricks). It would be great if the OSX solution won’t require root, either.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:10:41+00:00Added an answer on June 13, 2026 at 2:10 pm

    You can use sample: sample PID -e

    E.g. for the nc -l localhost 5999 you’d get a file with call graph:

    Call graph:
        9046 Thread_242504   DispatchQueue_1: com.apple.main-thread  (serial)
          9046 start  (in libdyld.dylib) + 1  [0x7fff90a847e1]
            9046 ???  (in nc)  load address 0x102453000 + 0x166c  [0x10245466c]
              9046 __accept  (in libsystem_kernel.dylib) + 10  [0x7fff94445996]
    

    And other useful information like loaded Binary Images.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think the title says most of my problem. I am new to C
As title says, I have access to the current listitem - and it's easy
so as title says, I would like to hear your advices what are the
The title says most of it, I'm wondering if MySQL is suitable, (and if
So, title says most of it, and I'll give an example: var foo =
As the title says, what's the most efficient way to get a random selection
As the title says.. What is the most efficient way to store a connected
The title says most of what I'm looking for: I have 2 buttons on
just like the title says, what are the most common security features of a
Title says most of it. I have a div container that holds all the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.