1

我正在尝试从我们的服务器下载文件。我的代码基本上是这里列出的内容: Downloading a large file in iOS app

它每次大约在一半时崩溃。当我查看控制台时,我看到:

May  8 13:48:53 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.test) Bug: launchd_core_logic.c:3732 (25562):3
May  8 13:48:53 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.test) Assuming job exited: <rdar://problem/5020256>: 10: No child processes
May  8 13:48:53 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.test) Job appears to have crashed: Segmentation fault: 11
May  8 13:48:53 unknown com.apple.debugserver-64[1541] <Warning>: 1 [0605/1303]: error: ::read ( 4, 0x2809d4, 1024 ) => -1 err = Bad file descriptor (0x00000009)
May  8 13:48:53 unknown SpringBoard[15] <Warning>: Application 'TestDev' exited abnormally with signal 11: Segmentation fault: 11
May  8 13:48:53 unknown ReportCrash[1555] <Notice>: Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2012-05-08-134853.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
> 
May  8 13:50:53 unknown SpringBoard[15] <Notice>: Posting 'com.apple.iokit.hid.displayStatus' notifyState=0
May  8 13:50:53 unknown SpringBoard[15] <Notice>: MultitouchHID: detection mode: 0->255
May  8 13:50:53 unknown UserEventAgent[12] <Warning>: DEBUG: Changing screen blanked state: 1
May  8 13:50:54 unknown kernel[0] <Debug>: [000581.599475]: AppleDPDisplay::setLCDStateGated:(0x81d1eb40) Disabling
May  8 13:50:54 unknown kernel[0] <Debug>: [000000.000174]: AppleDPDisplay::terminateLink:(0x81d1eb40) Waited 0 ms for display to disable
May  8 13:50:54 unknown kernel[0] <Debug>: [000000.000025]: AppleDPDisplay::terminateLink:(0x81d1eb40) ret=0x00000000
May  8 13:50:54 unknown kernel[0] <Debug>: [000000.000759]: AppleDPDisplay::deviceTerminated:(0x81d1eb40) device=0x952a3a80
May  8 13:50:54 unknown kernel[0] <Debug>: [000000.000117]: AppleDPDisplay::setPower:(0x81d1eb40) enable=0 ret=0x00000000
May  8 13:50:54 unknown kernel[0] <Debug>: [000000.000024]: AppleDPDisplay::setLCDStateGated:(0x81d1eb40) enable=0 ret=0x00000000

我有 NSZombieEnabled,但我什么也没看到。当我关闭它时,我会遇到同样的崩溃。

在日志中,我看到

Count   resident pages
152534 (jettisoned) 

有什么想法吗?谢谢!

4

1 回答 1

0

这似乎是苹果的错误。

Apple 工程师在源代码 launchd_core_logic (http://opensource.apple.com/source/launchd/launchd-392.36/launchd/src/launchd_core_logic.c) 中的评论:

            /* We have to work around one of two kernel bugs here. ptrace(3) may
         * have abducted the child away from us and reparented it to the tracing
         * process. If the process then exits, we still get NOTE_EXIT, but we
         * cannot reap it because the kernel may not have restored the true
         * parent/child relationship in time.
         *
         * See <rdar://problem/5020256>.
         *
         * The other bug is if the shutdown monitor has suspended a task and not
         * resumed it before exiting. In this case, the kernel will not clean up
         * after the shutdown monitor. It will, instead, leave the task
         * task suspended and not process any pending signals on the event loop
         * for the task.
         *
         * There are a variety of other kernel bugs that could prevent a process
         * from exiting, usually having to do with faulty hardware or talking to
         * misbehaving drivers that mark a thread as uninterruptible and
         * deadlock/hang before unmarking it as such. So we have to work around
         * that too.
         *
         * See <rdar://problem/9284889&9359725>.
         */
于 2012-12-04T10:39:11.940 回答