Unknown exception and crash

守給你的承諾、 提交于 2019-12-05 16:27:31

Seems to me that it's dangling pointer, and you're sending message to it. As MikeD said, use breakpoint on exception if it can help. But it's not 100% reliable since you get a SIGSEGV and not a SIGABRT. And the exception throw is not really the cause of the crash, just a border effect.

Edit

Ok: In your log crash, it says that libsystem_kernel.dylib has crashed in a kevent call. That won't help you since this is private and opaque, and you can be 100% sure this lib do its job well. This can appears because you have used (unintentionally) a space memory where you should not write into. Like with a dangling pointer. Let's say you have allocated memory to 0x2000 and you have a pointer pointing to this memory, if you freed the memory but still using this pointer to this address, if someone else (like libsystem_kernel) use it, and you change some data in the same time (because of your dangling pointer). Then the other side will use data corrupted, and some random behavior will occur. That's why if you analyze literally your crash log, you'll do wrong statement. Because kevent from libSystem is stable.

By the way you have thread 1 who crashed, but look into thread 0, it was trying to raise an exception too, but it didn't get time to do it. This can occur because of data corrupted too.

That's why I recommend you to make another crash, and compare it to this one. If the crash log are the same, then i was totally wrong. If the crash log are different, this is a dangling pointer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!