Crash of Garbage Collection Work Queue if dylib is loaded

删除回忆录丶 提交于 2019-12-05 00:23:09
It is expected. 
Starting with OSX 10.8, Garbage collection is deprecated. So CG is unable to suspend the threads to perform its duty. As a result you get all the issues you are facing.

If you want to develop for 10.8, you need to convert to ARC (best) or move back to manual reference counting. If you wish to move to arc, see Transitioning to ARC Release Notes

From Apple documentation about 10.8:

Important: Beginning in OS X v10.8, garbage collection is deprecated. Use ARC (Automatic Reference Counting) instead. To learn more about ARC, see Transitioning to ARC Release Notes.

https://books.google.co.in/books?id=8nzwsciij20C&pg=PT431&lpg=PT431&dq=Crash+of+Garbage+Collection+Work+in+objective+c&source=bl&ots=xTjLETFMsO&sig=b33rLeXJVh1WtnAvcVJykfNtvOU&hl=en&sa=X&ved=0ahUKEwiyqZrC2rvNAhVKNI8KHZRdC7AQ6AEIKDAC#v=onepage&q=Crash%20of%20Garbage%20Collection%20Work%20in%20objective%20c&f=false

We are porting an app from 10.6 to 10.8. Reason for crash turns out to be that garbage collector is not able to suspend the thread.

It is expected.
Starting with OSX 10.8, Garbage collection is deprecated. So CG is unable to suspend the threads to perform its duty. As a result you get all the issues you are facing.

If you want to develop for 10.8, you need to convert to ARC (best) or move back to manual reference counting. If you wish to move to arc, see Transitioning to ARC Release Notes


From Apple documentation about 10.8:

Important: Beginning in OS X v10.8, garbage collection is deprecated. Use ARC (Automatic Reference Counting) instead. To learn more about ARC, see Transitioning to ARC Release Notes.

Source: What's new in OS X v10.8 Mountain Lion:

Answers:

  • Is their a way to tell garbage collector not to try and suspend the thread?

No. That's how it works.

  • Or to increase reference count of thread? Or anything I can do to stop garbage collector not to interfere with my dylib code.

No. Since GC is deprecated under 10.8, sou have to get rid of it if you wish to support 10.8.

GC has been a really short-lived technology on the MAC platform. And replaced by ARC for various reasons.

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