IQKeyboardManager icon indicating copy to clipboard operation
IQKeyboardManager copied to clipboard

[IQToolbar release] crash ---- zoombie object issue

Open JimmyGoGoGo opened this issue 8 years ago • 20 comments

Xcode: 9.4.1 & 10.0 Simulator/Device: iPhone7 Plus Library Version: 6.1.1 & 6.2.0

it's well on iOS12, iOS11

Every time app launch, it crash. have any idea to solve this issue? THANK YOU!

JimmyGoGoGo avatar Oct 09 '18 10:10 JimmyGoGoGo

No idea, please share a demo project.

hackiftekhar avatar Oct 09 '18 15:10 hackiftekhar

@hackiftekhar No specified, but same thing happened with IQKeyboardManager Demo(Swift & ObjC) Project on iPhone7 Plus/ iOS10.1.
What is the most difficult thing is that the bug will only take place on device but not simulators.

JimmyGoGoGo avatar Oct 11 '18 06:10 JimmyGoGoGo

@hackiftekhar I made some progress: 1.swift project must not use IQKeyboardManager of ObjC version 2.IQKeyboardManager.shared().disabledToolbarClasses.add must not use in submodule

JimmyGoGoGo avatar Oct 17 '18 02:10 JimmyGoGoGo

Jimmy, how did you solve?

krymtn avatar Nov 22 '18 12:11 krymtn

@hackiftekhar this is the issue *** -[IQKeyboardManagerSwift.IQToolbar release]: message sent to deallocated instance

krymtn avatar Nov 22 '18 12:11 krymtn

There might be issue with this but I'm unable to reproduce this. Can someone send me the crash log?

hackiftekhar avatar Nov 22 '18 13:11 hackiftekhar

Incident Identifier: 69C71116-E4E9-46B2-A1A1-8F1EDCD330EC
CrashReporter Key:   c2389537688775a05e89654010c94a2d3e4e8c38
Hardware Model:      iPhone9,3
Process:             Demo [974]
Version:             1 (1.0)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]

Date/Time:           2018-12-25 17:23:52.0982 +0300
Launch Time:         2018-12-25 17:23:51.9245 +0300
OS Version:          iPhone OS 10.3.1 (14E304)
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000020
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
Triggered by Thread:  0

Filtered syslog:
None found

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib               	0x00000001828d97f4 objc_object::release+ 153588 () + 8
1   CoreFoundation                	0x0000000183d3aa70 -[__NSArrayI dealloc] + 84
2   libobjc.A.dylib               	0x00000001828da134 (anonymous namespace)::AutoreleasePoolPage::pop+ 155956 (void*) + 836
3   FrontBoardServices            	0x0000000185a0388c __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 44
4   FrontBoardServices            	0x0000000185a036f0 -[FBSSerialQueue _performNext] + 176
5   FrontBoardServices            	0x0000000185a03aa0 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
6   CoreFoundation                	0x0000000183e09424 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
7   CoreFoundation                	0x0000000183e08d94 __CFRunLoopDoSources0 + 540
8   CoreFoundation                	0x0000000183e069a0 __CFRunLoopRun + 744
9   CoreFoundation                	0x0000000183d36d94 CFRunLoopRunSpecific + 424
10  UIKit                         	0x0000000189ff445c -[UIApplication _run] + 652
11  UIKit                         	0x0000000189fef130 UIApplicationMain + 208
12  MicroFrucht                   	0x000000010014461c 0x100000000 + 1328668
13  libdyld.dylib                 	0x0000000182d4559c start + 4

Thread 1:
0   libsystem_pthread.dylib       	0x0000000182f1ad78 start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib       	0x0000000182f1ad78 start_wqthread + 0

Thread 3:
0   libsystem_kernel.dylib        	0x0000000182e55a88 __workq_kernreturn + 8
1   libsystem_pthread.dylib       	0x0000000182f1b274 _pthread_wqthread + 1260
2   libsystem_pthread.dylib       	0x0000000182f1ad7c start_wqthread + 4

Thread 4:
0   libsystem_pthread.dylib       	0x0000000182f1ad78 start_wqthread + 0

Thread 5:
0   libsystem_pthread.dylib       	0x0000000182f1ad78 start_wqthread + 0

Thread 6 name:  com.apple.uikit.eventfetch-thread
Thread 6:
0   libsystem_kernel.dylib        	0x0000000182e37224 mach_msg_trap + 8
1   libsystem_kernel.dylib        	0x0000000182e3709c mach_msg + 72
2   CoreFoundation                	0x0000000183e08e88 __CFRunLoopServiceMachPort + 192
3   CoreFoundation                	0x0000000183e06adc __CFRunLoopRun + 1060
4   CoreFoundation                	0x0000000183d36d94 CFRunLoopRunSpecific + 424
5   Foundation                    	0x0000000184850d64 -[NSRunLoop+ 52580 (NSRunLoop) runMode:beforeDate:] + 304
6   Foundation                    	0x0000000184871b34 -[NSRunLoop+ 187188 (NSRunLoop) runUntilDate:] + 96
7   UIKit                         	0x000000018a9795f8 -[UIEventFetcher threadMain] + 136
8   Foundation                    	0x000000018494e2c8 __NSThread__start__ + 996
9   libsystem_pthread.dylib       	0x0000000182f1d75c _pthread_body + 240
10  libsystem_pthread.dylib       	0x0000000182f1d66c _pthread_body + 0
11  libsystem_pthread.dylib       	0x0000000182f1ad84 thread_start + 4

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000101b28310   x1: 0x000000018aac8703   x2: 0x0000000000000008   x3: 0x0000000182e9b2c0
    x4: 0x000000000000002b   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000000000000850
    x8: 0x0000000000000000   x9: 0x000000018aac8703  x10: 0x0000000102804000  x11: 0x000000130000003f
   x12: 0x0000000102804030  x13: 0x000009a1a9fa2779  x14: 0x0000000000000000  x15: 0x0000000000000000
   x16: 0x00000001a9fa2778  x17: 0x0000000183d3aa1c  x18: 0x0000000000000000  x19: 0x0000000170026e20
   x20: 0x0000000000000002  x21: 0x0000000170026e30  x22: 0x00000001a9f9dc20  x23: 0x00000000a1a1a1a1
   x24: 0xa3a3a3a3a3a3a3a3  x25: 0x0000000000003803  x26: 0x00000001a9fae1fa  x27: 0x00000001a8a3dffc
   x28: 0x0000000000000001   fp: 0x000000016fdfe780   lr: 0x0000000183d3aa70
    sp: 0x000000016fdfe750   pc: 0x00000001828d97f4 cpsr: 0x20000000

krymtn avatar Dec 28 '18 08:12 krymtn

Upgraded to 6.2.0 but still the same problem on iOS 10 devices @hackiftekhar

krymtn avatar Dec 28 '18 08:12 krymtn

@krymtn I'm not seeing library calls (IQToolbar.release)in crash log. This is some other crash I believe.

hackiftekhar avatar Dec 30 '18 02:12 hackiftekhar

When I edit the scheme with the zombie object, Xcode console throws *** -[IQKeyboardManagerSwift.IQToolbar release]: message sent to deallocated instance

I tested again with v6.2.0 on my iOS10 iPhone. The result is the same. Its directly crashed on IQKeyboardManager.shared.enable = true in AppDelegate.

Incident Identifier: 6FCCDB21-7435-459A-9061-07938F232DF8
CrashReporter Key:   31AE3CF1-C3A9-42CD-AF6A-F4FDA55FFB2A
Hardware Model:      iPhone9,3
Version:         1.2 (6)
Code Type:       ARM-64
Parent Process:  ??? [1]

Date/Time:       2018-12-30T14:54:05Z
Launch Time:     2018-12-30T14:54:05Z
OS Version:      iPhone OS 10.3.1 (14E304)
Report Version:  104

Exception Type:  SIGSEGV
Exception Codes: SEGV_ACCERR at 0x20
Crashed Thread:  0

Application Specific Information:
Selector name found in current argument registers: dealloc

Thread 0 Crashed:
0   libobjc.A.dylib                      0x00000001828d97f4 objc_object::release() + 8
1   CoreFoundation                       0x0000000183d3aa70 -[__NSArrayI dealloc] + 80
2   libobjc.A.dylib                      0x00000001828da134 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 832
3   FrontBoardServices                   0x0000000185a0388c __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
4   FrontBoardServices                   0x0000000185a036f0 -[FBSSerialQueue _performNext] + 172
5   FrontBoardServices                   0x0000000185a03aa0 -[FBSSerialQueue _performNextFromRunLoopSource] + 52
6   CoreFoundation                       0x0000000183e09424 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 20
7   CoreFoundation                       0x0000000183e08d94 __CFRunLoopDoSources0 + 536
8   CoreFoundation                       0x0000000183e069a0 __CFRunLoopRun + 740
9   CoreFoundation                       0x0000000183d36d94 CFRunLoopRunSpecific + 420
10  UIKit                                0x0000000189ff445c -[UIApplication _run] + 648
11  UIKit                                0x0000000189fef130 UIApplicationMain + 204
12  TwenteBOA                            0x00000001000cb580 main (AppDelegate.swift:43)
13  libdyld.dylib                        0x0000000182d4559c start + 0

Thread 1:
0   libsystem_kernel.dylib               0x0000000182e55a88 __workq_kernreturn + 8
1   libsystem_pthread.dylib              0x0000000182f1ad7c start_wqthread + 0

Thread 2:
0   libsystem_kernel.dylib               0x0000000182e55a88 __workq_kernreturn + 8
1   libsystem_pthread.dylib              0x0000000182f1ad7c start_wqthread + 0

Thread 3:
0   libsystem_kernel.dylib               0x0000000182e55a88 __workq_kernreturn + 8
1   libsystem_pthread.dylib              0x0000000182f1ad7c start_wqthread + 0

Thread 4:
0   libsystem_kernel.dylib               0x0000000182e55a88 __workq_kernreturn + 8
1   libsystem_pthread.dylib              0x0000000182f1ad7c start_wqthread + 0

Thread 5:
0   libsystem_kernel.dylib               0x0000000182e55a88 __workq_kernreturn + 8
1   libsystem_pthread.dylib              0x0000000182f1ad7c start_wqthread + 0

Thread 6:
0   libsystem_kernel.dylib               0x0000000182e37224 mach_msg_trap + 8
1   CoreFoundation                       0x0000000183e08e88 __CFRunLoopServiceMachPort + 188
2   CoreFoundation                       0x0000000183e06adc __CFRunLoopRun + 1056
3   CoreFoundation                       0x0000000183d36d94 CFRunLoopRunSpecific + 420
4   Foundation                           0x0000000184850d64 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
5   Foundation                           0x0000000184871b34 -[NSRunLoop(NSRunLoop) runUntilDate:] + 92
6   UIKit                                0x000000018a9795f8 -[UIEventFetcher threadMain] + 132
7   Foundation                           0x000000018494e2c8 __NSThread__start__ + 992
8   libsystem_pthread.dylib              0x0000000182f1d75c _pthread_body + 236
9   libsystem_pthread.dylib              0x0000000182f1d66c _pthread_start + 280
10  libsystem_pthread.dylib              0x0000000182f1ad84 thread_start + 0

Thread 0 crashed with ARM-64 Thread State:
    pc: 0x00000001828d97f4     fp: 0x000000016fd3a7b0     sp: 0x000000016fd3a780     x0: 0x0000000101617420 
    x1: 0x000000018aac8703     x2: 0x0000000000000008     x3: 0x0000000182e9b2c0     x4: 0x000000000000002b 
    x5: 0x0000000000000000     x6: 0x0000000000000000     x7: 0x0000000000000850     x8: 0x0000000000000000 
    x9: 0x000000018aac8703    x10: 0x00000001016113f0    x11: 0x000000120000001f    x12: 0x0000000101611410 
   x13: 0x000009a1a9fa2779    x14: 0x000000000000afc4    x15: 0x000000000000afc4    x16: 0x00000001a9fa2778 
   x17: 0x0000000183d3aa1c    x18: 0x0000000000000000    x19: 0x000000017403e200    x20: 0x0000000000000002 
   x21: 0x000000017403e210    x22: 0x00000001a9f9dc20    x23: 0x00000000a1a1a1a1    x24: 0xa3a3a3a3a3a3a3a3 
   x25: 0x0000000000003907    x26: 0x00000001a9fae1fa    x27: 0x00000001a8a3dffc    x28: 0x0000000000000001 
    lr: 0x0000000183d3aa70   cpsr: 0x0000000020000000 

krymtn avatar Dec 31 '18 06:12 krymtn

ok

hackiftekhar avatar Dec 31 '18 11:12 hackiftekhar

Is there any progress? @JimmyGoGoGo @hackiftekhar

krymtn avatar Jan 04 '19 12:01 krymtn

It's working on simulator but not on the real device.

krymtn avatar Jan 10 '19 11:01 krymtn

Can @krymtn can you share the demo project with me. It will really help me to debug this problem.

hackiftekhar avatar Apr 27 '19 10:04 hackiftekhar

Sure will do in this evening. BTW I solved that problem in my local.

Just commented deinit part in IQToolbar.swift like this deinit { /* items = nil privatePreviousBarButton = nil privateNextBarButton = nil privateTitleBarButton = nil privateDoneBarButton = nil privateFixedSpaceBarButton = nil */ }

krymtn avatar Apr 29 '19 11:04 krymtn

@krymtn hmm, not sure but it may lead to some memory issues, So I must need to find out the cause.

hackiftekhar avatar Apr 29 '19 11:04 hackiftekhar

You just need to create a demo project and install the pod. No need to share it. Do you have any iOS10 device??

krymtn avatar Jun 18 '19 09:06 krymtn

Plz, paste the code that I share below `func navBarAppearence() { UINavigationBar.appearance().isTranslucent = false UINavigationBar.appearance().isOpaque = true UINavigationBar.appearance().tintColor = .black UINavigationBar.appearance().barTintColor = .black }

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. navBarAppearence() IQKeyboardManager.shared.enable = true return true }`

krymtn avatar Jun 18 '19 10:06 krymtn

@hackiftekhar do you have any chance to check this issue? Because there is only one function that manages navigation bar appearance in Appdelegate.swift and copied to you.

krymtn avatar Jul 18 '19 14:07 krymtn

I do not own an iOS10 device right now, so looks like I would not be able to reproduce the problem anymore @krymtn. I'm currently having iOS 9, iOS 12 and iOS 13 installed on different devices. I'm not sure how can I reproduce this problem.

hackiftekhar avatar Sep 23 '19 09:09 hackiftekhar