ReactiveX / RxSwift

Reactive Programming in Swift
MIT License
24.41k stars 4.17k forks source link

RxExample-The app crashes when building iOS. #2222

Closed keisukeYamagishi closed 4 years ago

keisukeYamagishi commented 4 years ago

It's probably a bug.

Short description of the issue: When I build 'RxExample-iOS' and launch the app, the app crashes.

Expected outcome:

Being able to build an app and launch it without crashing the app

What actually happens:

When I build 'RxExample-iOS' and launch the app, the app crashes.

Self contained code example that reproduces the issue:

When RxExample-iOS build and launch Logs are listed below

dyld: Library not loaded: @rpath/RxCocoa.framework/RxCocoa
  Referenced from: /private/var/containers/Bundle/Application/35E29B7E-8EC5-41AE-AE74-F339DFFBEED0/RxExample-iOS.app/RxExample-iOS
  Reason: image not found
Message from debugger: Terminated due to signal 6

RxSwift/RxCocoa/RxBlocking/RxTest version/commit

5.1.1(The latest version of the master branch)

Platform/Environment

How easy is to reproduce? (chances of successful reproduce after running the self contained code)

Xcode version:

 Version 11.6 (11E708)

Installation method:

I have multiple versions of Xcode installed: (so we can know if this is a potential cause of your issue)

Level of RxSwift knowledge: (this is so we can understand your level of knowledge and formulate the response in an appropriate manner)

Note

This event is occurring only on the actual device of iPhone. The devices i have checked are OS version: 13.5.1 Device: iPhone 7

A similar issue already exists, but only on an actual device. I think that should be fixed How about this?

freak4pc commented 4 years ago

Thanks! Can you provide a crash report or direct the place of the crash?

keisukeYamagishi commented 4 years ago

Thank you for response I've pasted the crash report below.

Incident Identifier: 24B778A7-194E-42E8-9299-6620EE653603
CrashReporter Key:   68f3a371d0edad9daea7f6875e6d8eba1c7d0388
Hardware Model:      iPhone9,1
Process:             RxExample-iOS [11180]
Path:                /private/var/containers/Bundle/Application/8E93D891-D2BD-49A3-8343-86AD18ADB1AE/RxExample-iOS.app/RxExample-iOS
Identifier:          io.rx.example.4.3.0
Version:             1 (1.0)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      Exited process [11179]
Coalition:           io.rx.example.4.3.0 [2638]

Date/Time:           2020-09-17 20:21:41.9566 +0900
Launch Time:         2020-09-17 20:21:36.5604 +0900
OS Version:          iPhone OS 13.5.1 (17F80)
Release Type:        User
Baseband Version:    7.60.01
Report Version:      104

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

Thread 0 Crashed:
0   dyld                            0x0000000104b04f68 __abort_with_payload + 8
1   dyld                            0x0000000104b0bee8 abort_with_payload_wrapper_internal + 100
2   dyld                            0x0000000104b0bf18 0x104ab8000 + 343832
3   dyld                            0x0000000104b0913c invocation function for block in dyld::removeImage+ 332092 (ImageLoader*) + 0
4   dyld                            0x0000000104abf1a4 dyld::_main+ 29092 (macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 5156
5   dyld                            0x0000000104ab9208 dyldbootstrap::start+ 4616 (dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*) + 396
6   dyld                            0x0000000104ab9038 _dyld_start + 56

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000006   x1: 0x0000000000000001   x2: 0x000000016b85e9b0   x3: 0x00000000000000a5
    x4: 0x000000016b85e5b0   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000000000000000
    x8: 0x0000000000000020   x9: 0x0000000000000009  x10: 0x206567616d69203a  x11: 0x6e756f6620746f6e
   x12: 0x20200a534f692d65  x13: 0x203a6e6f73616552  x14: 0x6f6e206567616d69  x15: 0x00646e756f662074
   x16: 0x0000000000000209  x17: 0x0000000000000000  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x000000016b85e5b0  x21: 0x00000000000000a5  x22: 0x000000016b85e9b0  x23: 0x0000000000000001
   x24: 0x0000000000000006  x25: 0x0000000104b24000  x26: 0x0000000104b24000  x27: 0x0000000104b280c8
   x28: 0x0000000000000001   fp: 0x000000016b85e580   lr: 0x0000000104b0bee8
    sp: 0x000000016b85e540   pc: 0x0000000104b04f68 cpsr: 0x00000000
   esr: 0x56000080  Address size fault

Binary Images:
0x1045a0000 - 0x1046c3fff RxExample-iOS arm64  <dc309bfdac9536ad9ff3a19240658840> /var/containers/Bundle/Application/8E93D891-D2BD-49A3-8343-86AD18ADB1AE/RxExample-iOS.app/RxExample-iOS
0x104ab8000 - 0x104b1bfff dyld arm64  <c9d0dd090ebd3364b6b6d3baeb788dbf> /usr/lib/dyld
0x104c10000 - 0x104dd7fff RxSwift arm64  <8e95e54eeff93dbdb407eca6e77c3657> /var/containers/Bundle/Application/8E93D891-D2BD-49A3-8343-86AD18ADB1AE/RxExample-iOS.app/Frameworks/RxSwift.framework/RxSwift
0x10504c000 - 0x105133fff RxCocoa arm64  <8fefc0f42e0a366fa5afa0ac85ebf2db> /var/containers/Bundle/Application/8E93D891-D2BD-49A3-8343-86AD18ADB1AE/RxExample-iOS.app/Frameworks/RxCocoa.framework/RxCocoa
0x188e02000 - 0x188e33fff libobjc.A.dylib arm64  <8e7331ccb39b39c3bce21c8fc3fd640c> /usr/lib/libobjc.A.dylib
0x188fbb000 - 0x18932efff CoreFoundation arm64  <50cf3336313f3a7d9048cb1ed8ec3368> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x18932f000 - 0x189398fff SystemConfiguration arm64  <97d4a21f62de39d4bac3eda6e23b867b> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
0x189399000 - 0x189650fff Foundation arm64  <c82f8a4f3d0f33db8d40c1e8bef27e56> /System/Library/Frameworks/Foundation.framework/Foundation
0x18c238000 - 0x18c2aafff CoreLocation arm64  <9836af7d3a913fadb09cb6994baf3890> /System/Library/Frameworks/CoreLocation.framework/CoreLocation
0x18fa82000 - 0x18fcd3fff QuartzCore arm64  <cf72678241d539a68a87ae03f4f07584> /System/Library/Frameworks/QuartzCore.framework/QuartzCore
0x1b384f000 - 0x1b384ffff UIKit arm64  <4fdb24a3542c3828ba78261029c70a23> /System/Library/Frameworks/UIKit.framework/UIKit
0x1be3ef000 - 0x1be3f0fff libSystem.B.dylib arm64  <bcb31b5256ee3793bd7c6081d56d1d56> /usr/lib/libSystem.B.dylib

EOF

Also I've stored the actual crash report below.

https://firebasestorage.googleapis.com/v0/b/shichimi-95b1b.appspot.com/o/backup%2FRxExample-iOS%20%202020-09-17%2020-21.crash?alt=media&token=2b17f7d5-13aa-453a-a92f-0ed9b860d69d

freak4pc commented 4 years ago

Hey @keisukeYamagishi I've tried this with a couple of friends and everything works fine for me and the other testers I've asked to check this.

That error seems related to some kind of bad Derived Data, please clean that folder and try again.

keisukeYamagishi commented 4 years ago

Thank you for response @freak4pc I've cleaned and tried it, but it still seems to cannot launch

Commit: 92bf03ec1f1bedcd041fa1074896acd621cbca18 Device: IPhone7 Xcode: 12.0

Incident Identifier: EF84CE30-3C2A-4C96-A5A8-BA142AE9C5DA
CrashReporter Key:   68f3a371d0edad9daea7f6875e6d8eba1c7d0388
Hardware Model:      iPhone9,1
Process:             RxExample-iOS [288]
Path:                /private/var/containers/Bundle/Application/899B5530-AC8E-4A40-829E-C9C661CBE933/RxExample-iOS.app/RxExample-iOS
Identifier:          io.rx.example.4.3.0
Version:             1 (1.0)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      Exited process [286]
Coalition:           io.rx.example.4.3.0 [453]

Date/Time:           2020-09-20 09:45:55.7078 +0900
Launch Time:         2020-09-20 09:45:45.3867 +0900
OS Version:          iPhone OS 13.5.1 (17F80)
Release Type:        User
Baseband Version:    7.60.01
Report Version:      104

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

Thread 0 Crashed:
0   dyld                            0x0000000103278f68 __abort_with_payload + 8
1   dyld                            0x000000010327fee8 abort_with_payload_wrapper_internal + 100
2   dyld                            0x000000010327ff18 0x10322c000 + 343832
3   dyld                            0x000000010327d13c invocation function for block in dyld::removeImage+ 332092 (ImageLoader*) + 0
4   dyld                            0x00000001032331a4 dyld::_main+ 29092 (macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 5156
5   dyld                            0x000000010322d208 dyldbootstrap::start+ 4616 (dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*) + 396
6   dyld                            0x000000010322d038 _dyld_start + 56

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000006   x1: 0x0000000000000001   x2: 0x000000016d2029b0   x3: 0x00000000000000a5
    x4: 0x000000016d2025b0   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000000000000000
    x8: 0x0000000000000020   x9: 0x0000000000000009  x10: 0x206567616d69203a  x11: 0x6e756f6620746f6e
   x12: 0x20200a534f692d65  x13: 0x203a6e6f73616552  x14: 0x6f6e206567616d69  x15: 0x00646e756f662074
   x16: 0x0000000000000209  x17: 0x0000000000000010  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x000000016d2025b0  x21: 0x00000000000000a5  x22: 0x000000016d2029b0  x23: 0x0000000000000001
   x24: 0x0000000000000006  x25: 0x0000000103298000  x26: 0x0000000103298000  x27: 0x000000010329c0c8
   x28: 0x0000000000000001   fp: 0x000000016d202580   lr: 0x000000010327fee8
    sp: 0x000000016d202540   pc: 0x0000000103278f68 cpsr: 0x00000000
   esr: 0x56000080  Address size fault

Binary Images:
0x102bfc000 - 0x102d0bfff RxExample-iOS arm64  <641eb8e24c8e339e97cc47695d2b29c0> /var/containers/Bundle/Application/899B5530-AC8E-4A40-829E-C9C661CBE933/RxExample-iOS.app/RxExample-iOS
0x10322c000 - 0x10328ffff dyld arm64  <c9d0dd090ebd3364b6b6d3baeb788dbf> /usr/lib/dyld

EOF
keisukeYamagishi commented 4 years ago

Hi @freak4pc Shouldn't it be reopened? You haven't done enough testing.

freak4pc commented 4 years ago

Did you remove the entirety of your derived data folder ?

There isn't much that can be done here so I'm not sure there's a reason to reopen:

  1. It doesn't crash for other user I've asked to check (well over 10 by now)
  2. The crash you're having is not in the code itself but early in the launch of the app
  3. The stack only includes dyld (dynamic loader) along with the error message saying that RxCocoa cannot by dynamically loaded, that sounds like some local configuration issue or bad local cache.

I'd be really happy to help some more but it doesn't seem to be anything reproducible I can look at, unfortunately.

keisukeYamagishi commented 4 years ago

@freak4pc Really? You cannot reproduce?

My procedure for reproducing it is to clone it from github and use When I build with Xcode 12.0 and install it on my iPhone 7 (13.5.1), it fails to start and crashes. I removed the entirety of my derived data folder But I am reproduce it The fact that you can't launch it on a device is a problem. If you can't clone it and build it and start it up in the first place, I think it's not a good situation

This problem isn`t only me , it is all user's problem

freak4pc commented 4 years ago

Does it launch for you on a simulator ?

keisukeYamagishi commented 4 years ago

Yes Simulator can build and launch

quanffq commented 2 years ago

I also encountered this problem。Is there a solution? I imported rxswift through cocoapods and the app crashed. Works fine if rxswift is removed。