How to Symbolicate an Apple Silicon Panic?

Investigating a kernel panic, I discovered that Apple Silicon Panic traces are not working with how I know to symbolicate the panic information. I have not found proper documentation that corrects this situation.

Attached file is an indentity-removed panic, received from causing an intentional panic (dereferencing nullptr), so that I know what functions to expect in the call stack. This is cut-and-pasted from the "Report To Apple" dialog that appears after the reboot:

panic(cpu 1 caller 0xfffffe0013f82eb0): Unaligned kernel data abort. at pc 0xfffffe001203fe10, lr 0x88f2fe001203fbac (saved state: 0xfffffe6fde4cb340)
      x0:  0xfffffe24cde5d5e0 x1:  0xfffffe0011fdd608  x2:  0xfffffe6fde4cb790  x3:  0xfffffe6fde4cb78c
      x4:  0x0000000000000000 x5:  0x0000000000000000  x6:  0x0000000000000000  x7:  0x0000000000000000
      x8:  0x000000000000001a x9:  0xfffffe3f71a54000  x10: 0x000000000000fffd  x11: 0x0000000000420000
      x12: 0x0000000000000001 x13: 0x0000000000000001  x14: 0x0000000000000001  x15: 0xfffffe24cceb8098
      x16: 0xfffffe0012008bc0 x17: 0xfffcfe0012008bc0  x18: 0x0000000000000000  x19: 0x00000000e00002eb
      x20: 0xfffffe1ffc131170 x21: 0xfffffe2000eedc10  x22: 0x0000000000000000  x23: 0xfffffe6fde4cb78c
      x24: 0x8e917e001203fb50 x25: 0xfffffe6fde4cb790  x26: 0xfffffe6fde4cb794  x27: 0x0000000000000000
      x28: 0xfffffe2000eedc38 fp:  0xfffffe6fde4cb6f0  lr:  0x88f2fe001203fbac  sp:  0xfffffe6fde4cb690
      pc:  0xfffffe001203fe10 cpsr: 0x80401208         esr: 0x96000061          far: 0xfffffe3f71a63ffd

Debugger message: panic
Memory ID: 0x6
OS release type: User
OS version: 23G93
Kernel version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8122
Fileset Kernelcache UUID: 8C050C26F2A61432A55E63D98483E4A9
Kernel UUID: 5ABEB946-A4FE-30C7-AD57-9F34F3E88710
Boot session UUID: 17ABF975-0228-49B2-AD26-BD4D82EEA660
iBoot version: iBoot-10151.140.19
secure boot?: YES
roots installed: 0
Paniclog version: 14
KernelCache slide: 0x000000000b1c0000
KernelCache base:  0xfffffe00121c4000
Kernel slide:      0x000000000b1c8000
Kernel text base:  0xfffffe00121cc000
Kernel text exec slide: 0x000000000c718000
Kernel text exec base:  0xfffffe001371c000
mach_absolute_time: 0x7d2ae264e
Epoch Time:        sec       usec
  Boot    : 0x66c63838 0x000b0535
  Sleep   : 0x00000000 0x00000000
  Wake    : 0x00000000 0x00000000
  Calendar: 0x66c63dab 0x00032338

Zone info:
  Zone map: 0xfffffe1000bd0000 - 0xfffffe3000bd0000
  . VM    : 0xfffffe1000bd0000 - 0xfffffe14cd89c000
  . RO    : 0xfffffe14cd89c000 - 0xfffffe1667234000
  . GEN0  : 0xfffffe1667234000 - 0xfffffe1b33f00000
  . GEN1  : 0xfffffe1b33f00000 - 0xfffffe2000bcc000
  . GEN2  : 0xfffffe2000bcc000 - 0xfffffe24cd898000
  . GEN3  : 0xfffffe24cd898000 - 0xfffffe299a564000
  . DATA  : 0xfffffe299a564000 - 0xfffffe3000bd0000
  Metadata: 0xfffffe3f50b18000 - 0xfffffe3f58b18000
  Bitmaps : 0xfffffe3f58b18000 - 0xfffffe3f5b854000
  Extra   : 0 - 0

CORE 0 recently retired instr at 0xfffffe00138c72e8
CORE 1 recently retired instr at 0xfffffe00138c5bb4
CORE 2 recently retired instr at 0xfffffe00138c72e8
CORE 3 recently retired instr at 0xfffffe00138c72e8
CORE 4 recently retired instr at 0xfffffe00138c72e8
CORE 5 recently retired instr at 0xfffffe00138c72e8
CORE 6 recently retired instr at 0xfffffe00138c72e8
CORE 7 recently retired instr at 0xfffffe00138c72e8
TPIDRx_ELy = {1: 0xfffffe24ca5dafb0  0: 0x0000000000000001  0ro: 0x0000000201927320 }
CORE 0 PVH locks held: None
CORE 1 PVH locks held: None
CORE 2 PVH locks held: None
CORE 3 PVH locks held: None
CORE 4 PVH locks held: None
CORE 5 PVH locks held: None
CORE 6 PVH locks held: None
CORE 7 PVH locks held: None
CORE 0: PC=0xfffffe00137ae1b0, LR=0xfffffe00137ae1b0, FP=0xfffffe6fde46bef0
CORE 1 is the one that panicked. Check the full backtrace for details.
CORE 2: PC=0xfffffe00137ae1b0, LR=0xfffffe00137ae1b0, FP=0xfffffe6fdcb6bef0
CORE 3: PC=0xfffffe00137ae1b0, LR=0xfffffe00137ae1b0, FP=0xfffffe6fde75fef0
CORE 4: PC=0xfffffe00137ae1b0, LR=0xfffffe00137ae1b0, FP=0xfffffe6fde7bfef0
CORE 5: PC=0xfffffe00137ae1b0, LR=0xfffffe00137ae1b0, FP=0xfffffe6fdcdb7ef0
CORE 6: PC=0xfffffe00138c2004, LR=0xfffffe00138c2000, FP=0xfffffe6fde78fe80
CORE 7: PC=0xfffffe00137ae1b0, LR=0xfffffe00137ae1b0, FP=0xfffffe6fde63fef0
Compressor Info: 0% of compressed pages limit (OK) and 0% of segments limit (OK) with 0 swapfiles and OK swap space
Panicked task 0xfffffe16694b79a0: 10118 pages, 8 threads: pid 1190: FPGA_Test
Panicked thread: 0xfffffe24ca5dafb0, backtrace: 0xfffffe6fde4caad0, tid: 15774
          lr: 0xfffffe0013774124  fp: 0xfffffe6fde4cab60
          lr: 0xfffffe00138be2f8  fp: 0xfffffe6fde4cabd0
          lr: 0xfffffe00138bc70c  fp: 0xfffffe6fde4cac90
          lr: 0xfffffe00137238cc  fp: 0xfffffe6fde4caca0
          lr: 0xfffffe0013773a18  fp: 0xfffffe6fde4cb050
          lr: 0xfffffe0013f783d0  fp: 0xfffffe6fde4cb070
          lr: 0xfffffe0013f82eb0  fp: 0xfffffe6fde4cb1f0
          lr: 0xfffffe00138be130  fp: 0xfffffe6fde4cb260
          lr: 0xfffffe00138bc9b8  fp: 0xfffffe6fde4cb320
          lr: 0xfffffe00137238cc  fp: 0xfffffe6fde4cb330
          lr: 0xfffffe001203fbac  fp: 0xfffffe6fde4cb6f0
          lr: 0xfffffe0013e7b820  fp: 0xfffffe6fde4cb760
          lr: 0xfffffe001203fb28  fp: 0xfffffe6fde4cb7a0
          lr: 0xfffffe001204ad04  fp: 0xfffffe6fde4cb7f0
          lr: 0xfffffe0012048448  fp: 0xfffffe6fde4cb860
          lr: 0xfffffe0013ecfa9c  fp: 0xfffffe6fde4cb8a0
          lr: 0xfffffe0013ecfddc  fp: 0xfffffe6fde4cba30
          lr: 0xfffffe001388976c  fp: 0xfffffe6fde4cbb50
          lr: 0xfffffe001377aa3c  fp: 0xfffffe6fde4cbbf0
          lr: 0xfffffe001375299c  fp: 0xfffffe6fde4cbc40
          lr: 0xfffffe00137665a0  fp: 0xfffffe6fde4cbca0
          lr: 0xfffffe00137669c0  fp: 0xfffffe6fde4cbda0
          lr: 0xfffffe00138b1ec0  fp: 0xfffffe6fde4cbe50
          lr: 0xfffffe00138bcb60  fp: 0xfffffe6fde4cbf10
          lr: 0xfffffe00137238cc  fp: 0xfffffe6fde4cbf20
          lr: 0xfffffe0013723894  fp: 0x0000000000000000
      Kernel Extensions in backtrace:
         com.company.product(1.4.21d119)[92BABD94-80A4-3F6D-857A-3240E4DA8009]@0xfffffe001203bfd0->0xfffffe00120533ab
            dependency: com.apple.iokit.IOPCIFamily(2.9)[6D6666E6-340F-3A5E-9464-DE05164C0658]@0xfffffe0015e65e90->0xfffffe0015e93b3f

last started kext at 3003586896: com.apple.filesystems.smbfs    5.1 (addr 0xfffffe0012c0ad90, size 82354)
loaded kexts:
com.company.product    1.4.21d119
com.uaudio.driver.UAD2System    11.4.0
com.digidesign.iokit.DigiDal    24.6.0f4
com.apple.filesystems.smbfs    5.1
com.apple.filesystems.autofs    3.0
com.apple.driver.AppleTopCaseHIDEventDriver    7440.8
com.apple.driver.CoreKDL    1
com.apple.driver.AppleBiometricServices    1
com.apple.driver.BCMWLANFirmware4388.Hashstore    1
com.apple.driver.BCMWLANFirmware4387.Hashstore    1
com.apple.driver.BCMWLANFirmware4378.Hashstore    1
com.apple.driver.DiskImages.ReadWriteDiskImage    493.0.0
com.apple.driver.DiskImages.UDIFDiskImage    493.0.0
com.apple.driver.DiskImages.RAMBackingStore    493.0.0
com.apple.driver.DiskImages.FileBackingStore    493.0.0
com.apple.driver.AppleThunderboltIP    4.0.3
com.apple.driver.AppleUSBDeviceNCM    5.0.0
com.apple.driver.AppleFileSystemDriver    3.0.1
com.apple.nke.l2tp    1.9
com.apple.filesystems.tmpfs    1
com.apple.driver.AppleSmartBatteryManager    161.0.0
com.apple.filesystems.nfs    1
com.apple.filesystems.lifs    1
com.apple.filesystems.apfs    2236.141.1
com.apple.IOTextEncryptionFamily    1.0.0
com.apple.filesystems.hfs.kext    650.140.2
com.apple.security.BootPolicy    1
com.apple.BootCache    40
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib    1.0.0
com.apple.AppleFSCompression.AppleFSCompressionTypeDataless    1.0.0d1
com.apple.driver.AppleALSColorSensor    1.0.0d1
com.apple.driver.AppleAOPVoiceTrigger    340.42
com.apple.driver.AppleSmartIO2    1
com.apple.driver.ApplePMP    1
com.apple.driver.SEPHibernation    1
com.apple.AppleEmbeddedSimpleSPINORFlasher    1
com.apple.driver.AppleCS42L84Audio    740.41
com.apple.driver.ApplePMPFirmware    1
com.apple.driver.AppleTypeCRetimer    1.0.0
com.apple.driver.AppleSN012776Amp    740.41
com.apple.driver.AppleM68Buttons    1.0.0d1
com.apple.driver.AppleT8020SOCTuner    1
com.apple.driver.AppleT8122CLPC    1
com.apple.driver.AppleSDXC    3.5.2
com.apple.driver.AppleDPDisplayTCON    1
com.apple.AGXG15G    282.14
com.apple.driver.AppleProResHW    350.47.0
com.apple.driver.AppleAVD    743
com.apple.driver.AppleAVE2    760.31.1
com.apple.driver.AppleJPEGDriver    6.6.2
com.apple.driver.AppleMobileDispH15G-DCP    140.0
com.apple.driver.usb.AppleSynopsysUSB40XHCI    1
com.apple.driver.AudioDMAController-T8122    350.2
com.apple.driver.AppleSamsungSerial    1.0.0d1
com.apple.driver.AppleSerialShim    1
com.apple.driver.AppleEventLogHandler    1
com.apple.driver.AppleS5L8960XNCO    1
com.apple.driver.AppleT8122PMGR    1
com.apple.driver.AppleS8000AES    1
com.apple.driver.AppleS8000DWI    1.0.0d1
com.apple.driver.AppleInterruptControllerV3    1.0.0d1
com.apple.driver.AppleBluetoothModule    1
com.apple.driver.AppleBCMWLANBusInterfacePCIe    1
com.apple.driver.AppleT8110DART    1
com.apple.driver.AppleS5L8920XPWM    1.0.0d1
com.apple.driver.AppleS5L8940XI2C    1.0.0d2
com.apple.driver.AppleSPIMC    1
com.apple.driver.AppleT8122    1
com.apple.iokit.IOUserEthernet    1.0.1
com.apple.driver.usb.AppleUSBUserHCI    1
com.apple.iokit.IOKitRegistryCompatibility    1
com.apple.iokit.EndpointSecurity    1
com.apple.driver.AppleUIO    1
com.apple.driver.AppleDiskImages2    276.120.7
com.apple.AppleSystemPolicy    2.0.0
com.apple.nke.applicationfirewall    405
com.apple.kec.InvalidateHmac    1
com.apple.kec.AppleEncryptedArchive    1
com.apple.driver.usb.cdc    5.0.0
com.apple.driver.AppleUSBAudio    640.12
com.apple.driver.usb.AppleUSBXHCIPCI    1.2
com.apple.iokit.IOAudioFamily    540.3
com.apple.vecLib.kext    1.2.0
com.apple.driver.driverkit.serial    6.0.0
com.apple.driver.AppleThunderboltDPOutAdapter    8.5.1
com.apple.driver.AppleThunderboltPCIUpAdapter    4.1.1
com.apple.iokit.IOAVBFamily    1220.1
com.apple.driver.AppleHSBluetoothDriver    7440.8
com.apple.driver.IOBluetoothHIDDriver    9.0.0
com.apple.driver.AppleActuatorDriver    7440.9
com.apple.driver.AppleMultitouchDriver    7440.9
com.apple.driver.AppleHIDKeyboard    7440.3
com.apple.driver.AppleMesaSEPDriver    100.99
com.apple.iokit.IOBiometricFamily    1
com.apple.driver.DiskImages.KernelBacked    493.0.0
com.apple.driver.AppleXsanScheme    3
com.apple.driver.AppleUVDMDriver    1.0.0
com.apple.driver.AppleUVDM    1.0.0
com.apple.driver.usb.networking    5.0.0
com.apple.driver.AppleThunderboltUSBDownAdapter    1.0.4
com.apple.driver.AppleThunderboltPCIDownAdapter    4.1.1
com.apple.driver.AppleThunderboltDPInAdapter    8.5.1
com.apple.driver.AppleThunderboltDPAdapterFamily    8.5.1
com.apple.driver.AppleConvergedIPCOLYBTControl    1
com.apple.driver.AppleConvergedPCI    1
com.apple.driver.AppleBluetoothDebug    1
com.apple.driver.AppleBTM    1.0.1
com.apple.nke.ppp    1.9
com.apple.driver.AppleBSDKextStarter    3
com.apple.kext.triggers    1.0
com.apple.driver.IOHIDPowerSource    1
com.apple.driver.AppleCallbackPowerSource    1
com.apple.filesystems.hfs.encodings.kext    1
com.apple.driver.AppleSyntheticGameController    11.6.1
com.apple.driver.AppleDCPDPTXProxy    1.0.0
com.apple.driver.DCPDPFamilyProxy    1
com.apple.plugin.IOgPTPPlugin    1240.15
com.apple.driver.AppleAOPAudio    340.4
com.apple.driver.AppleSEPHDCPManager    1.0.1
com.apple.driver.AppleTrustedAccessory    1
com.apple.iokit.AppleSEPGenericTransfer    1
com.apple.AGXFirmwareKextG15GRTBuddy    1
com.apple.AGXFirmwareKextRTBuddy64    282.14
com.apple.driver.AppleStockholmControl    1.0.0
com.apple.iokit.IONVMeFamily    2.1.0
com.apple.driver.AppleDiagnosticDataAccessReadOnly    1.0.0
com.apple.driver.AppleNANDConfigAccess    1.0.0
com.apple.driver.AppleCSEmbeddedAudio    740.41
com.apple.driver.AppleHIDTransportFIFO    7440.1
com.apple.driver.AppleHIDTransport    7440.1
com.apple.driver.AppleInputDeviceSupport    7440.1
com.apple.driver.AppleSPMIPMU    1.0.1
com.apple.driver.AppleDialogPMU    1.0.1
com.apple.driver.usb.AppleUSBHostPacketFilter    1.0
com.apple.driver.AppleEmbeddedAudio    740.41
com.apple.iokit.AppleARMIISAudio    340.16
com.apple.driver.IISAudioIsolatedStreamECProxy    340.16
com.apple.driver.ExclavesAudioKext    1
com.apple.driver.ApplePassthroughPPM    3.0
com.apple.driver.AppleSPU    1
com.apple.iokit.IOGPUFamily    93.40.3
com.apple.driver.AppleH11ANEInterface    7.453.0
com.apple.driver.AppleH13CameraInterface    8.701.0
com.apple.driver.DCPAVFamilyProxy    1
com.apple.iokit.IOMobileGraphicsFamily-DCP    343.0.0
com.apple.driver.AppleDCP    1
com.apple.driver.AppleFirmwareKit    1
com.apple.iokit.IOMobileGraphicsFamily    343.0.0
com.apple.driver.AppleM2ScalerCSCDriver    265.0.0
com.apple.driver.AppleSPMI    1.0.1
com.apple.driver.AppleUSBXDCIARM    1.0
com.apple.driver.AppleUSBXDCI    1.0
com.apple.iokit.IOUSBDeviceFamily    2.0.0
com.apple.driver.usb.AppleSynopsysUSBXHCI    1
com.apple.driver.usb.AppleUSBXHCI    1.2
com.apple.driver.AppleEmbeddedUSBHost    1
com.apple.driver.usb.AppleUSBHub    1.2
com.apple.driver.usb.AppleUSBHostCompositeDevice    1.2
com.apple.driver.AppleT8122TypeCPhy    1
com.apple.driver.AppleHPM    3.4.4
com.apple.driver.AppleDockChannel    1
com.apple.driver.AppleSART    1
com.apple.driver.ApplePMGR    1
com.apple.driver.AppleA7IOP-ASCWrap-v6    1.0.2
com.apple.driver.AppleARMWatchdogTimer    1
com.apple.driver.AppleDisplayCrossbar    1.0.0
com.apple.iokit.IODisplayPortFamily    1.0.0
com.apple.driver.AppleTypeCPhy    1
com.apple.driver.AppleThunderboltNHI    7.2.81
com.apple.driver.AppleT8122PCIeC    1
com.apple.iokit.IOThunderboltFamily    9.3.3
com.apple.iokit.IOPortFamily    1.0
com.apple.driver.ApplePIODMA    1
com.apple.driver.AppleA7IOP-MXWrap-v1    1.0.2
com.apple.driver.AppleT8122PCIe    1
com.apple.driver.AppleMultiFunctionManager    1
com.apple.driver.AppleBluetoothDebugService    1
com.apple.driver.AppleBCMWLANCore    1.0.0
com.apple.iokit.IO80211Family    1200.13.0
com.apple.driver.IOImageLoader    1.0.0
com.apple.driver.AppleOLYHAL    1
com.apple.driver.corecapture    1.0.4
com.apple.driver.AppleEmbeddedPCIE    1
com.apple.driver.AppleMCA2-T8122    840.3
com.apple.driver.AppleEmbeddedAudioLibs    340.8
com.apple.driver.AppleFirmwareUpdateKext    1
com.apple.driver.AppleGPIOICController    1.0.2
com.apple.driver.AppleEverestErrorHandler    1
com.apple.driver.AppleMobileApNonce    1
com.apple.iokit.IOTimeSyncFamily    1240.15
com.apple.driver.DiskImages    493.0.0
com.apple.iokit.IOGraphicsFamily    598
com.apple.iokit.IOBluetoothFamily    9.0.0
com.apple.driver.AppleSSE    1.0
com.apple.driver.AppleSEPKeyStore    2
com.apple.driver.AppleUSBTDM    556
com.apple.iokit.IOUSBMassStorageDriver    245
com.apple.iokit.IOPCIFamily    2.9
com.apple.iokit.IOUSBHostFamily    1.2
com.apple.driver.AppleUSBHostMergeProperties    1.2
com.apple.driver.usb.AppleUSBCommon    1.0
com.apple.driver.AppleSMC    3.1.9
com.apple.driver.RTBuddy    1.0.0
com.apple.driver.AppleEmbeddedTempSensor    1.0.0
com.apple.driver.AppleARMPMU    1.0
com.apple.iokit.IOAccessoryManager    1.0.0
com.apple.driver.AppleOnboardSerial    1.0
com.apple.iokit.IOSerialFamily    11
com.apple.iokit.IOSCSIBlockCommandsDevice    495
com.apple.iokit.IOSCSIArchitectureModelFamily    495
com.apple.driver.AppleRSMChannel    1
com.apple.iokit.IORSMFamily    1
com.apple.driver.AppleLockdownMode    1
com.apple.driver.AppleIPAppender    1.0
com.apple.iokit.IOSkywalkFamily    1.0
com.apple.driver.mDNSOffloadUserClient    1.0.1b8
com.apple.iokit.IONetworkingFamily    3.4
com.apple.driver.AppleFDEKeyStore    28.30
com.apple.driver.AppleEffaceableStorage    1.0
com.apple.driver.AppleCredentialManager    1.0
com.apple.driver.AppleSEPManager    1.0.1
com.apple.driver.IODARTFamily    1
com.apple.driver.AppleA7IOP    1.0.2
com.apple.driver.IOSlaveProcessor    1
com.apple.driver.AppleBiometricSensor    2
com.apple.iokit.IOHIDFamily    2.0.0
com.apple.AUC    1.0
com.apple.iokit.IOSurface    352.50.1
com.apple.iokit.IOAVFamily    1.0.0
com.apple.iokit.IOHDCPFamily    1.0.0
com.apple.iokit.IOCECFamily    1
com.apple.iokit.IOAudio2Family    1.0
com.apple.driver.AppleIISController    340.1
com.apple.driver.AppleAudioClockLibs    340.8
com.apple.driver.FairPlayIOKit    71.10.0
com.apple.driver.AppleARMPlatform    1.0.2
com.apple.iokit.IOSlowAdaptiveClockingFamily    1.0.0
com.apple.iokit.IOReportFamily    47
com.apple.security.quarantine    4
com.apple.security.sandbox    300.0
com.apple.iokit.IOStorageFamily    2.1
com.apple.kext.AppleMatch    1.0.0d1
com.apple.driver.AppleMobileFileIntegrity    1.0.5
com.apple.iokit.CoreAnalyticsFamily    1
com.apple.security.AppleImage4    6.3.0
com.apple.kext.CoreTrust    1
com.apple.iokit.IOCryptoAcceleratorFamily    1.0.1
com.apple.kec.pthread    1
com.apple.kec.Libm    1
com.apple.kec.Compression    1.0
com.apple.kec.corecrypto    14.0



** Stackshot Succeeded ** Bytes Traced 483102 (Uncompressed 1236304) **

To start, I download and install the matching KDK (in this case KDK_14.6.1_23G93.kdk), identified from this line:

OS version: 23G93
Kernel version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8122

Then start lldb from Terminal, using this command:

  • bash_prompt % lldb -arch arm64e /Library/Developer/KDKs/KDK_14.6.1_23G93.kdk/System/Library/Kernels/kernel.release.t8122

Next I load the remaining scripts per the instructions from lldb:

  • (lldb) settings set target.load-script-from-symbol-file true

I need to know what address to load my kext symbols to, which I read from this line of the panic log, after the @ symbol:

com.company.product(1.4.21d119)[92BABD94-80A4-3F6D-857A-3240E4DA8009]@0xfffffe001203bfd0->0xfffffe00120533ab

I am using a debug build of my kext, so the DWARF symbols are part of the binary. I use this line to load the symbols into the lldb session:

  • (lldb) addkext -F /Library/Extensions/KextName.kext/Contents/MacOS/KextName 0xfffffe001203bfd0

And now I should be able to use lldb image lookup to identify pointers on the stack that land within my kext. For example, the current PC at the moment of the crash lands within the kext (expected, because it was intentional):

  • (lldb) image lookup -a 0xfffffe001203fe10

Which gives the following incorrect result:

      Address: KextName[0x0000000000003e40] (KextName.__TEXT.__cstring + 14456)
      Summary: "ffer has %d retains\n"

That's not even a program instruction - that's within a cstring. No, that cstring isn't involved in anything pertaining to the intentional panic I am expecting to see.

Can someone please explain what I'm doing wrong and provide instructions that will give symbol information from a panic trace on an Apple Silicon Mac?

Disclaimers:

  • Yes I know IOPCIFamily is deprecated, I am in process of transitioning to DriverKit Dext from IOKit kext. Until then I must maintain the kext.
  • Terminal command "atos" provides similar incorrect results, and seems to not work with debug-built-binaries (only dSYM files)
  • Yes this is an intentional panic so that I can verify the symbolicate process before I move on to investigating an unexpected panic
  • I have set nvram boot-args to include keepsyms=1
  • I have tried (lldb) command script import lldb.macosx but get a result of error: no images in crash log (after the nvram settings)
Answered by daniek3 in 802093022

Kevin Elliot, DTS Engineer, solved this in a private code-level support ticket.

There is yet another offset that was not being accounted for, but can be found using the command line tool otool:

zsh_prompt% otool -arch arm64e -l /Library/Extensions/KEXT_NAME.kext/Contents/MacOS/KEXT_NAME

will give a lot of output information, but a section with this information:

      cmd LC_SEGMENT_64
  cmdsize 232
  segname __TEXT_EXEC
   vmaddr 0x0000000000004000
   vmsize 0x0000000000010000

Shows that an address of 0x4000 needs to be accounted for when performing the atos lookups.

By adding that value to the load address of the kext when calling atos, we get the correct / expected answer.

zsh_prompt% atos -arch arm64e -o KEXT_NAME.kext.dSYM/Contents/Resources/DWARF/KEXT_NAME  -l <load address + (vmaddr of __TEXT_EXEC section)>  0xfffffe0015426e2c

com_company_kext_name::expectedFunction(OSObject*, void*, void*, void*, void*) (in KEXT_NAME) (SourceFile.cpp:1999)

Such a relief! Kudos to Kevin Elliot for finding a solution to this.

First off, please file a bug about the documentation side of this and then post the number back here. We really should do a much better job of explaining exactly what all this involves.

Next, a clarification on this:

That's not even a program instruction - that's within a cstring. No, that cstring isn't involved in anything pertaining to the intentional panic I am expecting to see.

Which gives the following incorrect result:

  Address: KextName[0x0000000000003e40] (KextName.__TEXT.__cstring + 14456)
  Summary: "ffer has %d retains\n"

That's not even a program instruction - that's within a cstring. No, that cstring isn't involved in anything pertaining to the intentional panic I am expecting to see.

What you described here isn't exactly what's going on.

The symbolication process is inherently, for lack of a better word, "stupid". Conceptually, your symbol file is basically just a long list of strings and offset pair, so all symbolication does is find the closest offset "smaller" than the address it was given, then returns "String + remainder". The problem with this line:

  Address: KextName[0x0000000000003e40] (KextName.__TEXT.__cstring + 14456)

...is that you're "remainder" is ENORMOUS. 14456 bytes-> 14Kb. It's not pointing you at a string, it's pointing you at "crazy offset" from some other string. If you work the math out "manually", you can how this all looks very "odd". Here's the basic math:

NOTE: I've thrown out the upper 32 bits, as it makes the numbers easier to work with

Base Address: 0xfffffe001203bfd0 -> 0x1203bfd0

Crashing Address: 0xfffffe001203fe10 -> 0x1203fe10

Crash Offset = Crashing Address - Base Address
0x3E40 = 0x1203fe10 - 0x1203bfd0

Symbolication Offset = "... + 14456" -> 0x3878


Offset of "KextName.__TEXT.__cstring" = Crash Offset - Symbolication Offset

0x5C8 = 0x3E40 - 0x3878

0x5C8 -> 1480 bytes

In other words, the actual location of "KextName.__TEXT.__cstring" is 1480 bytes from the "start" of your library, which actually seems somewhat reasonable.

In other words, the question here isn't "why am I pointing at a c string", it's "why aren't there any other symbols in the ~13,000 bytes after that cstring". Here's what I'd actually do next:

  • Symbolicate the other frames you've got. This is a quick way to differentiate between "something is wrong with THIS symbol" vs "something systemic is wrong".

  • "dwarfdump" will print the contents of a dsym file, which will either show that the symbols

  • Assuming there isn't any issue with the symbol file itself, then this could be because ASLR side your KEXT and hasn't been accounted for correctly. I think that's what this slide actually is:

KernelCache slide: 0x000000000b1c0000

...but I'm not sure if that was already accounted for in your addresses or not. However, if your dsym is otherwise "valid", then you should also be able to see a difference between the offset the kernel returned for the symbol it did find (KextName.__TEXT.__cstring-> 0x5C8) and the offset the dsym lists for that symbol. You can then adjust your address offsets to remove that difference.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Documentation bug reported, as FB14929037.

Yes - the offset from the string is quite large, but I just want useful output such as "ThisFunctionWasInvolved" from "ThisFunctionCausedAPanic.cpp, line 455".

Symbolicate the other frames you've got. This is a quick way to differentiate between "something is wrong with THIS symbol" vs "something systemic is wrong".

Yes, this is a “something systemic is wrong” situation. I was trying to reduce the amount of information for readers to wade through, but I am not getting useful results for any efforts at symbolicating the addresses on the back trace or the PC (program counter).

” dwarfdump" will print the contents of a dsym file, which will either show that the symbols

dwarfdump works on dSYM files, but apparently not on debug-builds-with-symbols-in-the-binary. As such, I rebuilt with separating the symbols into a dSYM file. dwarfdump provides what appears to be correct information for the symbols, but for a sanity check here is a blurb from the start of the dump:

KEXT_NAME.kext.dSYM/Contents/Resources/DWARF/KEXT_NAME(arm64e):	file format Mach-O arm64

.debug_info contents:
0x00000000: Compile Unit: length = 0x000001f9, format = DWARF32, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x000001fd)

0x0000000b: DW_TAG_compile_unit
              DW_AT_producer	("Apple clang version 13.1.6 (clang-1316.0.21.2.5)")
              DW_AT_language	(DW_LANG_C99)
              DW_AT_name	("/Users/username/Library/Developer/Xcode/DerivedData/KEXT_NAME-stuff/ArchiveIntermediates/KEXT_NAME/IntermediateBuildFilesPath/KEXT_NAME.build/Release/KEXT_NAME.build/DerivedSources/KEXT_NAME_info.c")
              DW_AT_LLVM_sysroot	("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk")
              DW_AT_APPLE_sdk	("MacOSX12.3.sdk")
              DW_AT_stmt_list	(0x00000000)
              DW_AT_comp_dir	("/Users/username/sandbox/codedirectory")
              DW_AT_APPLE_optimized	(true)

Since the binary is different, I triggered a new panic to work with:

panic(cpu 1 caller 0xfffffe001735eeb0): Kernel data abort. at pc 0xfffffe0015426e2c, lr 0xe2e8fe0015426c50 (saved state: 0xfffffe539673f400)
	  x0:  0xfffffe299b467000 x1:  0xfffffe00153c9608  x2:  0xfffffe539673f850  x3:  0xfffffe539673f84c
	  x4:  0x0000000000000000 x5:  0x0000000000000000  x6:  0xfffffe0016144d58  x7:  0x8cc8fe001729d5d4
	  x8:  0x0000000000000000 x9:  0x000000000000fffd  x10: 0xfffffe1b39b66418  x11: 0x0000000000420000
	  x12: 0x0000000000000001 x13: 0x0000000000000001  x14: 0x0000000000000001  x15: 0xfffffe24d2661a68
	  x16: 0xfffffe00153f0bb0 x17: 0xfffcfe00153f0bb0  x18: 0x0000000000000000  x19: 0x00000000e00002eb
	  x20: 0xfffffe2006d25b20 x21: 0xfffffe1b39b8f0b0  x22: 0x0000000000000000  x23: 0xfffffe539673f84c
	  x24: 0x2cb2fe0015426bf4 x25: 0xfffffe539673f850  x26: 0xfffffe539673f854  x27: 0x0000000000000000
	  x28: 0xfffffe1b39b8f0d8 fp:  0xfffffe539673f7b0  lr:  0xe2e8fe0015426c50  sp:  0xfffffe539673f750
	  pc:  0xfffffe0015426e2c cpsr: 0x60401208         esr: 0x96000005          far: 0x0000000000000000

Debugger message: panic
Memory ID: 0x6
OS release type: User
OS version: 23G93
Kernel version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8122
Fileset Kernelcache UUID: 8C050C26F2A61432A55E63D98483E4A9
Kernel UUID: 5ABEB946-A4FE-30C7-AD57-9F34F3E88710
Boot session UUID: 87E8F770-3C78-45CA-9657-55E7A2012FB3
iBoot version: iBoot-10151.140.19
secure boot?: YES
roots installed: 0
Paniclog version: 14
KernelCache slide: 0x000000000e59c000
KernelCache base:  0xfffffe00155a0000
Kernel slide:      0x000000000e5a4000
Kernel text base:  0xfffffe00155a8000
Kernel text exec slide: 0x000000000faf4000
Kernel text exec base:  0xfffffe0016af8000
mach_absolute_time: 0xaa631cce
Epoch Time:        sec       usec
  Boot    : 0x66cc9164 0x0001b247
  Sleep   : 0x00000000 0x00000000
  Wake    : 0x00000000 0x00000000
  Calendar: 0x66cc91d5 0x000bc19e

Zone info:
  Zone map: 0xfffffe1006664000 - 0xfffffe3006664000
  . VM    : 0xfffffe1006664000 - 0xfffffe14d3330000
  . RO    : 0xfffffe14d3330000 - 0xfffffe166ccc8000
  . GEN0  : 0xfffffe166ccc8000 - 0xfffffe1b39994000
  . GEN1  : 0xfffffe1b39994000 - 0xfffffe2006660000
  . GEN2  : 0xfffffe2006660000 - 0xfffffe24d332c000
  . GEN3  : 0xfffffe24d332c000 - 0xfffffe299fff8000
  . DATA  : 0xfffffe299fff8000 - 0xfffffe3006664000
  Metadata: 0xfffffe4973a70000 - 0xfffffe497ba70000
  Bitmaps : 0xfffffe497ba70000 - 0xfffffe497e7b8000
  Extra   : 0 - 0

CORE 0 recently retired instr at 0xfffffe0016ca32e8
CORE 1 recently retired instr at 0xfffffe0016ca1bb4
CORE 2 recently retired instr at 0xfffffe0016ca32e8
CORE 3 recently retired instr at 0xfffffe0016ca32e8
CORE 4 recently retired instr at 0xfffffe0016ca32e8
CORE 5 recently retired instr at 0xfffffe0016ca32e8
CORE 6 recently retired instr at 0xfffffe0016ca32e8
CORE 7 recently retired instr at 0xfffffe0016ca32e8
TPIDRx_ELy = {1: 0xfffffe24d47c67a8  0: 0x0000000000000001  0ro: 0x000000020607e320 }
CORE 0 PVH locks held: None
CORE 1 PVH locks held: None
CORE 2 PVH locks held: None
CORE 3 PVH locks held: None
CORE 4 PVH locks held: None
CORE 5 PVH locks held: None
CORE 6 PVH locks held: None
CORE 7 PVH locks held: None
CORE 0: PC=0xfffffe0016b8a1b0, LR=0xfffffe0016b8a1b0, FP=0xfffffe5397183ef0
CORE 1 is the one that panicked. Check the full backtrace for details.
CORE 2: PC=0xfffffe0016b8a1b0, LR=0xfffffe0016b8a1b0, FP=0xfffffe5395fe3ef0
CORE 3: PC=0xfffffe0016b8a1b0, LR=0xfffffe0016b8a1b0, FP=0xfffffe539774fef0
CORE 4: PC=0xfffffe0016b8a1b0, LR=0xfffffe0016b8a1b0, FP=0xfffffe5396bb3ef0
CORE 5: PC=0xfffffe0016b8a1b4, LR=0xfffffe0016b8a1b0, FP=0xfffffe53975fbef0
CORE 6: PC=0xfffffe0016b8a1b0, LR=0xfffffe0016b8a1b0, FP=0xfffffe53968efef0
CORE 7: PC=0xfffffe0016b8a1b0, LR=0xfffffe0016b8a1b0, FP=0xfffffe5397767ef0
Compressor Info: 0% of compressed pages limit (OK) and 0% of segments limit (OK) with 0 swapfiles and OK swap space
Panicked task 0xfffffe29946f6ba8: 9791 pages, 7 threads: pid 1593: FPGA_Test
Panicked thread: 0xfffffe24d47c67a8, backtrace: 0xfffffe539673eb90, tid: 15519
		  lr: 0xfffffe0016b50124  fp: 0xfffffe539673ec20
		  lr: 0xfffffe0016c9a2f8  fp: 0xfffffe539673ec90
		  lr: 0xfffffe0016c9870c  fp: 0xfffffe539673ed50
		  lr: 0xfffffe0016aff8cc  fp: 0xfffffe539673ed60
		  lr: 0xfffffe0016b4fa18  fp: 0xfffffe539673f110
		  lr: 0xfffffe00173543d0  fp: 0xfffffe539673f130
		  lr: 0xfffffe001735eeb0  fp: 0xfffffe539673f2b0
		  lr: 0xfffffe0016c9a120  fp: 0xfffffe539673f320
		  lr: 0xfffffe0016c988ac  fp: 0xfffffe539673f3e0
		  lr: 0xfffffe0016aff8cc  fp: 0xfffffe539673f3f0
		  lr: 0xfffffe0015426c50  fp: 0xfffffe539673f7b0
		  lr: 0xfffffe0017257820  fp: 0xfffffe539673f820
		  lr: 0xfffffe0015426bcc  fp: 0xfffffe539673f860
		  lr: 0xfffffe00172aba9c  fp: 0xfffffe539673f8a0
		  lr: 0xfffffe00172abddc  fp: 0xfffffe539673fa30
		  lr: 0xfffffe0016c6576c  fp: 0xfffffe539673fb50
		  lr: 0xfffffe0016b56a3c  fp: 0xfffffe539673fbf0
		  lr: 0xfffffe0016b2e99c  fp: 0xfffffe539673fc40
		  lr: 0xfffffe0016b425a0  fp: 0xfffffe539673fca0
		  lr: 0xfffffe0016b429c0  fp: 0xfffffe539673fda0
		  lr: 0xfffffe0016c8dec0  fp: 0xfffffe539673fe50
		  lr: 0xfffffe0016c98b60  fp: 0xfffffe539673ff10
		  lr: 0xfffffe0016aff8cc  fp: 0xfffffe539673ff20
		  lr: 0xfffffe0016aff894  fp: 0x0000000000000000
      Kernel Extensions in backtrace:
         com.company.KEXT_NAME(1.4.22)[BCD984AA-BC5B-30C7-94A7-4065678A0438]@0xfffffe0015423fd0->0xfffffe001543336f
            dependency: com.apple.iokit.IOPCIFamily(2.9)[6D6666E6-340F-3A5E-9464-DE05164C0658]@0xfffffe0019241e90->0xfffffe001926fb3f

last started kext at 369121457: com.apple.driver.usb.cdc	5.0.0 (addr 0xfffffe0015b9ad20, size 2005)
loaded kexts:
com.company.KEXT_NAME	1.4.22
com.digidesign.iokit.DigiDal	24.6.0f4
com.apple.filesystems.autofs	3.0
com.apple.driver.AppleTopCaseHIDEventDriver	7440.8
com.apple.driver.AppleBiometricServices	1
com.apple.driver.CoreKDL	1
com.apple.driver.BCMWLANFirmware4388.Hashstore	1
com.apple.driver.BCMWLANFirmware4387.Hashstore	1
com.apple.driver.BCMWLANFirmware4378.Hashstore	1
com.apple.driver.DiskImages.ReadWriteDiskImage	493.0.0
com.apple.driver.DiskImages.UDIFDiskImage	493.0.0
com.apple.driver.DiskImages.RAMBackingStore	493.0.0
com.apple.driver.DiskImages.FileBackingStore	493.0.0
com.apple.driver.AppleUSBDeviceNCM	5.0.0
com.apple.driver.AppleSmartBatteryManager	161.0.0
com.apple.driver.AppleThunderboltIP	4.0.3
com.apple.driver.AppleFileSystemDriver	3.0.1
com.apple.nke.l2tp	1.9
com.apple.filesystems.tmpfs	1
com.apple.driver.SEPHibernation	1
com.apple.filesystems.nfs	1
com.apple.filesystems.lifs	1
com.apple.filesystems.apfs	2236.141.1
com.apple.IOTextEncryptionFamily	1.0.0
com.apple.filesystems.hfs.kext	650.140.2
com.apple.security.BootPolicy	1
com.apple.BootCache	40
com.apple.AppleFSCompression.AppleFSCompressionTypeZlib	1.0.0
com.apple.AppleFSCompression.AppleFSCompressionTypeDataless	1.0.0d1
com.apple.driver.AppleALSColorSensor	1.0.0d1
com.apple.driver.ApplePMP	1
com.apple.driver.AppleSmartIO2	1
com.apple.driver.ApplePMPFirmware	1
com.apple.driver.AppleAOPVoiceTrigger	340.42
com.apple.AppleEmbeddedSimpleSPINORFlasher	1
com.apple.driver.AppleCS42L84Audio	740.41
com.apple.driver.AppleTypeCRetimer	1.0.0
com.apple.driver.AppleSN012776Amp	740.41
com.apple.driver.AppleM68Buttons	1.0.0d1
com.apple.driver.AppleT8020SOCTuner	1
com.apple.driver.AppleT8122CLPC	1
com.apple.driver.AppleSDXC	3.5.2
com.apple.driver.AppleDPDisplayTCON	1
com.apple.AGXG15G	282.14
com.apple.driver.AppleProResHW	350.47.0
com.apple.driver.AppleAVD	743
com.apple.driver.AppleAVE2	760.31.1
com.apple.driver.AppleJPEGDriver	6.6.2
com.apple.driver.AppleMobileDispH15G-DCP	140.0
com.apple.driver.usb.AppleSynopsysUSB40XHCI	1
com.apple.driver.AudioDMAController-T8122	350.2
com.apple.driver.AppleSamsungSerial	1.0.0d1
com.apple.driver.AppleSerialShim	1
com.apple.driver.AppleEventLogHandler	1
com.apple.driver.AppleS5L8960XNCO	1
com.apple.driver.AppleT8122PMGR	1
com.apple.driver.AppleS8000AES	1
com.apple.driver.AppleS8000DWI	1.0.0d1
com.apple.driver.AppleInterruptControllerV3	1.0.0d1
com.apple.driver.AppleBluetoothModule	1
com.apple.driver.AppleBCMWLANBusInterfacePCIe	1
com.apple.driver.AppleT8110DART	1
com.apple.driver.AppleS5L8920XPWM	1.0.0d1
com.apple.driver.AppleS5L8940XI2C	1.0.0d2
com.apple.driver.AppleSPIMC	1
com.apple.driver.AppleT8122	1
com.apple.iokit.IOUserEthernet	1.0.1
com.apple.driver.usb.AppleUSBUserHCI	1
com.apple.iokit.IOKitRegistryCompatibility	1
com.apple.iokit.EndpointSecurity	1
com.apple.driver.AppleUIO	1
com.apple.driver.AppleDiskImages2	276.120.7
com.apple.AppleSystemPolicy	2.0.0
com.apple.nke.applicationfirewall	405
com.apple.kec.InvalidateHmac	1
com.apple.kec.AppleEncryptedArchive	1
com.apple.driver.usb.cdc	5.0.0
com.apple.driver.AppleUSBAudio	640.12
com.apple.driver.usb.AppleUSBXHCIPCI	1.2
com.apple.iokit.IOAudioFamily	540.3
com.apple.vecLib.kext	1.2.0
com.apple.driver.driverkit.serial	6.0.0
com.apple.driver.AppleThunderboltPCIUpAdapter	4.1.1
com.apple.driver.AppleThunderboltDPOutAdapter	8.5.1
com.apple.iokit.IOAVBFamily	1220.1
com.apple.driver.AppleHSBluetoothDriver	7440.8
com.apple.driver.IOBluetoothHIDDriver	9.0.0
com.apple.driver.AppleActuatorDriver	7440.9
com.apple.driver.AppleMultitouchDriver	7440.9
com.apple.driver.AppleHIDKeyboard	7440.3
com.apple.driver.AppleMesaSEPDriver	100.99
com.apple.iokit.IOBiometricFamily	1
com.apple.driver.DiskImages.KernelBacked	493.0.0
com.apple.driver.AppleXsanScheme	3
com.apple.driver.AppleUVDMDriver	1.0.0
com.apple.driver.AppleUVDM	1.0.0
com.apple.driver.AppleConvergedIPCOLYBTControl	1
com.apple.driver.AppleConvergedPCI	1
com.apple.driver.AppleBluetoothDebug	1
com.apple.driver.AppleBTM	1.0.1
com.apple.driver.usb.networking	5.0.0
com.apple.driver.AppleThunderboltUSBDownAdapter	1.0.4
com.apple.driver.AppleThunderboltDPInAdapter	8.5.1
com.apple.driver.AppleThunderboltDPAdapterFamily	8.5.1
com.apple.driver.AppleThunderboltPCIDownAdapter	4.1.1
com.apple.nke.ppp	1.9
com.apple.driver.AppleTrustedAccessory	1
com.apple.iokit.AppleSEPGenericTransfer	1
com.apple.driver.AppleSEPHDCPManager	1.0.1
com.apple.driver.AppleBSDKextStarter	3
com.apple.kext.triggers	1.0
com.apple.driver.IOHIDPowerSource	1
com.apple.driver.AppleCallbackPowerSource	1
com.apple.filesystems.hfs.encodings.kext	1
com.apple.driver.AppleSyntheticGameController	11.6.1
com.apple.driver.AppleDCPDPTXProxy	1.0.0
com.apple.driver.DCPDPFamilyProxy	1
com.apple.iokit.IONVMeFamily	2.1.0
com.apple.driver.AppleAOPAudio	340.4
com.apple.plugin.IOgPTPPlugin	1240.15
com.apple.AGXFirmwareKextG15GRTBuddy	1
com.apple.AGXFirmwareKextRTBuddy64	282.14
com.apple.driver.AppleStockholmControl	1.0.0
com.apple.driver.AppleSPMIPMU	1.0.1
com.apple.driver.AppleDialogPMU	1.0.1
com.apple.driver.AppleHIDTransportFIFO	7440.1
com.apple.driver.AppleHIDTransport	7440.1
com.apple.driver.AppleInputDeviceSupport	7440.1
com.apple.driver.AppleDiagnosticDataAccessReadOnly	1.0.0
com.apple.driver.AppleNANDConfigAccess	1.0.0
com.apple.driver.AppleCSEmbeddedAudio	740.41
com.apple.driver.usb.AppleUSBHostPacketFilter	1.0
com.apple.driver.AppleEmbeddedAudio	740.41
com.apple.iokit.AppleARMIISAudio	340.16
com.apple.driver.IISAudioIsolatedStreamECProxy	340.16
com.apple.driver.ExclavesAudioKext	1
com.apple.driver.ApplePassthroughPPM	3.0
com.apple.driver.AppleSPU	1
com.apple.iokit.IOGPUFamily	93.40.3
com.apple.driver.AppleH11ANEInterface	7.453.0
com.apple.driver.AppleH13CameraInterface	8.701.0
com.apple.driver.DCPAVFamilyProxy	1
com.apple.iokit.IOMobileGraphicsFamily-DCP	343.0.0
com.apple.driver.AppleDCP	1
com.apple.driver.AppleFirmwareKit	1
com.apple.iokit.IOMobileGraphicsFamily	343.0.0
com.apple.driver.AppleM2ScalerCSCDriver	265.0.0
com.apple.driver.AppleSPMI	1.0.1
com.apple.driver.AppleUSBXDCIARM	1.0
com.apple.driver.AppleUSBXDCI	1.0
com.apple.iokit.IOUSBDeviceFamily	2.0.0
com.apple.driver.usb.AppleSynopsysUSBXHCI	1
com.apple.driver.usb.AppleUSBXHCI	1.2
com.apple.driver.AppleEmbeddedUSBHost	1
com.apple.driver.usb.AppleUSBHub	1.2
com.apple.driver.usb.AppleUSBHostCompositeDevice	1.2
com.apple.driver.AppleT8122TypeCPhy	1
com.apple.driver.AppleHPM	3.4.4
com.apple.driver.AppleDockChannel	1
com.apple.driver.AppleSART	1
com.apple.driver.ApplePMGR	1
com.apple.driver.AppleA7IOP-ASCWrap-v6	1.0.2
com.apple.driver.AppleARMWatchdogTimer	1
com.apple.driver.AppleDisplayCrossbar	1.0.0
com.apple.iokit.IODisplayPortFamily	1.0.0
com.apple.driver.AppleTypeCPhy	1
com.apple.driver.AppleThunderboltNHI	7.2.81
com.apple.driver.AppleT8122PCIeC	1
com.apple.iokit.IOThunderboltFamily	9.3.3
com.apple.iokit.IOPortFamily	1.0
com.apple.driver.ApplePIODMA	1
com.apple.driver.AppleA7IOP-MXWrap-v1	1.0.2
com.apple.driver.AppleT8122PCIe	1
com.apple.driver.AppleMultiFunctionManager	1
com.apple.driver.AppleBluetoothDebugService	1
com.apple.driver.AppleBCMWLANCore	1.0.0
com.apple.iokit.IO80211Family	1200.13.0
com.apple.driver.IOImageLoader	1.0.0
com.apple.driver.AppleOLYHAL	1
com.apple.driver.corecapture	1.0.4
com.apple.driver.AppleEmbeddedPCIE	1
com.apple.driver.AppleMCA2-T8122	840.3
com.apple.driver.AppleEmbeddedAudioLibs	340.8
com.apple.driver.AppleFirmwareUpdateKext	1
com.apple.driver.AppleGPIOICController	1.0.2
com.apple.driver.AppleEverestErrorHandler	1
com.apple.driver.AppleMobileApNonce	1
com.apple.iokit.IOTimeSyncFamily	1240.15
com.apple.driver.DiskImages	493.0.0
com.apple.iokit.IOGraphicsFamily	598
com.apple.iokit.IOBluetoothFamily	9.0.0
com.apple.driver.AppleSSE	1.0
com.apple.driver.AppleSEPKeyStore	2
com.apple.driver.AppleUSBTDM	556
com.apple.iokit.IOUSBMassStorageDriver	245
com.apple.iokit.IOPCIFamily	2.9
com.apple.iokit.IOUSBHostFamily	1.2
com.apple.driver.AppleUSBHostMergeProperties	1.2
com.apple.driver.usb.AppleUSBCommon	1.0
com.apple.driver.AppleSMC	3.1.9
com.apple.driver.RTBuddy	1.0.0
com.apple.driver.AppleEmbeddedTempSensor	1.0.0
com.apple.driver.AppleARMPMU	1.0
com.apple.iokit.IOAccessoryManager	1.0.0
com.apple.driver.AppleOnboardSerial	1.0
com.apple.iokit.IOSerialFamily	11
com.apple.iokit.IOSCSIBlockCommandsDevice	495
com.apple.iokit.IOSCSIArchitectureModelFamily	495
com.apple.driver.AppleRSMChannel	1
com.apple.iokit.IORSMFamily	1
com.apple.driver.AppleLockdownMode	1
com.apple.driver.AppleIPAppender	1.0
com.apple.iokit.IOSkywalkFamily	1.0
com.apple.driver.mDNSOffloadUserClient	1.0.1b8
com.apple.iokit.IONetworkingFamily	3.4
com.apple.driver.AppleFDEKeyStore	28.30
com.apple.driver.AppleEffaceableStorage	1.0
com.apple.driver.AppleCredentialManager	1.0
com.apple.driver.AppleSEPManager	1.0.1
com.apple.driver.IODARTFamily	1
com.apple.driver.AppleA7IOP	1.0.2
com.apple.driver.IOSlaveProcessor	1
com.apple.driver.AppleBiometricSensor	2
com.apple.iokit.IOHIDFamily	2.0.0
com.apple.AUC	1.0
com.apple.iokit.IOSurface	352.50.1
com.apple.iokit.IOAVFamily	1.0.0
com.apple.iokit.IOHDCPFamily	1.0.0
com.apple.iokit.IOCECFamily	1
com.apple.iokit.IOAudio2Family	1.0
com.apple.driver.AppleIISController	340.1
com.apple.driver.AppleAudioClockLibs	340.8
com.apple.driver.FairPlayIOKit	71.10.0
com.apple.driver.AppleARMPlatform	1.0.2
com.apple.iokit.IOSlowAdaptiveClockingFamily	1.0.0
com.apple.iokit.IOReportFamily	47
com.apple.security.quarantine	4
com.apple.security.sandbox	300.0
com.apple.iokit.IOStorageFamily	2.1
com.apple.kext.AppleMatch	1.0.0d1
com.apple.driver.AppleMobileFileIntegrity	1.0.5
com.apple.iokit.CoreAnalyticsFamily	1
com.apple.security.AppleImage4	6.3.0
com.apple.kext.CoreTrust	1
com.apple.iokit.IOCryptoAcceleratorFamily	1.0.1
com.apple.kec.pthread	1
com.apple.kec.Libm	1
com.apple.kec.Compression	1.0
com.apple.kec.corecrypto	14.0



** Stackshot Succeeded ** Bytes Traced 491463 (Uncompressed 1278432) **

The command line utility atos should be helpful as well, but here’s an example of what I get as output from that, when using full dSYM file information:

zsh_prompt% atos -arch arm64e -o KEXT_NAME.kext.dSYM/Contents/Resources/DWARF/KEXT_NAME  -l 0xfffffe0015423fd0 0xfffffe0015426e2c
0x00002e5c (in KEXT_NAME)

If I manually look up the 0x2e5c offset in the output from dwarfdump, I can see the following:

0x00002e5c:       DW_TAG_formal_parameter
                    DW_AT_type	(0x0000000000009408 "const IOService *")
                    DW_AT_artificial	(true) 

But that's definitely not conveying the one-step-to-symbolication that atos is supposed to be able to perform. It does not appear that I am using it incorrectly, but I am definitely not getting helpful results from it.

Following the idea that perhaps the kernel slide is not being properly dealt with, I followed this link ( https://lists.apple.com/archives/darwin-kernel/2014/Jan/msg00011.html ) for advice on how to deal with kernel slide (below is all commands listed, and lack of useful information provided):

zsh_prompt % lldb -arch arm64e kernel.release.t8122
(lldb) target create --arch=arm64e "kernel.release.t8122"
warning: 'kernel.release' contains a debug script. To run this script in this debug session:

    command script import "/Library/Developer/KDKs/KDK_14.6.1_23G93.kdk/System/Library/Kernels/kernel.release.t8122.dSYM/Contents/Resources/Python/kernel_release.py"

To run all discovered debug scripts in this session:

    settings set target.load-script-from-symbol-file true

Current executable set to '/Library/Developer/KDKs/KDK_14.6.1_23G93.kdk/System/Library/Kernels/kernel.release.t8122' (arm64e).
(lldb) settings set target.load-script-from-symbol-file true
Loading kernel debugging from /Library/Developer/KDKs/KDK_14.6.1_23G93.kdk/System/Library/Kernels/kernel.release.t8122.dSYM/Contents/Resources/Python/kernel_release.py
LLDB version lldb-1500.0.404.7
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
settings set target.process.python-os-plugin-path "/Library/Developer/KDKs/KDK_14.6.1_23G93.kdk/System/Library/Kernels/kernel.release.t8122.dSYM/Contents/Resources/Python/lldbmacros/core/operating_system.py"
settings set target.trap-handler-names hndl_allintrs hndl_alltraps trap_from_kernel hndl_double_fault hndl_machine_check _fleh_prefabt _ExceptionVectorsBase _ExceptionVectorsTable _fleh_undef _fleh_dataabt _fleh_irq _fleh_decirq _fleh_fiq_generic _fleh_dec
command script import "/Library/Developer/KDKs/KDK_14.6.1_23G93.kdk/System/Library/Kernels/kernel.release.t8122.dSYM/Contents/Resources/Python/lldbmacros/xnu.py"
xnu debug macros loaded successfully. Run showlldbtypesummaries to enable type summaries.
settings set target.process.optimization-warnings false
settings set target.process.experimental.os-plugin-reports-all-threads false
settings set target.process.run-all-threads true


(lldb) target modules add ../Extensions/IOPCIFamily.kext/Contents/MacOS/IOPCIFamily
(lldb) target modules add /Library/Extensions/KEXT_NAME.kext/Contents/MacOS/KEXT_NAME
(lldb) target modules load --file kernel.release.t8122 --slide 0x000000000e5a4000
Loading kernel debugging from /Library/Developer/KDKs/KDK_14.6.1_23G93.kdk/System/Library/Kernels/kernel.release.t8122.dSYM/Contents/Resources/Python/kernel_release.py
LLDB version lldb-1500.0.404.7
Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
settings set target.process.python-os-plugin-path "/Library/Developer/KDKs/KDK_14.6.1_23G93.kdk/System/Library/Kernels/kernel.release.t8122.dSYM/Contents/Resources/Python/lldbmacros/core/operating_system.py"
settings set target.trap-handler-names hndl_allintrs hndl_alltraps trap_from_kernel hndl_double_fault hndl_machine_check _fleh_prefabt _ExceptionVectorsBase _ExceptionVectorsTable _fleh_undef _fleh_dataabt _fleh_irq _fleh_decirq _fleh_fiq_generic _fleh_dec
command script import "/Library/Developer/KDKs/KDK_14.6.1_23G93.kdk/System/Library/Kernels/kernel.release.t8122.dSYM/Contents/Resources/Python/lldbmacros/xnu.py"
error: cannot add command: user command exists and force replace not set
error: cannot add command: user command exists and force replace not set
error: cannot add command: user command exists and force replace not set
error: cannot add command: user command exists and force replace not set
error: cannot add command: user command exists and force replace not set
error: cannot add command: user command exists and force replace not set
xnu debug macros loaded successfully. Run showlldbtypesummaries to enable type summaries.
error: cannot add command: user command exists and force replace not set
error: cannot add command: user command exists and force replace not set
error: cannot add command: user command exists and force replace not set
error: cannot add command: user command exists and force replace not set
error: cannot add command: user command exists and force replace not set
error: cannot add command: user command exists and force replace not set
error: cannot add command: user command exists and force replace not set
settings set target.process.optimization-warnings false
settings set target.process.experimental.os-plugin-reports-all-threads false
settings set target.process.run-all-threads true


(lldb) target modules load --file IOPCIFamily __TEXT 0xfffffe0019241e90
section '__TEXT' loaded at 0xfffffe0019241e90
(lldb) target modules load --file KEXT_NAME __TEXT 0xfffffe0015423fd0
section '__TEXT' loaded at 0xfffffe0015423fd0
(lldb) image list
[  0] 5ABEB946-A4FE-30C7-AD57-9F34F3E88710 0xfffffe00155a8000 /Library/Developer/KDKs/KDK_14.6.1_23G93.kdk/System/Library/Kernels/kernel.release.t8122 
      /Library/Developer/KDKs/KDK_14.6.1_23G93.kdk/System/Library/Kernels/kernel.release.t8122.dSYM/Contents/Resources/DWARF/kernel.release.t8122
[  1] 6D6666E6-340F-3A5E-9464-DE05164C0658 0xfffffe0019241e90 ../Extensions/IOPCIFamily.kext/Contents/MacOS/IOPCIFamily 
      ../Extensions/IOPCIFamily.kext.dSYM/Contents/Resources/DWARF/IOPCIFamily
[  2] BCD984AA-BC5B-30C7-94A7-4065678A0438 0xfffffe0015423fd0 /Library/Extensions/KEXT_NAME.kext/Contents/MacOS/KEXT_NAME 
      /Library/Extensions/KEXT_NAME.kext.dSYM/Contents/Resources/DWARF/KEXT_NAME
(lldb) image lookup -a 0xfffffe0015426bcc
      Address: KEXT_NAME[0x0000000000002bfc] (KEXT_NAME.__TEXT + 11260)
      Summary: 
(lldb) image lookup -a 0xfffffe0015426c50
      Address: KEXT_NAME[0x0000000000002c80] (KEXT_NAME.__TEXT + 11392)
      Summary: 
(lldb) image lookup -a 0xfffffe0015426e2c
      Address: KEXT_NAME[0x0000000000002e5c] (KEXT_NAME.__TEXT + 11868)
      Summary: 

So to answer all of the questions:

  1. Systemic issue, I am having trouble interpreting a kernel panic log and getting valid symbols as a result of address lookup for Apple Silicon
  2. dSYM file appears to be built properly
  3. atos is not providing helpful information, despite having proper dSYM file
  4. lldb commands to load images and deal with kernel slides does not yield helpful information
Accepted Answer

Kevin Elliot, DTS Engineer, solved this in a private code-level support ticket.

There is yet another offset that was not being accounted for, but can be found using the command line tool otool:

zsh_prompt% otool -arch arm64e -l /Library/Extensions/KEXT_NAME.kext/Contents/MacOS/KEXT_NAME

will give a lot of output information, but a section with this information:

      cmd LC_SEGMENT_64
  cmdsize 232
  segname __TEXT_EXEC
   vmaddr 0x0000000000004000
   vmsize 0x0000000000010000

Shows that an address of 0x4000 needs to be accounted for when performing the atos lookups.

By adding that value to the load address of the kext when calling atos, we get the correct / expected answer.

zsh_prompt% atos -arch arm64e -o KEXT_NAME.kext.dSYM/Contents/Resources/DWARF/KEXT_NAME  -l <load address + (vmaddr of __TEXT_EXEC section)>  0xfffffe0015426e2c

com_company_kext_name::expectedFunction(OSObject*, void*, void*, void*, void*) (in KEXT_NAME) (SourceFile.cpp:1999)

Such a relief! Kudos to Kevin Elliot for finding a solution to this.

Kudos to Kevin Elliot for finding a solution to this.

You're very welcome. atos needs to be updated to address this, probably by adding a new option when importing the base address. However, until then the math above should work fine.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

How to Symbolicate an Apple Silicon Panic?
 
 
Q