johnno1962 / SwiftTrace

Trace Swift and Objective-C method invocations
Other
709 stars 52 forks source link

__ARCLite__ issue #2

Closed inamiy closed 8 years ago

inamiy commented 8 years ago

This may be a project-dependent issue, but I got a following __ARCLite__ error:

2016-06-10 19:51:14.632 MyApp[60920:738362] *** NSForwarding: warning: object 0x10cf23718 of class '__ARCLite__' does not implement methodSignatureForSelector: -- trouble ahead
2016-06-10 19:51:14.632 MyApp[60920:738362] *** NSForwarding: warning: object 0x10cf23718 of class '__ARCLite__' does not implement doesNotRecognizeSelector: -- abort

It seems skipping traces of __ARCLite__ class is necessary. Or, is there any good alternative on this?

johnno1962 commented 8 years ago

Interesting, can you send through an example project to swift trace at johnholdsworth.com or experiment with adding it to the exclusions regexp?

inamiy commented 8 years ago

__ARCLite__ class is somehow picked by objc_copyClassList and causes runtime crash at traceObjcClass( object_getClass( aClass ), which:"+"). Because class func valid() is called afterwards, SwiftTrace.exclude() didn't help to work around.

I will try reproducing with simple demo (current code is not shareable)

johnno1962 commented 8 years ago

I’ve pushed a change to exclude __ARCLite__, can you give it a try?

inamiy commented 8 years ago

Thanks, it now looks good 🎉 https://github.com/johnno1962/SwiftTrace/commit/6b8f29838cc65abfe920731a807dc1dbf0a74321#diff-6bb45fad74b9c5fba792b9d017cf21faR157

johnno1962 commented 8 years ago

I’ve pushed an update that fixes the ARM64 trampoline. You may want to update.