Sha*_*mog 9 unix macos coredump signals
一段时间以来,我一直在努力反对这一点。显然读过这个:Where are core dumps write on Mac?
这样我们就100%清楚了:
我做了:
touch /cores/x
rm /cores/x
Run Code Online (Sandbox Code Playgroud)
所以写权限是好的。
做过
ulimit -c unlimited
Run Code Online (Sandbox Code Playgroud)
所以应该生成核心。
但即使是微不足道的:
sleep 100 & killall -SIGSEGV sleep
Run Code Online (Sandbox Code Playgroud)
不生成核心。我目前的赌注是操作系统的文件系统保护功能之一让我感到悲伤。另一种可能性是这与 ARM(在 M1 Max 上运行)有关。
任何想法都非常受欢迎...我什至尝试过这个但没有成功:(Mac)将核心文件保留在可执行文件所在的位置而不是/cores?
我目前使用的是 Mac OS Monterey。https://developer.apple.com/forums/thread/694233?answerId=695943022#695943022建议的解决方案对我有用。
快速总结:现在有必要为每个可执行文件com.apple.security.get-task-allow启用权利。
示例cat:
先复印一份。必需的,因为cat位于只读文件系统上。
% cp $(which cat) cat-copy
Run Code Online (Sandbox Code Playgroud)
创建一个.entitlements具有com.apple.security.get-task-allow权利集的虚拟对象:
% /usr/libexec/PlistBuddy -c "Add :com.apple.security.get-task-allow bool true" tmp.entitlements
File Doesn't Exist, Will Create: tmp.entitlements
Run Code Online (Sandbox Code Playgroud)
重新签署cat-copy这些权利:
% codesign -s - -f --entitlements tmp.entitlements cat-copy
CrashSelf: replacing existing signature
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1378 次 |
| 最近记录: |