viezel / NappDrawer

A side drawer navigation container view controller for Appcelerator Titanium.
MIT License
247 stars 128 forks source link

App crashes after setting centerWindow multiple times (iOS) #213

Open arifje opened 6 years ago

arifje commented 6 years ago

I can't explain why the example is working, but when I set new center windows the app crashes without any messages in the console. It just stops.

Add some timeouts after the main window has opened;

drawer.open();

setTimeout(function() {

    var w = Ti.UI.createWindow({
        backgroundColor: 'red'
    });
    drawer.setCenterWindow(w);
},7000);

setTimeout(function() {

    var w = Ti.UI.createWindow({
        backgroundColor: 'green'
    });
    drawer.setCenterWindow(w);
},9000);

setTimeout(function() {

    var w = Ti.UI.createWindow({
        backgroundColor: 'blue'
    });
    drawer.setCenterWindow(w);
},11000);

setTimeout(function() {

    var w = Ti.UI.createWindow({
        backgroundColor: 'orange'
    });
    drawer.setCenterWindow(w);
},13000);

This will crash the app after the second window (green) has been set.

Running SDK 7.0.1.GA

mebarg commented 6 years ago

i have the same issue the app crash without error in the console

PietroGranati commented 6 years ago

Same problem here, app crash at first time I try to setCenterwindow

reneaye commented 6 years ago

I have the problem that I try to set a window that has been created with Alloy. So I get the window reference using Alloy.createController("myControllerScript.js").getView(). But using this reference crashes the app immediately.

Other than the that, the example app is working. But in the example app a window is used, that has been created with Titanium scrip only. Is it possible that there is difference?

tracedog commented 6 years ago

Here is the code I'm using and it works flawlessly. This is inside my menuClick function

` if(Alloy.isHandheld) {

  Ti.API.info("centerWin id: " + Alloy.Globals.Drawer.getCenterWindow().id + " -- " + windowName);

  var centerWindow = Alloy.Globals.Drawer.instance.getCenterWindow();

  if(Alloy.Globals.Drawer.getCenterWindow().id != windowName){
    var oldWin = centerWindow.window;
    var win = Alloy.createController(windowName).getView();
    centerWindow.setCenterWindow(win);

} else {                
        Ti.API.info("I'm toggling the window.... thats it...");
    Alloy.Globals.Drawer.toggleRightWindow();
}

} `

The problem I'm seeing in the system.log is this:

"notify name "com.apple.UIKit.SimulatorWantsEdgeSwipes" has been registered 20 times - this may be a leak"

I'm guessing I'm not releasing my windows properly, which eventually causes the app to crash. So trying to get to the root of the issue.

rsimbu89 commented 6 years ago

I'm also getting crash without any logs, while set center window

<Alloy.Globals.parent.setCenterWindow(Alloy.createController('windowname').getView());>

I'm using 2.1.1 dk.napp.drawer and Ti SDK 7.2.0.GA

mitulbhalia commented 6 years ago

I'm also getting same issue. App is crashing while setting centerWindow.

I tested with 7.0.1.GA and 7.2.0.GA with 2.0.0, 2.1.0, 2.1.1 versions of module.

mitulbhalia commented 6 years ago

Hello @viezel Any update on this error?

pksage commented 6 years ago

Same problem here, I keep getting SIGSEGV and SIGBUS segmentation fault crashes with setCenterWindow. iOS only, Android works fine. I'm on NappDrawer 2.1.1, reproduced on both Titanium 7.4.0 and 7.4.1. I've tried everything I can think of in my JS code to ensure I don't have any orphaned references that would cause memory conflicts, so I'm pretty sure it's in the native code.

mitulbhalia commented 6 years ago

Is anybody there to look at up on to this issue? Or suggest me other option so i can go with that as I really want to move further with this kind of module.

guiled commented 6 years ago

I'm sorry but I think this module is unmaintained :-(

rsimbu89 commented 6 years ago

@mitulbhalia try to set the View instead of Window <Alloy.Globals.Drawer.setCenterView(Alloy.createController('viewname').getView());>

mitulbhalia commented 6 years ago

@rsimbu89 I am talking about iOS module.

mitulbhalia commented 5 years ago

@viezel @hansemannn Any update on this issue as I am waiting for the solution.

tracedog commented 5 years ago

I can confirm this is working using Titanium SDK 7.5.0 GA. I tried to compile it using TI SDK 8.0 GA and it no longer works.

qalbit commented 5 years ago

I have the same issue for Crash. Can anyone find any solution for this issue?

Application Specific Information: objc_msgSend() selector name: view CoreSimulator 581.2 - Device: iPhone XS Max - Runtime: iOS 12.1 (16B91) - DeviceType: iPhone Xs Max

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libobjc.A.dylib 0x0000000107c39d8b objcmsgSend + 11 1 com.qalbit.feestbeesten 0x0000000102565ade -[MMDrawerController setCenterViewController:animated:] + 560 2 com.qalbit.feestbeesten 0x000000010255fbac -[DkNappDrawerDrawer setCenterWindow:] + 668 3 com.appcelerator.TitaniumKit 0x0000000106479700 DoProxyDelegateChangedValuesWithProxy + 626 4 com.appcelerator.TitaniumKit 0x000000010647d133 -[TiProxy replaceValue:forKey:notification:] + 719 5 com.appcelerator.TitaniumKit 0x00000001064577bb -[TiViewProxy setValue:forUndefinedKey:] + 212 6 com.apple.Foundation 0x0000000104672de4 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292 7 com.appcelerator.TitaniumKit 0x0000000106439166 -[KrollObject setValue:forKey:] + 432 8 com.appcelerator.TitaniumKit 0x0000000106436fb0 KrollSetProperty + 421 9 com.apple.JavaScriptCore 0x00000001028fc0a5 JSC::JSCallbackObject::put(JSC::JSCell, JSC::ExecState, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&) + 277 10 com.apple.JavaScriptCore 0x0000000102e8938a llint_slow_path_put_by_val + 1322 11 com.apple.JavaScriptCore 0x00000001028cd553 llint_entry + 15063 12 com.apple.JavaScriptCore 0x00000001028d02e2 llint_entry + 26726 13 com.apple.JavaScriptCore 0x00000001028d02e2 llint_entry + 26726 14 com.apple.JavaScriptCore 0x00000001028d02e2 llint_entry + 26726 15 com.apple.JavaScriptCore 0x00000001028c98fe vmEntryToJavaScript + 244 16 com.apple.JavaScriptCore 0x0000000102dc5846 JSC::Interpreter::executeCall(JSC::ExecState, JSC::JSObject, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 470 17 com.apple.JavaScriptCore 0x0000000102fc69b4 JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 196 18 com.apple.JavaScriptCore 0x00000001029092d4 JSObjectCallAsFunction + 468 19 com.appcelerator.TitaniumKit 0x00000001064543e2 __TiBindingEventProcess_block_invoke + 53 20 com.appcelerator.TitaniumKit 0x000000010645430a TiBindingEventProcess + 723 21 com.appcelerator.TitaniumKit 0x0000000106475df5 -[KrollContext invoke:] + 109 22 com.appcelerator.TitaniumKit 0x0000000106475e68 -[KrollContext enqueue:] + 93 23 com.appcelerator.TitaniumKit 0x000000010647da91 TiBindingRunLoopEnqueue + 82 24 com.appcelerator.TitaniumKit 0x000000010645c896 -[TiViewProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 224 25 com.appcelerator.TitaniumKit 0x000000010647c060 -[TiProxy fireEvent:withObject:] + 72 26 com.qalbit.feestbeesten 0x000000010255149e -[TiUIListView fireClickForItemAtIndexPath:tableView:accessoryButtonTapped:] + 1390 (TiUIListView.m:2248) 27 com.qalbit.feestbeesten 0x000000010254e3ea -[TiUIListView tableView:didSelectRowAtIndexPath:] + 74 (TiUIListView.m:1835) 28 com.apple.UIKitCore 0x0000000114d4bdfd -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1813 29 com.apple.UIKitCore 0x0000000114d4c018 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 344 30 com.apple.UIKitCore 0x0000000114b320d2 _runAfterCACommitDeferredBlocks + 318 31 com.apple.UIKitCore 0x0000000114b20b2c _cleanUpAfterCAFlushAndRunDeferredBlocks + 384 32 com.apple.UIKitCore 0x0000000114b4fefc _afterCACommitHandler + 135 33 com.apple.CoreFoundation 0x0000000108ce3c27 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23 34 com.apple.CoreFoundation 0x0000000108cde0be CFRunLoopDoObservers + 430 35 com.apple.CoreFoundation 0x0000000108cde751 CFRunLoopRun + 1537 36 com.apple.CoreFoundation 0x0000000108cdde11 CFRunLoopRunSpecific + 625 37 com.apple.GraphicsServices 0x000000010da471dd GSEventRunModal + 62 38 com.apple.UIKitCore 0x0000000114b2681d UIApplicationMain + 140 39 com.qalbit.feestbeesten 0x000000010234f07c main + 1004 (main.m:66) 40 libdyld.dylib 0x000000010b0da575 start + 1

Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000004 rbx: 0x000000010258f911 rcx: 0x00000000000fc080 rdx: 0x0000000000000303 rdi: 0x00007ff057731020 rsi: 0x000000011c23979a rbp: 0x00007ffeed8bc5b0 rsp: 0x00007ffeed8bc528 r8: 0x0000000000000036 r9: 0x0000000000000000 r10: 0xa000000000000000 r11: 0x000000011c23979a r12: 0x00007ff057869600 r13: 0x0000000107c39d80 r14: 0x00007ff05759d530 r15: 0x00007ff057731020 rip: 0x0000000107c39d8b rfl: 0x0000000000010202 cr2: 0x0000000104f2b000

Logical CPU: 2 Error Code: 0x00000000 Trap Number: 13

albert0m commented 5 years ago

same here, I don't think this will ever be fixed

albert0m commented 5 years ago

downgrading to 1.2.4 fixed it, I will stick with that for now

qalbit commented 5 years ago

Thanks, @marconealberto for the reply. I already downgrade the Modules and compiled it. It works fine after downgrading the modules.