showallkexts fails with AttributeError 'MemMachO' has no attribute 'allow_unknown_load_commands'

I am running on Sequoia 15.1 24B83 with the appropriate KDK on both my host and target systems. I am trying to examine the target when it has crashed either due to triggering an NMI or causing a crash in my company's kext. I am not getting very far! I can attach from the host to the target. But I can't run any useful commands, starting with showallkexts. It shows up in the list of 'Current user-defined commands' but fails with the above attribute error when I try to run it. I get that same error trying to use other user-defined commands. I followed the host setup instructions in the KDK readme, but this traceback leads me to think I have overlooked something.

If this is something folks have seen before, I would appreciate any guidance!

I followed the host setup instructions in the KDK readme, but this traceback leads me to think I have overlooked something.

Did you specifically do these steps from the KDK ReadMe* on the host device:

Step 1: Install Xcode
Install Xcode. Then install these additional Python packages for kernel debugging:
$ xcrun python3 -m pip install --user --ignore-installed macholib
$ xcrun python3 -m pip install --user --ignore-installed future

Those steps are to supposed to prevent this particular error:

showallkexts fails with AttributeError 'MemMachO' has no attribute 'allow_unknown_load_commands'

Beyond that, what exactly are you running on the host side and what other host configurations have you tried, both in terms of Xcode and system versions? Particularly if you have multiple Xcode installed or have been moving through multiple Xcode versions, I would also try using the "xcode-select" command line tool to explicitly designate "the System's" Xcode install. I have seen failures like this happen because the system has gotten confused about the One True Xcode™*.

*Historically, "the developer tools" were a large collection of tools/apps that were installed into the system itself (mostly in /Developer/, but also in other locations) and there simply wasn't any support for installing multiple copies of Xcode. Xcode was converted into an app by moving "everything" inside it's app bundle and then remapping various commands and search paths into that app bundle. However, that process can sometimes have issues, at which point you can end up using a mix of components/resources that come from unrelated locations (the current Xcode, previous Xcode installs, the existing system, etc.). xcode-select exists to reset that process, pointing everything into a single Xcode app bundle.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Thanks for the info. I ran those commands (here is a snip from my history: 66 xcrun python3 -m pip install --user --ignore-installed macholib 67 export PATH=.:$PATH:/Users/khampton/Library/Python/3.9/bin 68 ech $PATH 69 echo $PATH 70 xcrun python3 -m pip install --user --ignore-installed future 71 lldb 72 lldb 73 lldb /Library/Developer/KDKs/KDK_15.1_24B83.kdk/System/Library/Kernels/kernel

I have only installed Xcode 16.0 (16A242d) on this volume, which is running Sequoia 15.1 - all squeaky clean I think.

I was initially using a host running older software and had the same problem. That one had been used as a dev system and I would not have been surprised if the reason it had the same problem was due to the Xcode confusion you describe. But prior to the upgrade (from Sonoma) to 15.1 on my m3 MBP, I had never installed Xcode on this host volume

showallkexts fails with AttributeError 'MemMachO' has no attribute 'allow_unknown_load_commands'
 
 
Q