status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.88k stars 984 forks source link

App crash when using re-frame fork #3318

Closed dmitryn closed 6 years ago

dmitryn commented 6 years ago

Description

Type: Bug

Summary: App crashes when you do fresh install (not upgrade) on Android phone and using yenda/re-frame fork as dependency. More details here: https://github.com/status-im/status-react/pull/3270

Reproduction

Solution

We're using https://clojars.org/dmitryn/re-frame-fork and it works. Assuming that alphabetical order of dependencies matter.

Additional Information

Logs

02-14 17:45:26.935 10756 11019 D ReactNativeJS: DEBUG [status-im.data-store.realm.schemas.account.v21.core:62] - migrating v21 account database:  [object Realm] [object Realm]
02-14 17:45:27.029   775  1249 D audio_hw_primary: out_standby: enter: stream (0xeed7a000) usecase(1: low-latency-playback)
02-14 17:45:27.063 10756 11019 D ReactNativeJS: DEBUG [status-im.android.core:84] - [INIT] android.core/init
02-14 17:45:27.064 10756 11019 D ReactNativeJS: DEBUG [status-im.android.core:85] - [INIT] status/init-jail
02-14 17:45:27.066 10756 11019 D ReactNativeJS: DEBUG [status-im.native-module.impl.module:29] - :store-call function () {var e=[cljs.core.str.cljs$core$IFn$_invoke$arity$1(status_im.utils.js_resources.status_js),"I18n.locale = '",cljs.core.str.cljs$core$IFn$_invoke$arity$1(status_im.react_native.js_dependencies.i18n.locale),"'; "].join(""),c=cljs.core.truth_(status_im.utils.config.jsc_enabled_QMARK_)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1(e),cljs.core.str.cljs$core$IFn$_invoke$arity$1(status_im.utils.js_resources.web3)].join(""):e,r=[cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.truth_(status_im.utils.config.jsc_enabled_QMARK_)?"JavaScriptCore":"OttoVM")," jail initialized"].join("");return status_im.native_module.impl.module.status.initJail(c,(function(e,c,r){return function(){return taoensso.timbre._log_BANG_.cljs$core$IFn$_invoke$arity$10(taoensso.timbre._STAR_config_STAR_,cljs.core.cst$kw$debug,"status-im.native-module.impl.module","/private/var/folders/6p/tf3p8g3n05n4336rzk3mc5ch0000h8/T/form-init1739330661968828925.clj",66,cljs.core.cst$kw$p,cljs.core.cst$kw$auto,new cljs.core.Delay((function(e,c,r){return function(){return new cljs.core.PersistentVector(null,1,5,cljs.core.PersistentVector.EMPTY_NODE,[r],null)}})(0,0,r),null),null,-1443472959)}})(0,0,r));}
02-14 17:45:27.067 10756 11019 D ReactNativeJS: DEBUG [status-im.android.core:87] - [INIT] status/set-soft-input-mode
02-14 17:45:27.068 10756 11019 D ReactNativeJS: DEBUG [status-im.native-module.impl.module:29] - :store-call function () {return status_im.native_module.impl.module.status.setSoftInputMode(e);}
02-14 17:45:27.069 10756 11019 D ReactNativeJS: DEBUG [status-im.android.core:89] - [INIT] init-back-button-handler!
02-14 17:45:27.071 10756 11019 D ReactNativeJS: DEBUG [status-im.android.core:91] - [INIT] core/init
02-14 17:45:27.072 10756 11019 D ReactNativeJS: DEBUG [status-im.core:17] - [INIT] error-handler/register-exception-handler!
02-14 17:45:27.073 10756 11019 D ReactNativeJS: DEBUG [status-im.core:19] - [INIT] .registerComponent
02-14 17:45:27.074 10756 11019 D ReactNativeJS: DEBUG [status-im.core:21] - [INIT] re-frame/dispatch-sync :initialize-app
02-14 17:45:27.080 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :initialize-app
02-14 17:45:27.083   775  1249 D audio_hw_primary: disable_audio_route: reset and update mixer path: low-latency-playback quat_i2s
02-14 17:45:27.084   775  1249 D soundtrigger: audio_extn_sound_trigger_update_stream_status: uc_id 1 of type 0 for Event 2, with Raise=0
02-14 17:45:27.084   775  1249 D hardware_info: hw_info_append_hw_type : device_name = speaker
02-14 17:45:27.084   775  1249 D audio_hw_primary: disable_snd_device: snd_device(2: speaker)
02-14 17:45:27.084   775  1249 D msm8974_platform: platform_split_snd_device: snd_device(2) num devices(0) new_snd_devices(0)
02-14 17:45:27.084   775  1249 I soundtrigger: audio_extn_sound_trigger_update_device_status: device 0x2 of type 0 for Event 0, with Raise=0
02-14 17:45:27.084   775  1249 D audio_hw_primary: out_standby: exit
02-14 17:45:27.089 10756 11019 D ReactNativeJS: DEBUG [status-im.android.core:93] - [INIT] snoopy/subscribe!
02-14 17:45:27.101 10756 11019 I ReactNativeJS: Running application "StatusIm" with appParams: {"rootTag":1}. __DEV__ === false, development-level warning are OFF, performance optimizations are ON
02-14 17:45:27.136 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.notifications:33] - on-refresh-fcm-token:  fBJ1pESrTho:APA91bFqCL_Up6MMUv4ynNtwToypdYLyoyfNnbKZYjqYmLhw6iKEKRegyifpg09k2lIUF12zvsdyKIaEKtquUgB22hyRCXwWhc1OFxL0Y2bSElfD1sbsxyzywVdFKpCrZVHo2W0_4nhq
02-14 17:45:27.152 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :initialize-db
02-14 17:45:27.156 10756 10756 E BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-14 17:45:27.157  1402  9652 D ActivityManager: setRequestedOrientation() to 1 for ActivityRecord{9299f48 u0 im.status.ethereum/.MainActivity t7439} from pid=10756, uid=10299
02-14 17:45:27.158 10756 10756 I chatty  : uid=10299(im.status.ethereum) identical 2 lines
02-14 17:45:27.158 10756 10756 E BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-14 17:45:27.168 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :load-accounts
02-14 17:45:27.173 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :check-console-chat
02-14 17:45:27.177 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :listen-to-network-status!
02-14 17:45:27.180 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :initialize-crypt
02-14 17:45:27.183 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :initialize-geth
02-14 17:45:27.185   815   815 D SurfaceFlinger: duplicate layer name: changing im.status.ethereum/im.status.ethereum.MainActivity to im.status.ethereum/im.status.ethereum.MainActivity#2
02-14 17:45:27.185 10756 11019 D ReactNativeJS: DEBUG [status-im.native-module.impl.module:29] - :store-call function () {return status_im.native_module.impl.module.status.shouldMoveToInternalStorage(e);}
02-14 17:45:27.188 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :signal-event
02-14 17:45:27.190 10756 11019 D ReactNativeJS: DEBUG [status-im.ui.screens.events:369] - :event-str {"type":"module.initialized"}
02-14 17:45:27.192 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :set
02-14 17:45:27.194 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :app-state-change
02-14 17:45:27.196 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :update-fcm-token
02-14 17:45:27.204 10756 11019 D ReactNativeJS: DEBUG [status-im.network.net-info:9] - Is connected? true
02-14 17:45:27.240 10756 10775 I zygote  : Do partial code cache collection, code=62KB, data=43KB
02-14 17:45:27.241 10756 10775 I zygote  : After code cache collection, code=62KB, data=42KB
02-14 17:45:27.241 10756 10775 I zygote  : Increasing code cache capacity to 256KB
02-14 17:45:27.380  7737  7737 I Finsky  : [2] com.google.android.finsky.m.c.a(25): Completed 1 account content syncs with 1 successful.
02-14 17:45:27.382 10756 10756 E BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-14 17:45:27.383 10756 10756 E BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-14 17:45:27.385  7737  7737 I Finsky  : [2] com.google.android.finsky.ag.c.a(5): Installation state replication succeeded.
02-14 17:45:27.385  7737  7737 I Finsky  : [2] com.google.android.finsky.scheduler.ah.b(12): jobFinished: 1 12
02-14 17:45:27.386  7737  7737 I Finsky  : [2] com.google.android.finsky.scheduler.m.a(184): Job 1 (12) finished
02-14 17:45:27.387  7737  7737 I Finsky  : [2] com.google.android.finsky.scheduler.m.a(159): RunningQueue size: 0
02-14 17:45:27.387  7737  7737 I Finsky  : [2] com.google.android.finsky.scheduler.m.a(160): PendingQueue size: 0
02-14 17:45:27.387  7737  7737 I Finsky  : [2] com.google.android.finsky.scheduler.r.handleMessage(200): Executor finished
02-14 17:45:27.396 10756 11022 I zygote  : Deoptimizing void com.facebook.react.bridge.JavaMethodWrapper.invoke(com.facebook.react.bridge.JSInstance, com.facebook.react.bridge.ReadableNativeArray) due to JIT inline cache
02-14 17:45:27.400 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :init-console-chat
02-14 17:45:27.407  7737  7737 I Finsky  : [2] com.google.android.finsky.scheduler.JobSchedulerEngine.a(95): Cancelling existing job with id: 9000
02-14 17:45:27.408  7737  7737 I Finsky  : [2] com.google.android.finsky.scheduler.JobSchedulerEngine.a(37): Scheduling job with id: 9001
02-14 17:45:27.429 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :status-module-initialized
02-14 17:45:27.432 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :update-network-status
02-14 17:45:27.434 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :set-chat-ui-props
02-14 17:45:27.500 10756 10756 E BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-14 17:45:27.500 10756 10756 E BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: perfIOPrefetchStart [int, class java.lang.String]
02-14 17:45:27.510 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :add-contacts
02-14 17:45:27.562 10756 11019 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :chat-received-message/add-when-commands-loaded
02-14 17:45:27.575 10756 11022 D StatusModule: parseJail chatId:console
02-14 17:45:27.588 10756 11022 F libc    : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x4 in tid 11022 (mqt_native_modu)
02-14 17:45:27.605  1402  9652 I ActivityManager: Killing 10105:ru.yandex.yandexmaps:Metrica/u0a149 (adj 906): empty #17
02-14 17:45:27.623  1402  1423 D EmbryoManager: prepare ru.yandex.yandexmaps user 0
02-14 17:45:27.623  1402  1423 D ActivityManager: Process ru.yandex.yandexmaps:Metrica has 0 services
02-14 17:45:27.711 11183 11183 I crash_dump32: obtaining output fd from tombstoned
02-14 17:45:27.713   972   972 I /system/bin/tombstoned: received crash request for pid 10756
02-14 17:45:27.716 11183 11183 I crash_dump32: performing dump of process 10756 (target tid = 11022)
02-14 17:45:27.718 11183 11183 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-14 17:45:27.718 11183 11183 F DEBUG   : Build fingerprint: 'OnePlus/OnePlus5/OnePlus5:8.0.0/OPR6.170623.013/01120216:user/release-keys'
02-14 17:45:27.718 11183 11183 F DEBUG   : Revision: '0'
02-14 17:45:27.718 11183 11183 F DEBUG   : ABI: 'arm'
02-14 17:45:27.718 11183 11183 F DEBUG   : pid: 10756, tid: 11022, name: mqt_native_modu  >>> im.status.ethereum <<<
02-14 17:45:27.718 11183 11183 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
02-14 17:45:27.718 11183 11183 F DEBUG   : Cause: null pointer dereference
02-14 17:45:27.718 11183 11183 F DEBUG   :     r0 c8d82cfc  r1 00000004  r2 00000001  r3 88823400
02-14 17:45:27.718 11183 11183 F DEBUG   :     r4 c8d82cfc  r5 8882fcf0  r6 00000001  r7 c8d82cf8
02-14 17:45:27.718 11183 11183 F DEBUG   :     r8 00000000  r9 c8d82d60  sl c8d82cfc  fp 8882fcc0
02-14 17:45:27.718 11183 11183 F DEBUG   :     ip 895fbbf4  sp c8d82cc8  lr 88c6357f  pc 88fc9aa8  cpsr 000f0030
02-14 17:45:27.720 11183 11183 F DEBUG   :
02-14 17:45:27.720 11183 11183 F DEBUG   : backtrace:
02-14 17:45:27.720 11183 11183 F DEBUG   :     #00 pc 00588aa8  /data/app/im.status.ethereum-OvZTVUJ096pkGEquqAbfrw==/lib/arm/libjavascriptcoregtk-4.0.so (_ZNK3WTF6String12isolatedCopyEv+3)
02-14 17:45:27.720 11183 11183 F DEBUG   :     #01 pc 002139ab  /data/app/im.status.ethereum-OvZTVUJ096pkGEquqAbfrw==/lib/arm/libjavascriptcoregtk-4.0.so (JSEvaluateScript+78)
02-14 17:45:27.720 11183 11183 F DEBUG   :     #02 pc 0000a803  /data/app/im.status.ethereum-OvZTVUJ096pkGEquqAbfrw==/lib/arm/libandroid-js-core.so (Java_org_liquidplayer_webkit_javascriptcore_JSContext_evaluateScript+118)
02-14 17:45:27.720 11183 11183 F DEBUG   :     #03 pc 0013b755  /data/app/im.status.ethereum-OvZTVUJ096pkGEquqAbfrw==/oat/arm/base.odex (offset 0x76000)

Please note parseJail chatId:console call. There is no initJail call before it as you see in normal app init log below:

02-13 15:19:18.986  2325  2369 D ReactNativeJS: DEBUG [status-im.android.core:84] - [INIT] android.core/init
02-13 15:19:18.988  2325  2370 D StatusModule: setSoftInputMode
02-13 15:19:18.989  2325  2369 D ReactNativeJS: DEBUG [status-im.android.core:86] - [INIT] status/set-soft-input-mode
02-13 15:19:18.991  2325  2369 D ReactNativeJS: DEBUG [status-im.android.core:88] - [INIT] init-back-button-handler!
02-13 15:19:18.992  2325  2369 D ReactNativeJS: DEBUG [status-im.core:17] - [INIT] log/set-level!
02-13 15:19:18.995  2325  2369 D ReactNativeJS: DEBUG [status-im.core:19] - [INIT] error-handler/register-exception-handler!
02-13 15:19:18.999  2325  2369 D ReactNativeJS: DEBUG [status-im.core:21] - [INIT] status/init-jail
02-13 15:19:18.999  2325  2370 D StatusModule: initJail
02-13 15:19:19.008  2325  2369 D ReactNativeJS: DEBUG [status-im.core:23] - [INIT] data-store/init
02-13 15:19:19.010  2325  2369 D ReactNativeJS: DEBUG [status-im.core:25] - [INIT] .registerComponent
02-13 15:19:19.013  2325  2369 D ReactNativeJS: DEBUG [status-im.utils.handlers:29] - Handling re-frame event:  :initialize-app

It also runs when you do upgrade app:

02-14 13:31:28.105 13266 13312 I ReactNativeJS: There was an error collecting entropy from the browser:
02-14 13:31:28.111 13266 13312 I ReactNativeJS: { [TypeError: undefined is not an object (evaluating 'o.random')] line: 660, column: 465, sourceURL: 'index.android.bundle' }
02-14 13:31:28.465   766  1039 I WifiService: getConnectionInfo uid=10130
02-14 13:31:29.522   766 17323 I WifiService: getConnectionInfo uid=10130
02-14 13:31:30.499   766  7638 I WifiService: getConnectionInfo uid=10130
02-14 13:31:31.505   766  9365 I WifiService: getConnectionInfo uid=10130
02-14 13:31:31.552 13266 13312 D ReactNativeJS: DEBUG [status-im.android.core:84] - [INIT] android.core/init
02-14 13:31:31.565 13266 13312 D ReactNativeJS: DEBUG [status-im.native-module.impl.module:29] - :store-call function () {return status_im.native_module.impl.module.status.setSoftInputMode(e);}
02-14 13:31:31.571 13266 13312 D ReactNativeJS: DEBUG [status-im.android.core:86] - [INIT] status/set-soft-input-mode
02-14 13:31:31.577 13266 13312 D ReactNativeJS: DEBUG [status-im.android.core:88] - [INIT] init-back-button-handler!
02-14 13:31:31.693 13266 13312 I ReactNativeJS: Running application "StatusIm" with appParams: {"rootTag":1}. __DEV__ === false, development-level warning are OFF, performance optimizations are ON
02-14 13:31:31.703   431   431 D SurfaceFlinger: duplicate layer name: changing im.status.ethereum/im.status.ethereum.MainActivity to im.status.ethereum/im.status.ethereum.MainActivity#2
02-14 13:31:32.315 13266 13271 I zygote  : Do partial code cache collection, code=63KB, data=45KB
02-14 13:31:32.317 13266 13271 I zygote  : After code cache collection, code=62KB, data=44KB
02-14 13:31:32.317 13266 13271 I zygote  : Increasing code cache capacity to 256KB
02-14 13:31:32.518   766  1031 I WifiService: getConnectionInfo uid=10130
02-14 13:31:32.542 13266 13312 W ReactNativeJS: MenuContext is deprecated and it might be removed in future releases, use MenuProvider instead.
02-14 13:31:32.937 13266 13315 D StatusModule: setSoftInputMode
02-14 13:31:32.942 13266 13315 D StatusModule: initJail
02-14 13:31:33.005 13266 13266 I zygote  : Deoptimizing void com.facebook.react.uimanager.UIViewOperationQueue$1.run() due to JIT inline cache
02-14 13:31:33.074 13266 13276 I zygote  : Background concurrent copying GC freed 23398(1401KB) AllocSpace objects, 6(128KB) LOS objects, 49% free, 3MB/7MB, paused 250us total 113.487ms
02-14 13:31:33.152 13266 13315 D StatusModule: parseJail chatId:console
02-14 13:31:33.385   564  6410 D audio_route: Apply path: speaker-protected
02-14 13:31:33.391   564  6410 D audio_hw_primary: enable_snd_device: snd_device(95: vi-feedback)
02-14 13:31:33.391   564  6410 D audio_route: Apply path: vi-feedback
02-14 13:31:33.391   564  6410 D audio_hw_primary: enable_audio_route: usecase(24) apply and update mixer path: spkr-vi-record
02-14 13:31:33.391   564  6410 D audio_route: Apply path: spkr-vi-record
02-14 13:31:33.417   564  6410 D audio_hw_primary: enable_audio_route: usecase(1) apply and update mixer path: low-latency-playback
02-14 13:31:33.417   564  6410 D audio_route: Apply path: low-latency-playback
02-14 13:31:33.428 13266 13315 D StatusModule: {"result":"{\"commands\":{\"faucet,50\":{\"name\":\"faucet\",\"title\":\"Faucet\",\"description\":\"Get some ETH\",\"has-handler\":true,\"async-handler\":false,\"color\":\"#7099e6\",\"params\":[{\"name\":\"url\",\"type\":\"text\",\"placeholder\":\"Faucet URL\"}],\"scope\":[\"personal-chats\",\"registered\",\"dapps\"],\"scope-bitmask\":50},\"debug,50\":{\"name\":\"debug\",\"title\":\"Debug mode\",\"description\":\"Starts\/stops a debug mode\",\"has-handler\":true,\"async-handler\":false,\"color\":\"#7099e6\",\"params\":[{\"name\":\"mode\",\"type\":\"text\"}],\"scope\":[\"personal-chats\",\"registered\",\"dapps\"],\"scope-bitmask\":50}},\"responses\":{\"password,42\":{\"name\":\"password\",\"description\":\"Password\",\"has-handler\":true,\"async-handler\":false,\"color\":\"#7099e6\",\"icon\":\"lock_white\",\"params\":[{\"name\":\"password\",\"type\":\"password\",\"placeholder\":\"Type your password\",\"hidden\":true},{\"name\":\"password-confirmation\",\"type\":\"password\",\"placeholder\":\"Confirm\",\"hidden\":true}],\"sequential-params\":true,\"scope\":[\"personal-chats\",\"anonymous\",\"dapps\"],\"scope-bitmask\":42},\"grant-permissions,58\":{\"name\":\"grant-permissions\",\"description\":\"Grant permissions\",\"has-handler\":true,\"async-handler\":false,\"color\":\"#7099e6\",\"icon\":\"lock_white\",\"params\":[],\"execute-immediately?\":true,\"scope\":[\"personal-chats\",\"anonymous\",\"registered\",\"dapps\"],\"scope-bitmask\":58}},\"functions\":{},\"subscriptions\":{}}"}
02-14 13:31:33.428 13266 13315 D StatusModule: endParseJail
yenda commented 6 years ago

To solve this issue the init sequence needs to be refactored so that it works in a predictible way and doesn't reproduce the above issue when using yenda/re-frame fork. The issue is currently not reproduced using dmitry/re-frame fork which is the same code the we assume it has to do with the order dependencies are loaded.

asemiankevich commented 6 years ago

@dmitryn is it okay to close this one?