Skip to content

Fatal signal 11 (SIGSEGV) when Activity is recreated several times #509

@musicha

Description

@musicha

We are getting following error when the Activity is recreated several times (for example when switching between day & night mode):

Stacktrace
05-14 11:43:35.357 6801-6801/my.package A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x10 in tid 6801 (d.my.package)
05-14 11:43:35.512 9270-9270/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    Build fingerprint: 'samsung/dream2ltexx/dream2lte:8.0.0/R16NW/G955FXXU1CRD7:user/release-keys'
    Revision: '10'
    ABI: 'arm64'
    pid: 6801, tid: 6801, name: my.package  >>> my.package <<<
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10
    Cause: null pointer dereference
        x0   0000000000000000  x1   0000007fd3e981c0  x2   0000000000000000  x3   0000007d67b42559
        x4   0000007fd3e981a0  x5   0000007fd3e98038  x6   000000000010ffff  x7   0000000000000000
        x8   786c7e0d94d05790  x9   786c7e0d94d05790  x10  0000000000430000  x11  0000007d67bf6768
        x12  0000000000000000  x13  0000000000000001  x14  0000000000000084  x15  636172756363612d
        x16  0000007d6c396cc8  x17  0000007d6c333670  x18  0000000000000007  x19  0000000000000000
        x20  0000007fd3e98418  x21  0000007d6d238a60  x22  0000000016ed0a60  x23  0000000016ec6350
        x24  000000001408fdc8  x25  0000000016ed0a60  x26  000000001303ccc0  x27  000000001303dcd0
        x28  0000007fd3e98570  x29  0000007fd3e984c0  x30  0000007d492eab70
        sp   0000007fd3e983a0  pc   0000007d492eab70  pstate 0000000060000000
05-14 11:43:35.524 9270-9270/? A/DEBUG: backtrace:
        #00 pc 00000000000e5b70  /data/app/my.package-bWlWt1eGA_z7l6-RErTOrQ==/lib/arm64/libmapbox-gl.so
        #01 pc 00000000000e7874  /data/app/my.package-bWlWt1eGA_z7l6-RErTOrQ==/lib/arm64/libmapbox-gl.so
        #02 pc 00000000000e78c8  /data/app/my.package-bWlWt1eGA_z7l6-RErTOrQ==/lib/arm64/libmapbox-gl.so
        #03 pc 0000000000537300  /system/lib64/libart.so (art_quick_generic_jni_trampoline+144)
        #04 pc 00000000001541ac  /dev/ashmem/dalvik-jit-code-cache_6801_6801 (deleted)

Versions:

    implementation('com.mapbox.mapboxsdk:mapbox-android-sdk:6.1.1@aar') {
        transitive = true
    }
    implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.5.2'
Activity
class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        Mapbox.getInstance(this, "secret")

        setContentView(R.layout.activity_main)

        mapbox.onCreate(savedInstanceState)
        mapbox.getMapAsync(::initMap)
    }

    override fun onStart() {
        super.onStart()
        mapbox.onStart()
    }

    override fun onResume() {
        super.onResume()
        mapbox.onResume()
    }

    override fun onPause() {
        super.onPause()
        mapbox.onPause()
    }

    override fun onStop() {
        super.onStop()
        mapbox.onStop()
    }

    override fun onSaveInstanceState(outState: Bundle) {
        super.onSaveInstanceState(outState)
        mapbox.onSaveInstanceState(outState)
    }

    override fun onDestroy() {
        super.onDestroy()
        mapbox.onDestroy()
    }

    private fun initMap(map: MapboxMap) {
        val locationEngine = LocationEngineProvider(this).obtainLocationEngineBy(LocationEngine.Type.ANDROID)
        LocationLayerPlugin(mapbox, map, locationEngine).apply {
            renderMode = RenderMode.GPS
        }

        Handler().postDelayed(::recreate, 3000)
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA bug is found inside the code base and should be immediately brought to attention ASAPlocation-layer-pluginIssues that deal with the location layer module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions