DTrace freezes M1 MacOS Ventura 13.5

Hello,

I'm trying to use dtrace to instrument my applications with no success.

The system freezes on the exact moment I'm starting the command from terminal. The only way out is hard shut down via long pressing the power button.

Are there any solutions for this?

Answered by Developer Tools Engineer in 762622022

You might be hitting an issue where some hardware memory protection gets incorrectly reenabled for a SIP-disabled system upon wake from sleep, which then causes the DTrace freeze you are seeing.

I'm assuming you already have SIP disabled on your machine (if not that would be the first step). However, in some cases when the machine goes to sleep and wakes up some memory protection that was disabled as part of disabling SIP may get reenabled. This prevents DTrace from writing to a memory region it needs and causes it to freeze. A reboot will reset the permission and protection settings correctly.

So as a workaround until this is fixed, you can try to prevent your machine from going to sleep after a reboot or reboot before you want to use DTrace. We are investigating the issue. If you would like to be notified when this is fixed, feel free to file a feedback and post it here. We can then link it to the internal issue.

If you are seeing this behavior with SIP disabled after a fresh reboot (without the machine going to sleep in-between), please let us know.

Hey there Permissions & SIP: If you're on a newer macOS version, the System Integrity Protection (SIP) can interfere with dtrace. While I don't recommend it for long-term use, you might want to try disabling SIP temporarily to see if it makes a difference. Boot into Recovery Mode (by holding Command + R during startup) > Utilities > Terminal, then enter csrutil disable.

Hope this helps, you get to the bottom of this issue soon.

Ahmad.

Same issue here - with SIP disabled.

Accepted Answer

You might be hitting an issue where some hardware memory protection gets incorrectly reenabled for a SIP-disabled system upon wake from sleep, which then causes the DTrace freeze you are seeing.

I'm assuming you already have SIP disabled on your machine (if not that would be the first step). However, in some cases when the machine goes to sleep and wakes up some memory protection that was disabled as part of disabling SIP may get reenabled. This prevents DTrace from writing to a memory region it needs and causes it to freeze. A reboot will reset the permission and protection settings correctly.

So as a workaround until this is fixed, you can try to prevent your machine from going to sleep after a reboot or reboot before you want to use DTrace. We are investigating the issue. If you would like to be notified when this is fixed, feel free to file a feedback and post it here. We can then link it to the internal issue.

If you are seeing this behavior with SIP disabled after a fresh reboot (without the machine going to sleep in-between), please let us know.

I have this too. This completely locks up my system. No wake or sleep involved. Restart, try to use dtrace (via dtruss) and boom freeze everything but the UI.

It seems I've picked the wrong time to get interested in dtrace. I'm facing the same issue with SIP disabled on my M2 Air. I first thought it was a performance issue with the M2 being slow, but turns out this is an active bug Apple is looking into. Here's to hoping this gets fixed soon!

I submitted a similar feedback question earlier (FB12579591). The problem persists when the resolution status changes to "Confirm potential fixes - in macOS14.1" and the system is upgraded to macOS14.1(and later). Hopefully the problem will be fixed soon.

DTrace freezes M1 MacOS Ventura 13.5
 
 
Q