becvert / cordova-plugin-zeroconf

Cordova ZeroConf Plugin
MIT License
81 stars 57 forks source link

iOS Crash #85

Closed digaus closed 3 years ago

digaus commented 4 years ago

For some users my iOS app is crashing with the following log

https://github.com/becvert/cordova-plugin-zeroconf/blob/master/src/ios/ZeroConf.swift#L399

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x000000019da73ec4 __pthread_kill + 8
1   libsystem_pthread.dylib         0x000000019d98f1d8 pthread_kill$VARIANT$mp + 136 (pthread.c:1458)
2   libsystem_c.dylib               0x000000019d8e3844 abort + 100 (abort.c:110)
3   libswiftCore.dylib              0x00000001ab1a4a90 swift::fatalError(unsigned int, char const*, ...) + 56 (Errors.cpp:353)
4   libswiftCore.dylib              0x00000001ab19d47c swift::swift_dynamicCastFailure(void const*, char const*, void const*, char const*, char const*) + 76 (Casting.cpp:184)
5   libswiftCore.dylib              0x00000001ab19d4f4 swift::swift_dynamicCastFailure(swift::TargetMetadata<swift::InProcess> const*, swift::TargetMeta... + 120 (Casting.cpp:200)
6   libswiftCore.dylib              0x00000001ab1ebbac swift_dynamicCastObjCClassUnconditional + 188 (SwiftObject.mm:1120)
7   libswiftCore.dylib              0x00000001ab19ffd8 _dynamicCastClassToValueViaObjCBridgeable(swift::OpaqueValue*, swift::OpaqueValue*, swift::Target... + 532 (CompatibilityOverride.def:99)
8   libswiftCore.dylib              0x00000001ab1a01b8 _dynamicCastFromExistential(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetExistentialTyp... + 312 (CompatibilityOverride.def:72)
9   libswiftFoundation.dylib        0x00000001d23da7bc $sSD10FoundationE26_forceBridgeFromObjectiveC_6resultySo12NSDictionaryC_SDyxq_GSgztFZSiSryxG_Sryq... + 768 (NSDictionary.swift:139)
10  libswiftFoundation.dylib        0x00000001d2438e80 $ss17_NativeDictionaryV28_unsafeUninitializedCapacity18allowingDuplicates16initializingWithAByxq_... + 208 (<compiler-generated>:0)
11  libswiftFoundation.dylib        0x00000001d23da254 $sSD10FoundationE26_forceBridgeFromObjectiveC_6resultySo12NSDictionaryC_SDyxq_GSgztFZ + 792 (<compiler-generated>:0)
12  libswiftFoundation.dylib        0x00000001d23ceb54 $sSD10FoundationE36_unconditionallyBridgeFromObjectiveCySDyxq_GSo12NSDictionaryCSgFZ + 68 (NSDictionary.swift:333)
13  CordovaPlugins                  0x00000001049f046c specialized static ZeroConf.jsonifyService(_:) + 1532 (ZeroConf.swift:399)
14  CordovaPlugins                  0x00000001049ea328 ZeroConf.Browser.netServiceDidResolveAddress(_:) + 36 (<compiler-generated>:0)
15  CordovaPlugins                  0x00000001049ea6d0 @objc ZeroConf.Browser.netServiceDidResolveAddress(_:) + 48 (<compiler-generated>:0)
16  CFNetwork                       0x00000001a0f04c10 _ShortTimerCallBack(__CFRunLoopTimer*, void*) + 88 (CFNetServices.c:900)
17  CoreFoundation                  0x000000019dbfb03c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28 (CFRunLoop.c:1766)
18  CoreFoundation                  0x000000019dbfad78 __CFRunLoopDoTimer + 880 (CFRunLoop.c:2357)
19  CoreFoundation                  0x000000019dbfa448 __CFRunLoopDoTimers + 276 (CFRunLoop.c:2512)
20  CoreFoundation                  0x000000019dbf5584 __CFRunLoopRun + 1920 (CFRunLoop.c:0)
21  CoreFoundation                  0x000000019dbf4adc CFRunLoopRunSpecific + 464 (CFRunLoop.c:3192)
22  GraphicsServices                0x00000001a7b7a328 GSEventRunModal + 104 (GSEvent.c:2246)
23  UIKitCore                       0x00000001a1cefae0 UIApplicationMain + 1936 (UIApplication.m:4773)
24  App                             0x0000000104666c7c main + 96 (AppDelegate.swift:5)
25  libdyld.dylib                   0x000000019da7e360 start + 4
digaus commented 4 years ago

https://github.com/becvert/cordova-plugin-zeroconf/issues/79 https://github.com/becvert/cordova-plugin-zeroconf/issues/32

Might be related

digaus commented 4 years ago

Now two more users reported this issue. Will look into a fix myself soon.

wang3g commented 4 years ago

Now two more users reported this issue. Will look into a fix myself soon. Any fix on this issue yet?

JumBay commented 4 years ago

Hi,

My users start to encounter this same issue as well. On my iPhone 6s no issue.

emcniece commented 4 years ago

Digging in right now folks - standby for update.

emcniece commented 4 years ago

Version 1.4.2 #87 has just been merged, please test & report back! 🙏

wang3g commented 4 years ago

Version 1.4.2 #87 has just been merged, please test & report back! 🙏

When trying to install v1.4.2, I got the following error.

$ cordova plugin add cordova-plugin-zeroconf@1.4.2 Failed to fetch plugin cordova-plugin-zeroconf@1.4.2 via registry. Probably this is either a connection problem, or plugin spec is incorrect. Check your connection and plugin name/version/URL. Error: npm: Command failed with exit code 1 Error output: npm ERR! Darwin 19.0.0 npm ERR! argv "/Users/wang3g/.nvm/versions/node/v6.11.1/bin/node" "/Users/wang3g/.nvm/versions/node/v6.11.1/bin/npm" "install" "cordova-plugin-zeroconf@1.4.2" "--production" "--save" npm ERR! node v6.11.1 npm ERR! npm v3.10.10 npm ERR! code ETARGET

npm ERR! notarget No compatible version found: cordova-plugin-zeroconf@1.4.2 npm ERR! notarget Valid install targets: npm ERR! notarget 1.4.1, 1.4.0, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.8, 1.2.7, 1.2.6, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.1, 1.0.0 npm ERR! notarget npm ERR! notarget This is most likely not a problem with npm itself. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist.

becvert commented 4 years ago

@emcniece I've invited you to be a maintainer on npm. I'll let you do the work for now as I don't use this plugin in any of my current projects. Thank you very much!

emcniece commented 4 years ago

Thanks @becvert, publish complete!

@wang3g give it another shot. You can also install from the Github repo like this:

npm install --save becvert/cordova-plugin-zeroconf#1.4.2
IllusionVK commented 3 years ago

Hey @wang3g and @digaus, I'm wondering if the changes made by @emcniece helped with your problem ?

digaus commented 3 years ago

Hey @wang3g and @digaus, I'm wondering if the changes made by @emcniece helped with your problem ?

Have my version running since a year and no reports of crashes so far.