gpt4 book ai didi

从互联网下载资源时 iOS 应用程序崩溃

转载 作者:行者123 更新时间:2023-12-01 21:38:12 25 4
gpt4 key购买 nike


我正在尝试调试一个从互联网下载大量资源的应用程序。问题是,有时下载应用程序会崩溃(不在同一位置或同一资源)。
内存看起来不错,没有内存警告,没有泄漏,没有僵尸,脏大小保持在 10M§B 左右+o- 2MB 居民 50MB。
其他奇怪的事情是,该错误仍然从未发生在模拟器上,而只是发生在设备上。
崩溃日志标识了 Apple 库上另一个线程 (num3) 中的崩溃,其中包含 EXC_BAD_ACCES(某些内容消失了)。我无法理解这是应用程序错误还是 API 错误。

Incident Identifier: 9138742F-0160-4220-8E62-000001650CF4 CrashReporter Key: 6f0ba5a6bbc182f6798918f01ccd6bac4f8e4713 Hardware Model: iPad1,1 Process: XXX-Upgraded [949] Path:
/var/mobile/Applications/C98657F3-B7E6-4542-B0DA-70D8239E5210/XXX-Upgraded.app/XXX-Upgraded Identifier: XXX-Upgraded Version: ??? (???) Code Type:
ARM (Native) Parent Process: launchd 1

Date/Time: 2011-11-18 11:13:25.994 +0100 OS Version: iPhone OS 5.0.1 (9A405) Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0xf006191c Crashed Thread: 3

Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0: 0
libsystem_kernel.dylib 0x360ad010 0x360ac000 + 4112 1
libsystem_kernel.dylib 0x360ad206 0x360ac000 + 4614 2
CoreFoundation 0x33ac441c 0x33a37000 + 578588 3
CoreFoundation 0x33ac311a 0x33a37000 + 573722 4
CoreFoundation 0x33a464d6 0x33a37000 + 62678 5
CoreFoundation 0x33a4639e 0x33a37000 + 62366 6
GraphicsServices 0x35686fc6 0x35683000 + 16326 7 UIKit 0x34b8b73c 0x34b5a000 + 202556 8 XXX-Upgraded
0x000028a8 main (main.m:15) 9 XXX-Upgraded
0x00002860 start + 32

Thread 1 name: Dispatch queue: com.apple.libdispatch-manager Thread 1: 0 libsystem_kernel.dylib 0x360ad3b4 0x360ac000 + 5044 1
libdispatch.dylib 0x36dd3e78 0x36dc7000 + 52856 2
libdispatch.dylib 0x36dd3b96 0x36dc7000 + 52118

Thread 2 name: WebThread Thread 2: 0 libsystem_kernel.dylib
0x360ad010 0x360ac000 + 4112 1 libsystem_kernel.dylib
0x360ad206 0x360ac000 + 4614 2 CoreFoundation
0x33ac441c 0x33a37000 + 578588 3 CoreFoundation
0x33ac3154 0x33a37000 + 573780 4 CoreFoundation
0x33a464d6 0x33a37000 + 62678 5 CoreFoundation
0x33a4639e 0x33a37000 + 62366 6 WebCore
0x33f02128 0x33e5a000 + 688424 7 libsystem_c.dylib
0x3492bc16 0x3491c000 + 64534 8 libsystem_c.dylib
0x3492bad0 0x3491c000 + 64208

Thread 3 name: com.apple.NSURLConnectionLoader Thread 3 Crashed: 0
libobjc.A.dylib 0x35206fbc 0x35203000 + 16316 1
CoreFoundation 0x33a73d16 0x33a37000 + 249110 2
CoreFoundation 0x33a395bc 0x33a37000 + 9660 3
CFNetwork 0x32e56fd8 0x32dc7000 + 589784 4
CFNetwork 0x32e57cee 0x32dc7000 + 593134 5
CFNetwork 0x32e56940 0x32dc7000 + 588096 6
CoreFoundation 0x33a8555c 0x33a37000 + 320860 7
CoreFoundation 0x33a857a4 0x33a37000 + 321444 8
CoreFoundation 0x33ac4afc 0x33a37000 + 580348 9
CoreFoundation 0x33ac42c8 0x33a37000 + 578248 10 CoreFoundation 0x33ac306e 0x33a37000 + 573550 11 CoreFoundation 0x33a464d6 0x33a37000 + 62678 12 CoreFoundation 0x33a4639e 0x33a37000 + 62366 13 Foundation 0x3152abc2 0x3151a000 + 68546 14 Foundation 0x3152aa8a 0x3151a000 + 68234 15 Foundation 0x315be59a 0x3151a000 + 673178 16 libsystem_c.dylib 0x3492bc16 0x3491c000 + 64534 17 libsystem_c.dylib 0x3492bad0 0x3491c000 + 64208

Thread 4 name: com.apple.CFSocket.private Thread 4: 0
libsystem_kernel.dylib 0x360bd570 0x360ac000 + 71024 1
CoreFoundation 0x33ac866a 0x33a37000 + 595562 2
libsystem_c.dylib 0x3492bc16 0x3491c000 + 64534 3
libsystem_c.dylib 0x3492bad0 0x3491c000 + 64208

Thread 5: 0 libsystem_kernel.dylib 0x360bdcd4 0x360ac000 + 72916 1 libsystem_c.dylib 0x3492630a 0x3491c000 + 41738 2 libsystem_c.dylib 0x3492609c 0x3491c000 + 41116

Thread 6: 0 libsystem_kernel.dylib 0x360bdcd4 0x360ac000 + 72916 1 libsystem_c.dylib 0x3492630a 0x3491c000 + 41738 2 libsystem_c.dylib 0x3492609c 0x3491c000 + 41116

Thread 7: 0 libsystem_kernel.dylib 0x360bdcd4 0x360ac000 + 72916 1 libsystem_c.dylib 0x3492630a 0x3491c000 + 41738 2 libsystem_c.dylib 0x3492609c 0x3491c000 + 41116

Thread 3 crashed with ARM Thread State: r0: 0x006eaf90 r1: 0x328c119e r2: 0xf0061914 r3: 0x3eeb09a8 r4: 0xf0061914 r5: 0x006eaf94 r6: 0x020014c0 r7: 0x0343b2b0 r8: 0x3eecc690 r9: 0x0ca30467 r10: 0x00000014 r11: 0x00000080 ip: 0x3eea6814 sp: 0x0343b2a0 lr: 0x33a73d1d pc: 0x35206fbc cpsr: 0x20000030

[更新]
最后我通过电缆发现了错误。它似乎是在连接结束时过度释放的数据 block :didReceiveData:。实际上,为了简化调试,我只留下了一行使用输出流附加数据的代码。我不明白我哪里过度释放了。
仪器显示出非常奇怪的东西:
-首先,僵尸似乎是在某些 Apple API 调用中创建的
- 其次,如果您查看堆栈跟踪的图像,您可以看到有一个 CFRetain 不会增加对象的引用计数,从而不平衡其他操作
SS from instruments

有人可以帮我吗?
谢谢,
安德里亚

最佳答案

好的,
经过大量测试(Apple 从未负责 DST 请求,不再真实),头痛,歇斯底里等。事实证明这是一种误报。如果我使用泄漏、分配、僵尸进行测试,则会发生通常的控制台调试器。如果我仅在设备上单独运行应用程序(不连接它),一切似乎都运行良好。

DTS帮我找到了这个bug,这个问题可能涉及两个bug,一个位于instruments中,一个位于CF中。最重要的是,这些错误仅在使用分配日志记录时影响应用程序,因此正如我在测试 session 期间发现的那样,应用程序可以安全运行。

关于从互联网下载资源时 iOS 应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8181796/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com