SIGSEGV on Android 7
See original GitHub issueIssue
After updating my application I faced a lot of crashes on android 7 devices. I couldn’t reproduce it on my nexus or on the emulator so I bought one of the crashing devices. After spending half of the day I finally managed to find the root cause and I can reproduce it in a hello world project.
Sample
class MainActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
CoroutineScope(SupervisorJob() + Dispatchers.Main).launch {
while (true) {
combine(flowOf(Unit), flowOf(Unit)) { _ -> Unit }.collect()
}
}
}
}
Crash
This leads to a sigsegv
Flags: 0x28c8bf46
Package: com.example.weirdcrash v1 (1.0)
Foreground: Yes
Build: TCL/5009D/U5A_PLUS_3G:7.0/NRD90M/5009D_ALWE_V2.9_20180529:user/release-keys
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'TCL/5009D/U5A_PLUS_3G:7.0/NRD90M/5009D_ALWE_V2.9_20180529:user/release-keys'
Revision: '0'
ABI: 'arm'
pid: 29639, tid: 29639, name: mple.weirdcrash >>> com.example.weirdcrash <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x15608
r0 00015000 r1 12d35700 r2 00000002 r3 00000000
r4 af58a6d8 r5 12d31ee0 r6 12d37280 r7 00000000
r8 12d35700 r9 ac684400 sl 12cb0a90 fp 12d33bf8
ip bef2f84c sp bef2f8b0 lr 9901f5ef pc 9901f608 cpsr 000f0030
backtrace:
#00 pc 00000608 /dev/ashmem/dalvik-jit-code-cache (deleted)
#01 pc 000005ed /dev/ashmem/dalvik-jit-code-cache (deleted)
29639
I currently see about 1200 affected users…
Versions
'com.android.tools.build:gradle:3.6.0-beta04'
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2"
"org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.2"
Affected Devices
Note
Take a look at the last crash, maybe that’s an indicator for what’s going wrong. That one is no native crash but an android 7 only issue.
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (9 by maintainers)
Top Results From Across the Web
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) - Nougat ...
I get signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) native crashes. ... What is interesting the problem occurs only on Android 7.0 and 7.1....
Read more >Diagnosing Native Crashes
Making code unreadable causes intentional and unintentional reads into memory segments marked execute-only to throw a SIGSEGV with code ...
Read more >[#QTBUG-57922] QNetworkAccessManager crashes with ...
QNetworkAccessManager form 5.8.0 RC crushes with SIGSEGV on Android 7 when executing connectToHostEncrypted, get, put or post commands.
Read more >Segmentation Fault (SIGSEGV) vs Bus Error (SIGBUS)
1) Segmentation Fault (also known as SIGSEGV and is usually signal 11) occur when the program tries to write/read outside the memory allocated ......
Read more >[INTERNAL] SIGSEGV on endTransaction with rollback ...
setTransactionSuccessful()" causes a "A/libc: Fatal signal 11 (SIGSEGV), code 1", but only on a Motorola MotoG5 with Android 7. Not reproducable in Simulator ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have written a non-rx version:
@mhernand40 Unfortunately, we do not know. The stable reproducer is required in order to check such a hypothesis