/Library/Developer/CommandLineTools/usr/bin/make stopped working with latest OSX update

I updated to the latest OSX 13.5.1 (22G90) and the make command stopped working. It just hangs.

Any help would be appreciated.

Here is the sample result:

Analysis of sampling make (pid 86819) every 1 millisecond
Process: make [86819]
Path: /Library/Developer/CommandLineTools/usr/bin/make
Load Address: 0x1032ae000
Identifier: make
Version: 135
Code Type: X86-64
Platform: macOS
Parent Process: zsh [2964]
Date/Time: 2023-08-28 14:56:59.715 -0400
Launch Time: 2023-08-28 14:56:22.791 -0400
OS Version: macOS 13.5.1 (22G90)
Report Version: 7
Analysis Tool: /usr/bin/sample
Physical footprint: 768K
Physical footprint (peak): 768K
Idle exit: untracked
----
Call graph:
2596 Thread_24457592 DispatchQueue_1: com.apple.main-thread (serial)
2596 start (in dyld) + 1903 [0x7ff813c6f41f]
2596 ??? (in make) load address 0x1032ae000 + 0x12582 [0x1032c0582]
2596 ??? (in make) load address 0x1032ae000 + 0x1518b [0x1032c318b]
2596 ??? (in make) load address 0x1032ae000 + 0x15478 [0x1032c3478]
2596 ??? (in make) load address 0x1032ae000 + 0x15ce7 [0x1032c3ce7]
2596 ??? (in make) load address 0x1032ae000 + 0x1da2f [0x1032cba2f]
2596 ??? (in make) load address 0x1032ae000 + 0x1cbe2 [0x1032cabe2]
2596 ??? (in make) load address 0x1032ae000 + 0x8699 [0x1032b6699]
2596 ??? (in make) load address 0x1032ae000 + 0x87d1 [0x1032b67d1]
2596 ??? (in make) load address 0x1032ae000 + 0xad68 [0x1032b8d68]
2596 ??? (in make) load address 0x1032ae000 + 0xbe8c [0x1032b9e8c]
2596 read (in libsystem_kernel.dylib) + 10 [0x7ff813f8afee]
Total number in stack (recursive counted multiple, when >=5):
Sort by top of stack, same collapsed (when >= 5):
read (in libsystem_kernel.dylib) 2596
Answered by pan_and_scan in 763111022

Hardware information: 15-inch 2018

Processor: 2.2 GHz 6-Core Intel Core i7 Graphics: Radeon Pro 555X 4 GB Intel UHD Graphics 630 1536 MB Memory: 32 GB 2400 MHz DDR4

Accepted Answer

Hardware information: 15-inch 2018

Processor: 2.2 GHz 6-Core Intel Core i7 Graphics: Radeon Pro 555X 4 GB Intel UHD Graphics 630 1536 MB Memory: 32 GB 2400 MHz DDR4

                            2596 read  (in libsystem_kernel.dylib) + 10  [0x7ff813f8afee]

This suggests it’s hung trying to read from a file descriptor. Does this reproduce with a trivial makefile? For example:

% ls -l
total 8
-rw-r--r--@ 1 quinn staff 27 29 Aug 09:39 Makefile
% cat Makefile
test.txt:
date > test.txt
% make
date > test.txt
% ls -l
total 16
-rw-r--r--@ 1 quinn staff 27 29 Aug 09:39 Makefile
-rw-r--r-- 1 quinn staff 29 29 Aug 09:40 test.txt

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

The example above appears to work fine. It could be related to the specific file descriptor as you mentioned above.

Additional information:

  • It works correctly for some period of time after reboot.
  • Once it gets in to this situation, the only way to clear it is to reboot.
  • Appears to also occur with Homebrew gmake.
  • I'm also see an issue where a service I have created to write output to a file on a regular interval also timeout.

Here is the service definition and the script to reproduce:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.stonehengelabs.pan_and_scan.update_status</string>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin</string>
</dict>
<key>Program</key>
<string>/Users/pan_and_scan/bin/update_status.sh</string>
<key>StartInterval</key>
<integer>1</integer>
</dict>
</plist>
#!/bin/sh
# --------------------------------------------------
# Docker Machine Configuration
# --------------------------------------------------
function docker_status() {
# --------------------------------------------------
# Minikube Configuration
# --------------------------------------------------
local DOCKER_SOURCE=`kubectl config get-contexts --no-headers=true | grep '^*'| awk '{print $2}'`
# --------------------------------------------------
# Print running docker processes
# --------------------------------------------------
echo "===========================================================" > ~/.data/docker_status.md
echo "Docker Status - ${DOCKER_SOURCE} - $(date)" >> ~/.data/docker_status.md
echo "===========================================================" >> ~/.data/docker_status.md
/Applications/Docker.app/Contents/Resources/bin/docker stack services atlantis 2>&1 >> ~/.data/docker_status.md
}
# cat ~/.data/docker_status.md
##################################################
# Export Status
##################################################
docker_status

OK, so make is working fine, but this specific make job is causing the failure.

As a next step I recommend that you try to track down what sort of file descriptor is causing the problem. If you run lsof against make when it’s hung this way, that might offer a clue.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Here is the output:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
make 29609 pan_and_scan cwd DIR 1,4 1280 137640208 /Users/pan_and_scan/repos/me/myrepo
make 29609 pan_and_scan txt REG 1,4 436000 394462061 /Applications/Xcode.app/Contents/Developer/usr/bin/make
make 29609 pan_and_scan 0u CHR 16,4 0t475564 1241 /dev/ttys004
make 29609 pan_and_scan 1u CHR 16,4 0t475564 1241 /dev/ttys004
make 29609 pan_and_scan 2u CHR 16,4 0t475564 1241 /dev/ttys004
make 29609 pan_and_scan 3r REG 1,4 8265 445364825 /Users/pan_and_scan/repos/me/myrepo/Makefile
make 29609 pan_and_scan 4 PIPE 0x679b693239084285 16384 ->0x113baff81831caff

Another note: It looks like both the script failure above and the make failures occur at the same time although not sure how they would be connected.

That shows that make has 5 file descriptors open:

  • 0 through 2 are stdin, stdout, and stderr.

  • 3 is the Makefile itself.

  • 4 is a pipe.

Of these, the obvious candidate for causing problems is 4. Note the ->0x113baff81831caff marker. If you do a full lsof and search for 0x113baff81831caff, that should show you the other end of the pipe.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Interesting. Looks like there is a shell entry in the Makefile and Docker Desktop is hung. Restarting docker engine frees the pipe. Mystery solved.

❯ lsof -c make
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
make 99480 pan_and_scan cwd DIR 1,4 1312 137640208 /Users/pan_and_scan/repos/dlr/mercury
make 99480 pan_and_scan txt REG 1,4 436000 394462061 /Applications/Xcode.app/Contents/Developer/usr/bin/make
make 99480 pan_and_scan 0u CHR 16,4 0t1117558 1467 /dev/ttys004
make 99480 pan_and_scan 1 PIPE 0xe7c678c3a315df77 16384 ->0x38f87768519d5616
make 99480 pan_and_scan 2u CHR 16,4 0t1117558 1467 /dev/ttys004
make 99480 pan_and_scan 3r REG 1,4 8265 445364825 /Users/pan_and_scan/repos/dlr/mercury/Makefile
make 99480 pan_and_scan 4 PIPE 0x478605bcbc5309bf 16384 ->0x53f5a15df6bf83c7
❯ lsof | rg 0x478605bcbc5309bf
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
make 99480 pan_and_scan 4 PIPE 0x478605bcbc5309bf 16384 ->0x53f5a15df6bf83c7
docker 99487 pan_and_scan 1 PIPE 0x53f5a15df6bf83c7 16384 ->0x478605bcbc5309bf
docker 99487 pan_and_scan 4 PIPE 0x478605bcbc5309bf 16384 ->0x53f5a15df6bf83c7
com.docke 99488 pan_and_scan 1 PIPE 0x53f5a15df6bf83c7 16384 ->0x478605bcbc5309bf
com.docke 99488 pan_and_scan 4 PIPE 0x478605bcbc5309bf 16384 ->0x53f5a15df6bf83c7
❯ lsof | rg 0xe7c678c3a315df77
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Python 99479 pan_and_scan 3 PIPE 0x38f87768519d5616 16384 ->0xe7c678c3a315df77
Python 99479 pan_and_scan 5 PIPE 0xe7c678c3a315df77 16384 ->0x38f87768519d5616
make 99480 pan_and_scan 1 PIPE 0xe7c678c3a315df77 16384 ->0x38f87768519d5616
Python 99481 pan_and_scan 0 PIPE 0x38f87768519d5616 16384 ->0xe7c678c3a315df77
/Library/Developer/CommandLineTools/usr/bin/make stopped working with latest OSX update
 
 
Q