jharwig / PPSSignatureView

iOS Signature Capture Demo
MIT License
1.04k stars 234 forks source link

Crash on line PPSSignatureView.m line 39 #19

Open brettelliot opened 9 years ago

brettelliot commented 9 years ago

Hi,

Crashlytics sporadically reports a crash on line PPSSignatureView.m line 39. I have not personally been able to reproduce this crash myself despite lots of trying. The system it crashes on is ios 8.1.3. I've listed the stack below. Has anyone seen this before?

Thread : Crashed: com.apple.main-thread 0 MyApp 0x00113452 -PPSSignatureView pan: 1 libGFXShared.dylib 0x2be46e1d gfxWaitBufferOnDevices + 48 2 UIKit 0x2ca8f1af _UIGestureRecognizerSendActions + 294 3 UIKit 0x2c93dc9d -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 668 4 UIKit 0x2cd52a91 _UIGestureRecognizerUpdate_block_invoke661 + 48 5 UIKit 0x2c907515 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 216 6 UIKit 0x2c90548f _UIGestureRecognizerUpdate + 2950 7 UIKit 0x2c93c08d -[UIWindow _sendGesturesForEvent:] + 784 8 UIKit 0x2c93b95d -[UIWindow sendEvent:] + 520 9 UIKit 0x2c9120e5 -[UIApplication sendEvent:] + 196 10 UIKit 0x2cb85ba3 _UIApplicationHandleEventFromQueueEvent + 13874 11 UIKit 0x2c910b27 _UIApplicationHandleEventQueue + 1294 12 CoreFoundation 0x29433fd7 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 14 13 CoreFoundation 0x294333eb CFRunLoopDoSources0 + 222 14 CoreFoundation 0x29431a69 __CFRunLoopRun + 768 15 CoreFoundation 0x2937eb31 CFRunLoopRunSpecific + 476 16 CoreFoundation 0x2937e943 CFRunLoopRunInMode + 106 17 GraphicsServices 0x30742051 GSEventRunModal + 136 18 UIKit 0x2c970f21 UIApplicationMain + 1440 19 MyApp 0x0007d1b4 main (AppDelegate.swift:19)

Thanks

jtsegs commented 9 years ago

I am also crashing on that line. My PPS View works fine if I am just testing the view as a standalone View Controller. However, if I simply create an app that starts with a View Controller that segues to the PPSView, then it immediately crashes upon a tap on the view at line 39 (memcpy). I have no idea how to fix this so any help would be appreciated!

abedows17 commented 9 years ago

I translated the code into Swift, but I'm also crashing on the memcpy line. I translated the function as

addVertex(inout length:Int, inout v:DrawingPoint) { ... var data = glMapBufferOES(UInt32(GL_ARRAY_BUFFER), UInt32(GL_WRITE_ONLY_OES)) memcpy(data + sizeof(DrawingPoint) * length, &v, sizeof(DrawingPoint)) ... }

where DrawingPoint is the same as the Struct as PPSSignaturePoint, just named differently as per a different use case. I've searched all over, but haven't been able to figure out what's going wrong!

zenangst commented 8 years ago

bump Any work being done on this issue?

sgaba commented 8 years ago

@abedows17 Could you share Swift version of this complete class.

liyahemanshu commented 8 years ago

Change line 39 to this to resolve error: if (_length ) { memcpy(data + sizeof(PPSSignaturePoint) * (_length), &v, sizeof(PPSSignaturePoint)); }