Hi, I am posting this question to both groups as it involves both drivers and kernel knowledge. I am working on a piece of COCOA code that writes data to disk at regular intervals. The data is written using a NSData object using the writeToFile:atomically method.The size of the file produced during the write operation varies between 100Kb and 5Mb and I typically produce 5 files/minute. Very often, I am getting a kernel panic during the write operation. It can happen after just 2 minutes of operation or at a later stage, say after an hour. It is much easier to get the panic when the writing is performed by a thread that is not the main thread. (I typically do the writing using a ThreadWorker). My test system is a Powerbook G4 (550Mhz) with 1.9Gb of free disk space. I *cannot* reproduce this problem on my G5 2x2Ghz. A sample panic log is shown below. ----------------------------- Unresolved kernel trap(cpu 0): 0x300 - Data access DAR=0x0000000000000078 PC=0x0000000000395D7C Latest crash info for cpu 0: Exception state (sv=0x26A03C80) PC=0x00395D7C; MSR=0x00009030; DAR=0x00000078; DSISR=0x42000000; LR=0x00395E94; R1=0x11EC3C60; XCP=0x0000000C (0x300 - Data access) Backtrace: 0x00395E68 0x00396A0C 0x003963D8 0x0039C244 0x0071EF64 0x00265CDC 0x00264BBC 0x00264B20 Kernel loadable modules in backtrace (with dependencies): com.apple.driver.KeyLargoATA(1.1.0f1)@0x71d000 dependency: com.apple.iokit.IOATAFamily(1.5.5f1)@0x390000 com.apple.iokit.IOATAFamily(1.5.5f1)@0x390000 Proceeding back via exception chain: Exception state (sv=0x26A03C80) previously dumped as "Latest" state. skipping... Exception state (sv=0x1F8F5000) PC=0x00000000; MSR=0x0000D030; DAR=0x00000000; DSISR=0x00000000; LR=0x00000000; R1=0x00000000; XCP=0x00000000 (Unknown) Kernel version: Darwin Kernel Version 7.4.0: Wed May 12 16:58:24 PDT 2004; root:xnu/xnu-517.7.7.obj~7/RELEASE_PPC panic(cpu 0): 0x300 - Data access Latest stack backtrace for cpu 0: Backtrace: 0x0008391C 0x00083E00 0x0001EDA4 0x00090E60 0x0009426C Proceeding back via exception chain: Exception state (sv=0x26A03C80) PC=0x00395D7C; MSR=0x00009030; DAR=0x00000078; DSISR=0x42000000; LR=0x00395E94; R1=0x11EC3C60; XCP=0x0000000C (0x300 - Data access) Backtrace: 0x00395E68 0x00396A0C 0x003963D8 0x0039C244 0x0071EF64 0x00265CDC 0x00264BBC 0x00264B20 Kernel loadable modules in backtrace (with dependencies): com.apple.driver.KeyLargoATA(1.1.0f1)@0x71d000 dependency: com.apple.iokit.IOATAFamily(1.5.5f1)@0x390000 com.apple.iokit.IOATAFamily(1.5.5f1)@0x390000 Exception state (sv=0x1F8F5000) PC=0x00000000; MSR=0x0000D030; DAR=0x00000000; DSISR=0x00000000; LR=0x00000000; R1=0x00000000; XCP=0x00000000 (Unknown) Kernel version: Darwin Kernel Version 7.4.0: Wed May 12 16:58:24 PDT 2004; root:xnu/xnu-517.7.7.obj~7/RELEASE_PPC ----------------------------- I have tried to interpret this log using instructions from Apple (TechNote 2063), but was only able to reconstitute the stacktrace, and it doesn't help me much. (gdb) x/i 0x395d7c 0x395d7c <IOATAController::dequeueFirstCommand()+48>: twnei r1,0 (gdb) x/i 0x395e68-4 0x395e64 <IOATAController::dispatchNext()+32>: .long 0x2745ec (gdb) x/i 0x396a0c-4 0x396a08 <IOATAController::asyncIO()+592>: .long 0x144f3 (gdb) x/i 0x3963d8-4 0x3963d4 <IOATAController::handleDeviceInterrupt()+64>: .long 0x2d7a98 (gdb) x/i 0x39c244-4 0x39c240 <MacIOATA::handleDeviceInterrupt()+120>: .long 0x21fb9 (gdb) x/i 0x0071ef64-4 0x71ef60 <KeyLargoATA::handleDeviceInterrupt()+108>: bctrl I would be grateful if someone could give me some advice on how to tackle this issue. My understanding, is that the Data Access error is probably due to a null pointer being dereferenced. Would this be a pointer in the driver code, or a pointer to one of my objects ? As for me, I have narrowed the problem to a single line of my code (the one that does the writing). Since the NSData that I write is pretty clean, I am a bit confused. I am also a bit confused by the fact that the problem is only exibited when running on powerbooks (have tried 2 so far). Thanks in advance, Matthieu _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.