I'm perplexed by this one and not sure what's relevant so will include all context:
- MacBook Pro with an M1 Pro running macOS 12.6.
- Apple clang version 14.0.0, freshly installed by deleting
DeveloperToolsfolder and runningxcode-select --install. - Using
zshin Terminal. - Network share mounted using no-configuration Finder method (seems to use standard SMB, but authenticates with my Apple ID)
- Network share is my home directory on a iMac with a Core i5 running macOS 11.6.8.
- Update: also tried root directory and using the
tmpdirectory, to eliminate one category of doubt. Same result.
- Update: also tried root directory and using the
The minimum repeatable example of the issue I've managed to find is:
- Use
gccfrom Apple's Developer Tools to compile a “Hello World” C application (originally discovered usingghcto compile Haskell - effect is the same). - Run the compiled executable. No surprises.
cdto the mounted network drive.- Do the same thing there - compiled executable hangs! First surprise, but relatively minor.
- Return to the local machine. Original compiled executable still runs fine.
- Use the DeveloperTools to compile anything, including the original source - compiled executable on local machine now hangs!
I've created an asciinema recording of the MRE. You can see the key part of the transcript in this still:
I’ve tried killing processes, checking lsof, unmounting the drive, logging in and out, checking the PATH, etc. Nothing gets me back to a working state short of a reboot.
Some more troubleshooting data:
gcc -vis identical for both executables, except for-fdebug-compilation-dir(set to cwd) and the name of the object file (randomly generated).- Just performing the compilation doesn't trigger the issue - running the networked executable does.
- Trawling through the voluminous Console log reveals nothing relevant.
system.logshows no entries around the time of the issue.lsofandps -axwwshow reams and reams of output that is hard to spot patterns in, but I'm pretty sure there is no significant before/after differences.- I left the hung process running on the local machine overnight, and there's no change the next day.
Have I triggered some sandboxing or security fault and am being protected from disastrous consequences? Or this some clang/llvm related quirk I'm not familiar with? Or, given that ghc using its native code generator seems to have the same result, is this a bug in the way stdout is provided to executables? I'm at a loss!
