My problem on my macOS High Sierra is that recently none of sudo commands are working.
here is a sample,
Majids-MacBook-Pro:etc mjzarrin$ sudo vi x.txt
dyld: lazy symbol binding failed: Symbol not found: __chkstk_darwin
Referenced from: /usr/local/libexec/sudo/sudoers.so
Expected in: flat namespace
dyld: Symbol not found: __chkstk_darwin
Referenced from: /usr/local/libexec/sudo/sudoers.so
Expected in: flat namespace
Abort trap: 6
Please advise.
I'll update the question if any extra information is needed. later I will prone to show only related stuff regarding the solution.
Updates regarding comments:
Majids-MacBook-Pro:local mjzarrin$ sudo
sudo: /etc/sudoers is world writable
sudo: no valid sudoers sources found, quitting
sudo: error initializing audit plugin sudoers_audit
Majids-MacBook-Pro:local mjzarrin$ type sudo
sudo is hashed (/usr/local/bin/sudo)
Majids-MacBook-Pro:local mjzarrin$ /usr/bin/sudo vi x.txt
sudo: setrlimit(8): Invalid argument
sudo: error in /etc/sudo.conf, line 16 while loading plugin "sudoers_audit"
sudo: unable to find symbol "sudoers_audit" in sudoers.so
sudo: fatal error, unable to load plugins
here is what I did till now and it's results.
Unfortunately I don't know when exactly this problem begins. I found it when I tried to install something with Brew. then I was thought it's the Brew corruption. deciding reinstalling it but could not install it again. I installed a new local Brew. Then I found something about sudo is wrong. I didn't recall touching sudoer explicitly before the problem shows up, Then based on some other similar answers I replaced it with it's backup ("/etc/sudoer~orig"). although both files was same in size,lines and content ,I did changing in the command line inside Mac Recovery Mode. then chown and chmod it as expected. finally nothing changes. all errors are the same as before.
I also set read/write permission to everyone(USER) for /etc/sudoer file to check the results.
here are environment variables:
Majids-MacBook-Pro:local mjzarrin$ env
MANPATH=/Users/mjzarrin/.nvm/versions/node/v12.19.0/share/man:/usr/local/share/man:/usr/share/man:/Library/TeX/texbin/man:/Library/Developer/CommandLineTools/usr/share/man
TERM_PROGRAM=Apple_Terminal
NVM_CD_FLAGS=
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/zp/p6j34s0511q33t8npcpsj9gw0000gn/T/
CONDA_SHLVL=1
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.tTwjH0va6l/Render
CONDA_PROMPT_MODIFIER=
TERM_PROGRAM_VERSION=404.1
OLDPWD=/Users/mjzarrin/Documents
TERM_SESSION_ID=33152693-16F1-4C64-A226-3E4AA8CDB8BF
NVM_DIR=/Users/mjzarrin/.nvm
USER=mjzarrin
CONDA_EXE=/Users/mjzarrin/anaconda3/bin/conda
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.VwFyVepaRs/Listeners
PATH=/Users/mjzarrin/.cargo/bin:/Users/mjzarrin/.yarn/bin:/Users/mjzarrin/.config/yarn/global/node_modules/.bin:/Users/mjzarrin/anaconda3/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/opt/openssl/bin:/usr/local/sbin:/Users/mjzarrin/.nvm/versions/node/v12.19.0/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Users/mjzarrin/apache-maven-3.5.0/bin/:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin
CONDA_PREFIX=/Users/mjzarrin/anaconda3
NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist
PWD=/usr/local
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
LANG=en_US.UTF-8
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
M2_HOME=/Users/mjzarrin/apache-maven-3.5.0/
SHLVL=1
HOME=/Users/mjzarrin
CONDA_PYTHON_EXE=/Users/mjzarrin/anaconda3/bin/python
LOGNAME=mjzarrin
CONDA_DEFAULT_ENV=base
NVM_BIN=/Users/mjzarrin/.nvm/versions/node/v12.19.0/bin
NVM_IOJS_ORG_MIRROR=https://iojs.org/dist
DISPLAY=/private/tmp/com.apple.launchd.sNNQyX8v30/org.macosforge.xquartz:0
_=/usr/bin/env
I also checked the following. I went to single-user mode (CMD+S during boot). it gives me command line then I typed following.
mount -uw /
update_dyld_shared_cache -force
It's finished without errors but some warning. then I reboot. and logged in to my account.
Majids-MacBook-Pro:~ mjzarrin$ sudo vi x.txt
dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin
Referenced from: /usr/local/libexec/sudo/sudoers.so
Expected in: flat namespace
dyld: Symbol not found: ____chkstk_darwin
Referenced from: /usr/local/libexec/sudo/sudoers.so
Expected in: flat namespace
Abort trap: 6
Majids-MacBook-Pro:~ mjzarrin$ /usr/bin/sudo vi x.txt
sudo: setrlimit(8): Invalid argument
sudo: error in /etc/sudo.conf, line 16 while loading plugin "sudoers_audit"
sudo: unable to find symbol "sudoers_audit" in sudoers.so
sudo: fatal error, unable to load plugins
Majids-MacBook-Pro:~ mjzarrin$ /usr/local/bin/sudo vi x.txt
dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin
Referenced from: /usr/local/libexec/sudo/sudoers.so
Expected in: flat namespace
dyld: Symbol not found: ____chkstk_darwin
Referenced from: /usr/local/libexec/sudo/sudoers.so
Expected in: flat namespace
Abort trap: 6
type sudo
return? What kind of changes have you made to thesudoers
file?Installer
or by a third-party package manager command-line tool such asbrew
orport
? 2. What happens if you reboot in single-user mode (CMD+S during boot), remount your boot volume as read-write by following the instructions onscreen, run the commandupdate_dyld_shared_cache -force
, and reboot again? Does this still reoccur?ENV
)? (Please be sure to scrub any personal information from the output first.)sudo
. Try again with/usr/bin/sudo vi x.txt
sudo
itself, maybe a PAM module or something like that. But there's something nonstandard here, and that's almost certainly what's causing the problem.