Kernel panic in waitq.c

I have some code that fires off lots of NSURLSessionTasks. Each task does a litle procesing on the returned data and saves the results to Core Data. It works well on 32-bit devices but causes a kernel panic on 64-bit devices, both an iPhone 6 and the Simulator on a Mac. (I think I never saw this on Yosemite but I can't be 100% sure.)


Question: how best to get to the bottom of what's causing it? Is there a better option than spending my whole afternoon crashing and rebooting?


On the offchance that this is a known problem, here is the panic report:


*** Panic Report ***
panic(cpu 2 caller 0xffffff80067207f3): "Valid/unreserved element 0xffffff8022f4e940 (0xa0000000) in reserved list"@/Library/Caches/com.apple.xbs/Sources/xnu/xnu-3247.10.11/osfmk/kern/waitq.c:962
Backtrace (CPU 2), Frame : Return Address
0xffffff810918bcf0 : 0xffffff80066e5307 
0xffffff810918bd70 : 0xffffff80067207f3 
0xffffff810918bdc0 : 0xffffff80066d1060 
0xffffff810918be10 : 0xffffff80066d0c57 
0xffffff810918be60 : 0xffffff80066cd4f9 
0xffffff810918bea0 : 0xffffff80066dcfd5 
0xffffff810918bf10 : 0xffffff80067c13aa 
0xffffff810918bfb0 : 0xffffff80067f4b36
Answered by DTS Engineer in 83276022

yup, the Simulator panics the Mac!

Oi vey!

AFAICT this is known bug in the OS X kernel (r. 22300620). We believe it’s fixed in the current 10.11.2 beta seed. Try installing that and, if you still have the problem, report a new bug about it.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

It works well on 32-bit devices but causes a kernel panic on 64-bit devices, both an iPhone 6 and the Simulator on a Mac.

The simulator panics the Mac? Well, that’s not good.

On the offchance that this is a known problem, here is the panic report:

That’s a pretty truncated panic log. A full log should look more like the one posted in this thread. If you post a full log, I can take a look.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thanks for your reply -- yup, the Simulator panics the Mac! Here's the full log:


Anonymous UUID: CDF90ACB-37F5-FB9F-4A81-70CF2F4D26B1

Sat Oct 24 11:16:51 2015

*** Panic Report ***

panic(cpu 2 caller 0xffffff80067207f3): "Valid/unreserved element 0xffffff8022f4e940 (0xa0000000) in reserved list"@/Library/Caches/com.apple.xbs/Sources/xnu/xnu-3247.10.11/osfmk/kern/waitq.c:962

Backtrace (CPU 2), Frame : Return Address

0xffffff810918bcf0 : 0xffffff80066e5307

0xffffff810918bd70 : 0xffffff80067207f3

0xffffff810918bdc0 : 0xffffff80066d1060

0xffffff810918be10 : 0xffffff80066d0c57

0xffffff810918be60 : 0xffffff80066cd4f9

0xffffff810918bea0 : 0xffffff80066dcfd5

0xffffff810918bf10 : 0xffffff80067c13aa

0xffffff810918bfb0 : 0xffffff80067f4b36

BSD process name corresponding to current thread: Xcode

Mac OS version:

15B42

Kernel version:

Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_64

Kernel UUID: AB5FC1B4-12E7-311E-8E6F-9023985D8C1D

Kernel slide: 0x0000000006400000

Kernel text base: 0xffffff8006600000

__HIB text base: 0xffffff8006500000

System model name: MacBookPro8,2 (Mac-94245A3940C91C80)

System uptime in nanoseconds: 1147910602572

last loaded kext at 7234563576: com.apple.driver.AudioAUUC 1.70 (addr 0xffffff7f888dc000, size 32768)

last unloaded kext at 131742604797: com.apple.driver.usb.AppleUSBUHCI 1.0.1 (addr 0xffffff7f876b9000, size 126976)

loaded kexts:

com.apple.driver.AudioAUUC 1.70

com.apple.driver.AppleHWSensor 1.9.5d0

com.apple.filesystems.autofs 3.0

com.apple.driver.pmtelemetry 1

com.apple.iokit.IOUserEthernet 1.0.1

com.apple.iokit.IOBluetoothSerialManager 4.4.2f1

com.apple.Dont_Steal_Mac_OS_X 7.0.0

com.apple.driver.AppleHV 1

com.apple.driver.AGPM 110.20.21

com.apple.driver.AppleOSXWatchdog 1

com.apple.driver.AppleMikeyHIDDriver 124

com.apple.driver.AppleMikeyDriver 272.50.31

com.apple.driver.AppleUpstreamUserClient 3.6.1

com.apple.kext.AMDFramebuffer 1.3.8

com.apple.driver.AppleHDA 272.50.31

com.apple.AMDRadeonX3000 1.3.8

com.apple.driver.AppleIntelHD3000Graphics 10.0.0

com.apple.driver.AppleSMCLMU 208

com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport 4.4.2f1

com.apple.driver.AppleSMCPDRC 1.0.0

com.apple.driver.AppleLPC 3.1

com.apple.kext.AMD6000Controller 1.3.8

com.apple.driver.SMCMotionSensor 3.0.4d1

com.apple.driver.AppleMuxControl 3.11.33b1

com.apple.driver.ACPI_SMC_PlatformPlugin 1.0.0

com.apple.driver.AppleMCCSControl 1.2.13

com.apple.driver.AppleIntelSlowAdaptiveClocking 4.0.0

com.apple.driver.AppleThunderboltIP 3.0.8

com.apple.driver.AppleIntelSNBGraphicsFB 10.0.0

com.apple.driver.AppleUSBTCButtons 245.4

com.apple.driver.AppleUSBTCKeyboard 245.4

com.apple.driver.AppleIRController 327.5

com.apple.AppleFSCompression.AppleFSCompressionTypeDataless 1.0.0d1

com.apple.AppleFSCompression.AppleFSCompressionTypeZlib 1.0.0

com.apple.BootCache 37

com.apple.iokit.SCSITaskUserClient 3.7.7

com.apple.iokit.IOAHCIBlockStorage 2.8.0

com.apple.driver.AirPort.Brcm4331 800.20.24

com.apple.driver.AppleSDXC 1.7.0

com.apple.iokit.AppleBCM5701Ethernet 10.1.11

com.apple.driver.AppleFWOHCI 5.5.2

com.apple.driver.usb.AppleUSBEHCIPCI 1.0.1

com.apple.driver.AppleAHCIPort 3.1.5

com.apple.driver.AppleSmartBatteryManager 161.0.0

com.apple.driver.AppleACPIButtons 4.0

com.apple.driver.AppleRTC 2.0

com.apple.driver.AppleHPET 1.8

com.apple.driver.AppleSMBIOS 2.1

com.apple.driver.AppleACPIEC 4.0

com.apple.driver.AppleAPIC 1.7

com.apple.driver.AppleIntelCPUPowerManagementClient 218.0.0

com.apple.nke.applicationfirewall 163

com.apple.security.quarantine 3

com.apple.security.TMSafetyNet 8

com.apple.driver.AppleIntelCPUPowerManagement 218.0.0

com.apple.kext.triggers 1.0

com.apple.iokit.IOSurface 108.0.1

com.apple.iokit.IOSerialFamily 11

com.apple.driver.CoreCaptureResponder 1

com.apple.driver.DspFuncLib 272.50.31

com.apple.kext.OSvKernDSPLib 525

com.apple.iokit.IOAcceleratorFamily2 203.10

com.apple.iokit.IOBluetoothHostControllerUSBTransport 4.4.2f1

com.apple.iokit.IOBluetoothFamily 4.4.2f1

com.apple.driver.AppleHDAController 272.50.31

com.apple.iokit.IOHDAFamily 272.50.31

com.apple.iokit.IOAudioFamily 204.1

com.apple.vecLib.kext 1.2.0

com.apple.driver.AppleSMBusPCI 1.0.14d1

com.apple.kext.AMDSupport 1.3.8

com.apple.AppleGraphicsDeviceControl 3.11.33b1

com.apple.iokit.IOFireWireIP 2.2.6

com.apple.driver.AppleBacklightExpert 1.1.0

com.apple.iokit.IONDRVSupport 2.4.1

com.apple.driver.AppleGraphicsControl 3.11.33b1

com.apple.driver.IOPlatformPluginLegacy 1.0.0

com.apple.driver.IOPlatformPluginFamily 6.0.0d7

com.apple.driver.AppleSMC 3.1.9

com.apple.driver.AppleSMBusController 1.0.14d1

com.apple.iokit.IOSlowAdaptiveClockingFamily 1.0.0

com.apple.iokit.IOGraphicsFamily 2.4.1

com.apple.driver.AppleUSBMultitouch 250.4

com.apple.iokit.IOUSBHIDDriver 900.4.1

com.apple.driver.usb.AppleUSBHostCompositeDevice 1.0.1

com.apple.driver.usb.AppleUSBHub 1.0.1

com.apple.driver.CoreStorage 517

com.apple.iokit.IOSCSIMultimediaCommandsDevice 3.7.7

com.apple.iokit.IOBDStorageFamily 1.8

com.apple.iokit.IODVDStorageFamily 1.8

com.apple.iokit.IOCDStorageFamily 1.8

com.apple.driver.AppleThunderboltDPInAdapter 4.1.2

com.apple.driver.AppleThunderboltDPAdapterFamily 4.1.2

com.apple.driver.AppleThunderboltPCIDownAdapter 2.0.2

com.apple.iokit.IOAHCISerialATAPI 2.6.2

com.apple.iokit.IOSCSIArchitectureModelFamily 3.7.7

com.apple.driver.AppleThunderboltNHI 4.0.4

com.apple.iokit.IOThunderboltFamily 5.0.6

com.apple.iokit.IOEthernetAVBController 1.0.3b3

com.apple.iokit.IO80211Family 1101.24

com.apple.driver.mDNSOffloadUserClient 1.0.1b8

com.apple.iokit.IONetworkingFamily 3.2

com.apple.driver.corecapture 1.0.4

com.apple.iokit.IOFireWireFamily 4.5.8

com.apple.iokit.IOUSBFamily 900.4.1

com.apple.iokit.IOAHCIFamily 2.8.0

com.apple.driver.usb.AppleUSBEHCI 1.0.1

com.apple.iokit.IOUSBHostFamily 1.0.1

com.apple.driver.AppleUSBHostMergeProperties 1.0.1

com.apple.driver.AppleEFINVRAM 2.0

com.apple.driver.AppleEFIRuntime 2.0

com.apple.iokit.IOHIDFamily 2.0.0

com.apple.iokit.IOSMBusFamily 1.1

com.apple.security.sandbox 300.0

com.apple.kext.AppleMatch 1.0.0d1

com.apple.driver.AppleKeyStore 2

com.apple.driver.AppleMobileFileIntegrity 1.0.5

com.apple.driver.AppleCredentialManager 1.0

com.apple.driver.DiskImages 415

com.apple.iokit.IOStorageFamily 2.1

com.apple.iokit.IOReportFamily 31

com.apple.driver.AppleFDEKeyStore 28.30

com.apple.driver.AppleACPIPlatform 4.0

com.apple.iokit.IOPCIFamily 2.9

com.apple.iokit.IOACPIFamily 1.4

com.apple.kec.Libm 1

com.apple.kec.pthread 1

com.apple.kec.corecrypto 1.0

Model: MacBookPro8,2, BootROM MBP81.0047.B29, 4 processors, Intel Core i7, 2 GHz, 8 GB, SMC 1.69f4

Graphics: Intel HD Graphics 3000, Intel HD Graphics 3000, Built-In

Graphics: AMD Radeon HD 6490M, AMD Radeon HD 6490M, PCIe, 256 MB

Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1333 MHz, 0x80CE, 0x4D34373142353237334348302D4348392020

Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1333 MHz, 0x80CE, 0x4D34373142353237334348302D4348392020

AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0xD6), Broadcom BCM43xx 1.0 (5.106.98.100.24)

Bluetooth: Version 4.4.2f1 16391, 3 services, 27 devices, 1 incoming serial ports

Network Service: AirPort, AirPort, en1

Serial ATA Device: Crucial_CT480M500SSD1, 480.1 GB

Serial ATA Device: MATSHITADVD-R UJ-898

USB Device: USB 2.0 Bus

USB Device: Hub

USB Device: IR Receiver

USB Device: USB 2.0 Bus

USB Device: FaceTime HD Camera (Built-in)

USB Device: Hub

USB Device: Apple Internal Keyboard / Trackpad

USB Device: BRCM2070 Hub

USB Device: Bluetooth USB Host Controller

Thunderbolt Bus: MacBook Pro, Apple Inc., 22.1

Accepted Answer

yup, the Simulator panics the Mac!

Oi vey!

AFAICT this is known bug in the OS X kernel (r. 22300620). We believe it’s fixed in the current 10.11.2 beta seed. Try installing that and, if you still have the problem, report a new bug about it.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

That's great, I'll check when I get the chance -- I don't normally run beta OS X's but this is definately worth an exception.


Will the same update also be in iOS 9.2?

Will the same update also be in iOS 9.2?

The fix will make it to iOS eventually; I don’t have any info on when that’ll be.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Good news: that seems to fix it on OS X. I just need to wait until it's also fixed on iOS before releasing it... Thanks for your help.

I have the same problem. I can reproduce it easily by firing up firefox and going to a flash heavy site. It usually takes a matter of seconds to crash my mac. The crash also happens randomly too and isn't necessarily related to just firefox and flash. I've reproduced the problem when running 10.11.1 in safe mode. I also installed 10.11.0 on a USB stick and could reproduce the problem there too.


In addition to the


Valid/unreserved element (0xa0000000) in reserved list


error I am also get this:

panic(cpu 0 caller 0xffffff801d522ae0): "Invalid element for id:0x3ffff"@/Library/Caches/com.apple.xbs/Sources/xnu/xnu-3247.1.106/osfmk/kern/waitq.c:950


I can confirm that the problem is indeed fixed in 10.11.2 beta4. I ran the same firefox+flash test and it was stable for at least 30 minutes. Thanks eskimo!

I got a bit further in the diagnosis. I installed El Capitan from scratch on an older early 2011 Mac and managed to reproduce the problem. I also ran elaborate hardware tests in an apple store on my original back, which came back fine. I finally upgraded my main Mac to the 10.11.2 beta5 version since it was crashing 20 times a day and making my work difficult.

I'm looking forward to seeing the change on github that fixed the error. I'm surprised this hasn't gone noticed by a wider audience.

I just tested this in iOS 9.2 and it appears to be fixed there, too. Great news!

Kernel panic in waitq.c
 
 
Q