microsoft / WinObjC

Objective-C for Windows
MIT License
6.24k stars 810 forks source link

FAIL_FAST() in UITouchGestureRecogniser #1785

Open ad1Dima opened 7 years ago

ad1Dima commented 7 years ago

I converted https://github.com/romaonthego/RESideMenu using 0.2.161107 Then I tried to launch demo app. It launches great, but when I clicked Left button in navbar it crashes in UIKit UIPanGestureRecognizer.mm:294

Same for any touch/click in view

jaredhms commented 7 years ago

@ad1Dima, can you please provide a call stack?

jaredhms commented 7 years ago

Concise, self-contained repro steps would also be helpful.

ad1Dima commented 7 years ago

@jaredhms Repo: Convert -> Launch -> Click

In 12-14 hrs I'll be able to provide converted project or call stack

ad1Dima commented 7 years ago

all trace I can get 

    UIKIT.DLL!wil::details::ReportFailure(void * callerReturnAddress, unsigned int lineNumber, const char * fileName, const char * functionName, const char * code, void * returnAddress, wil::FailureType type, HRESULT hr, const wchar_t * message, wil::details::ReportFailureOptions options) Line 3114 C++
    UIKIT.DLL!wil::details::ReportFailure_Hr(void * callerReturnAddress, unsigned int lineNumber, const char * fileName, const char * functionName, const char * code, void * returnAddress, wil::FailureType type, HRESULT hr) Line 3151   C++
    UIKIT.DLL!wil::details::in1diag5::_FailFast_Unexpected(void * callerReturnAddress, unsigned int lineNumber, const char * fileName, const char * functionName, const char * code) Line 4180  C++
    UIKIT.DLL!-[UIPanGestureRecognizer touchesEnded:withEvent:](UIPanGestureRecognizer * self, objc_selector * _cmd, id * touches, UIEvent * event) Line 337    Objective-C++
    FOUNDATION.DLL!-[NSObject performSelector:withObject:withObject:](NSObject * self, objc_selector * _cmd, objc_selector * selector, id * obj1, id * obj2) Line 275   Objective-C++
    UIKIT.DLL!-[UIView _processGesturesForTouch:event:touchEventName:](UIView * self, objc_selector * _cmd, UITouch * touch, UIEvent * event, objc_selector * eventName) Line 210   Objective-C++
    UIKIT.DLL!-[UIView _processPointerEvent:forTouchPhase:](UIView * self, objc_selector * _cmd, id * pointerEventArgs, UITouchPhase touchPhase) Line 499   Objective-C++
    UIKIT.DLL!__41-[UIView _initPrivWithFrame:xamlElement:]_block_invoke.3773(void * .block_descriptor, id * sender, id * e) Line 761   Objective-C++
>   OBJCUWP_WINDOWS_UI_XAML.DLL!022f062f()  Unknown
ad1Dima commented 7 years ago

Ok. I find out minimum reproducable code:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];;

    UIViewController* vc = [[UIViewController alloc] init];
    self.window.rootViewController = vc;

    UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action : @selector(panGestureRecognized : )];
    panGestureRecognizer.delegate = self;
    [self.window addGestureRecognizer : panGestureRecognizer];

    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch : (UITouch *)touch
{
    return NO;
}

-(void)panGestureRecognized : (UIPanGestureRecognizer *)recognizer
{

}
ad1Dima commented 7 years ago

In 0.2 170201 bug still exist. 

tadam-msft commented 7 years ago

Thanks, we'll take a look.