Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[Crash] signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x6f19 #13430

Closed
treech opened this issue Nov 21, 2018 · 13 comments
Closed

[Crash] signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x6f19 #13430

treech opened this issue Nov 21, 2018 · 13 comments
Labels
Android Mapbox Maps SDK for Android archived Archived because of inactivity crash

Comments

@treech
Copy link

treech commented Nov 21, 2018

Hi,My app crashed when i operate the app in activity,i am sure all my actions are in main thread,and my sdk version is 6.7.1,finally i use mapbox sdk since version 6.6.5,this is my error log below:

2018-11-21 17:38:53.165 3932-3932/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2018-11-21 17:38:53.165 3932-3932/? A/DEBUG: Build fingerprint: 'HONOR/KNT-AL10/HWKNT:7.0/HUAWEIKNT-AL10/C00B397:user/release-keys'
2018-11-21 17:38:53.165 3932-3932/? A/DEBUG: Revision: '0'
2018-11-21 17:38:53.165 3932-3932/? A/DEBUG: ABI: 'arm64'
2018-11-21 17:38:53.165 3932-3932/? A/DEBUG: pid: 3764, tid: 3774, name: FinalizerDaemon >>> com.netposa.tujie <<<
2018-11-21 17:38:53.166 3932-3932/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x6f19
2018-11-21 17:38:53.166 3932-3932/? A/DEBUG: x0 0000007941d92700 x1 0000000000100a6a x2 000000791b800000 x3 000000000000000e
2018-11-21 17:38:53.166 3932-3932/? A/DEBUG: x4 0000000000000014 x5 0000000000000000 x6 0000007950e11b08 x7 0000007913a72840
2018-11-21 17:38:53.166 3932-3932/? A/DEBUG: x8 0000000000006e69 x9 0000007950e11d88 x10 0000000000000014 x11 0000000000000000
2018-11-21 17:38:53.166 3932-3932/? A/DEBUG: x12 0000000000000001 x13 00000000ffffffff x14 0000000000148b40 x15 0000000000000000
2018-11-21 17:38:53.166 3932-3932/? A/DEBUG: x16 00000079643b5588 x17 000000796435bfd8 x18 0000000000000001 x19 0000007913424290
2018-11-21 17:38:53.166 3932-3932/? A/DEBUG: x20 000000793d4d04e0 x21 0000007912ffb540 x22 000000795ef724e8 x23 000000792e9f9000
2018-11-21 17:38:53.166 3932-3932/? A/DEBUG: x24 0000000000001808 x25 0000000013607240 x26 0000007960aa3898 x27 6e8313ae47acd8a2
2018-11-21 17:38:53.166 3932-3932/? A/DEBUG: x28 000000795ef71cf0 x29 000000795ef71b20 x30 000000792e56c8c0
2018-11-21 17:38:53.166 3932-3932/? A/DEBUG: sp 000000795ef71b20 pc 000000792e56b448 pstate 0000000020000000
2018-11-21 17:38:53.172 3932-3932/? A/DEBUG: backtrace:
2018-11-21 17:38:53.172 3932-3932/? A/DEBUG: #00 pc 0000000000045448 /data/app/com.netposa.tujie-2/lib/arm64/libmapbox-gl.so
2018-11-21 17:38:53.172 3932-3932/? A/DEBUG: #1 pc 00000000000468bc /data/app/com.netposa.tujie-2/lib/arm64/libmapbox-gl.so
2018-11-21 17:38:53.172 3932-3932/? A/DEBUG: #2 pc 0000000000046904 /data/app/com.netposa.tujie-2/lib/arm64/libmapbox-gl.so
2018-11-21 17:38:53.172 3932-3932/? A/DEBUG: #3 pc 0000000000126ac4 /data/app/com.netposa.tujie-2/lib/arm64/libmapbox-gl.so
2018-11-21 17:38:53.172 3932-3932/? A/DEBUG: #4 pc 00000000000ab234 /data/app/com.netposa.tujie-2/lib/arm64/libmapbox-gl.so
2018-11-21 17:38:53.172 3932-3932/? A/DEBUG: #5 pc 00000000000ab27c /data/app/com.netposa.tujie-2/lib/arm64/libmapbox-gl.so
2018-11-21 17:38:53.172 3932-3932/? A/DEBUG: #6 pc 00000000000a7e54 /data/app/com.netposa.tujie-2/lib/arm64/libmapbox-gl.so
2018-11-21 17:38:53.172 3932-3932/? A/DEBUG: #7 pc 00000000000875d0 /data/app/com.netposa.tujie-2/lib/arm64/libmapbox-gl.so
2018-11-21 17:38:53.172 3932-3932/? A/DEBUG: #8 pc 000000000008768c /data/app/com.netposa.tujie-2/lib/arm64/libmapbox-gl.so
2018-11-21 17:38:53.172 3932-3932/? A/DEBUG: #9 pc 0000000000089be8 /data/app/com.netposa.tujie-2/lib/arm64/libmapbox-gl.so
2018-11-21 17:38:53.173 3932-3932/? A/DEBUG: #10 pc 00000000000db790 /system/lib64/libart.so (art_quick_generic_jni_trampoline+144)
2018-11-21 17:38:53.173 3932-3932/? A/DEBUG: #11 pc 000000007262f9fc /data/dalvik-cache/arm64/system@framework@boot-core-libart.oat (offset 0x551000)

Steps to reproduce

Expected behavior

app runs normally when i operate the map

Actual behavior

Configuration

**Android versions: 7.0
**Device models: Honor V8
**Mapbox SDK versions: 6.7.1

@LukasPaczos
Copy link
Contributor

Thanks for reaching out and reporting the issue @yeguoqiang. Unfortunately, this stack trace is not actionable for us. Would you mind providing more information? Any reproduction steps or a small example project/code would be great.

@LukasPaczos LukasPaczos added Android Mapbox Maps SDK for Android needs information labels Nov 21, 2018
@treech
Copy link
Author

treech commented Nov 21, 2018

this is my code,and my app api version is minSdkVersion:19,targetSdkVersion:28
`public class SpjkActivity extends BaseActivity implements SpjkContract.View, OnMapReadyCallback, MapboxMap.OnMapClickListener, MapboxMap.OnMarkerClickListener {

@BindView(R2.id.ll_title)
LinearLayout mllTitle;
@BindView(R2.id.iv_camera)
ImageView mIvCamera;
@BindView(R2.id.tv_location_gereral)
TextView mTvLocationGeneral;
@BindView(R2.id.tv_location_detail)
TextView mTvLocationDetail;
@BindView(R2.id.iv_follow)
ImageView mIvFollow;
@BindView(R2.id.tv_follow)
TextView mTvFollow;
@BindView(R2.id.title_tv)
TextView mTVtTitle;
@BindView(R2.id.mapView)
MapView mMapView;
@BindView(R2.id.tv_notice)
TextView mTvNotice;

/**************************MAPBOX**************************/
//IntRange函数限定参数范围
private static final float ZOOM_IN_MAX = MapboxConstants.MAXIMUM_ZOOM;//缩小范围
private static final float ZOOM_OUT_MIN = MapboxConstants.MINIMUM_ZOOM;//放大范围
private float mCurrentZoomValue = DEFAULT_MAPBOX_CAMERAZOOM;//xml中默认大小(mapbox_cameraZoom)
private LatLng mCurrentLatlng;
private MapboxMap mMapboxMap;
//地图上被选中的camera
private String mActiveCameraId;
//缓存两个参数(camera点位、camera type)
List<Map<LatLng, OneKilometerCamerasResponseEntity>> mCamerasAttrCache = null;
//一公里范围圈内获取到的camera
List<OneKilometerCamerasResponseEntity> mCamerasCache;
/**************************MAPBOX**************************/
//底部弹出框
private BottomSheetBehavior<LinearLayout> mBottomSheetBehavior;
//底部弹出框是否关注设备
private boolean mIsFollow = false;
private LocationService mLocationService;
private OneKilometerCamerasResponseEntity mActiveCamera;
private Icon mBoxOnline, mDomeOnline, mDomeActive, mBoxActive;
private String mCarmeraName;
private int mCameraTypeInt;

@Inject
SpjkCollectionDeviceEntiry mSpjkCollectionDeviceEntiry;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Mapbox.getInstance(this, GlobalConstants.MAP_KEY);
    setContentView(R.layout.activity_spjk);
    mImmersionBar = ImmersionBar.with(this);
    mImmersionBar.statusBarColor(com.jess.arms.R.color.white)
            .statusBarDarkFont(true, 0.2f)
            .init();
    //绑定到butterknife
    ButterKnife.bind(this);

    KeyboardUtils.hideSoftInput(this);
    mPresenter.requestPermission();
    mMapView.onCreate(savedInstanceState);
    mMapView.getMapAsync(this);

    doLocation();
    mTVtTitle.setText(R.string.spjk);
}

@Override
protected void onStart() {
    super.onStart();
    mMapView.onStart();
}

@Override
protected void onResume() {
    super.onResume();
    mMapView.onResume();
}

@Override
public void onPause() {
    super.onPause();
    mMapView.onPause();
}

@Override
public void onStop() {
    super.onStop();
    mMapView.onStop();
}

@Override
public void onLowMemory() {
    super.onLowMemory();
    mMapView.onLowMemory();
}

@Override
protected void onDestroy() {
    super.onDestroy();
    if (mMapboxMap != null) {
        mMapboxMap.removeOnMapClickListener(this);
    }
    if (mMapView != null) {
        mMapView.onDestroy();
    }
}

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    mMapView.onSaveInstanceState(outState);
}

@OnClick({
        R2.id.iv_zoom_in,
        R2.id.iv_zoom_out,
        R2.id.iv_location,
        })
public void onViewClick(View view) {
    int id = view.getId();
    if (id == R.id.head_left_iv) {
        killMyself();
    } else if (id == R.id.iv_zoom_in) {
        if (mCurrentZoomValue < ZOOM_IN_MAX) {
            mCurrentZoomValue++;
            zoomInAndOut();
        }
    } else if (id == R.id.iv_zoom_out) {
        if (mCurrentZoomValue > ZOOM_OUT_MIN) {
            mCurrentZoomValue--;
            zoomInAndOut();
        }
    } else if (id == R.id.iv_location) {
        if (!isFastDoubleClick()) {
            doLocation();
            focusToCenterInMap();
        }
    }
}

private void zoomInAndOut() {
    if (mCurrentLatlng != null && mMapboxMap != null) {
        Log.d(TAG, "start to zoom,currentLatlng:" + mCurrentLatlng);
        CameraPosition position = new CameraPosition.Builder()
                .zoom(mCurrentZoomValue) // Sets the zoom
                .build(); // Creates a CameraPosition from the builder
        mMapboxMap.animateCamera(CameraUpdateFactory
                .newCameraPosition(position), 500);
    }
}

@Override
public void onMapReady(MapboxMap mapboxMap) {
    mMapboxMap = mapboxMap;
    mapboxMap.addOnMapClickListener(this);
    mapboxMap.setOnMarkerClickListener(this);
    //获取到系统的经纬度以后再上传至后台请求一公里范围内的摄像头
    mPresenter.getNeighbouringDevice(getCircleGeometryPoints());
    IconFactory iconFactory = IconFactory.getInstance(this);
    mBoxOnline = iconFactory.fromResource(R.drawable.ic_box_camera_online);
    mDomeOnline = iconFactory.fromResource(R.drawable.ic_dome_camera_online);
    mDomeActive = iconFactory.fromResource(R.drawable.ic_dome_camera_active);
    mBoxActive = iconFactory.fromResource(R.drawable.ic_box_camera_active);
    focusToCenterInMap();
}

/**
 * 锁定当前mobile定位的位置
 */
private void focusToCenterInMap() {
    CameraPosition position = new CameraPosition.Builder()
            .target(mCurrentLatlng) // Sets the new camera position
            .build(); // Creates a CameraPosition from the builder
    mMapboxMap.animateCamera(CameraUpdateFactory
            .newCameraPosition(position), 500);
}

//展示一公里范围圈
private void showOneKilometerBoundsArea() {
    PolygonOptions boundsArea = new PolygonOptions();
    List<Point> circleGeometry = getCircleGeometryPoints();
    for (Point point : circleGeometry) {
        LatLng latLng = new LatLng();
        latLng.setLatitude(point.latitude());
        latLng.setLongitude(point.longitude());
        boundsArea.add(latLng);
    }
    boundsArea.alpha(0.15f);
    boundsArea.fillColor(ContextCompat.getColor(this, R.color.app_theme_color));
    mMapboxMap.addPolygon(boundsArea);
}

private List<Point> getCircleGeometryPoints() {
    LatLng centerPoint;
    if (mCurrentLatlng != null) {
        centerPoint = mCurrentLatlng;
    } else {
        centerPoint = new LatLng(DEFAULT_LATITUDE, DEFAULT_LONGITUDE);
    }
    Log.d(TAG, centerPoint == mCurrentLatlng ? "定位成功" : "定位失败");
    return MapBoxUtil.getInstance().createCircleGeometry(centerPoint, 1000);
}

@Override
public void onMapClick(@NonNull LatLng point) {
    if (mBottomSheetBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED) {
        mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
    }
}

private void doLocation() {
    mLocationService = ARouter.getInstance().navigation(LocationService.class);
    Location location = getLocation();
    Log.e(TAG, "getLocation :" + location);
    if (location != null) {
        mCurrentLatlng = new LatLng(location.getLatitude(), location.getLongitude());
        Log.i(TAG, "location latitude: " + location.getLatitude() + ",longitude:" + location.getLongitude());
    } else {
        Log.e(TAG, "location is null");
    }
}

private Location getLocation() {
    if (mLocationService != null) {
        return mLocationService.getLocation();
    }
    return null;
}

@Override
public void onGetNeighbouringDeviceSuccess(List<OneKilometerCamerasResponseEntity> cameras) {
    if (cameras.size() == 0) {
        showMessage(getString(R.string.no_neighbouring_devices));
        Log.e(TAG, "no cameras get !!");
        return;
    }
    if (mMapboxMap == null) {
        showMessage(getString(R.string.map_not_ready));
        Log.e(TAG, "mapbox map do not ready !!");
        return;
    }
    mCamerasCache = cameras;
    mCamerasAttrCache = new ArrayList<>(cameras.size());
    Map<LatLng, OneKilometerCamerasResponseEntity> cameraAttr = new HashMap<>();
    MarkerOptions markerOptions = new MarkerOptions();
    //0枪机,1球机
    for (OneKilometerCamerasResponseEntity camera : cameras) {
        LatLng point = new LatLng(Double.valueOf(camera.getLatitude()), Double.valueOf(camera.getLongitude()));
        int cameraTypeInt = getCameraTypeInt(camera);
        cameraAttr.put(point, camera);
        mCamerasAttrCache.add(cameraAttr);
        if (cameraTypeInt == CAMERA_QIANG_JI) {
            markerOptions.icon(mBoxOnline);
        } else {
            markerOptions.icon(mDomeOnline);
        }
        markerOptions.position(point);
        mMapboxMap.addMarker(markerOptions);
    }
    // oneKilometer bounds area
    showOneKilometerBoundsArea();
}

@Override
public void onGetNeighbouringDeviceFail() {

}

@Override
public void checkDeviceSuccess(int count) {
    // 查询展示
    if (count > 0) {
        mIsFollow = true;//已经关注了
        setFollowImageResource(true);
    } else {
        setFollowImageResource(false);
    }
}

@Override
public void checkDeviceFail() {

}

//判断是否是快速点击(双击),保证多次点击只响应一次点击事件
private long lastClickTime = 0L; //上一次点击的时间

public boolean isFastDoubleClick() {
    long time = System.currentTimeMillis();
    long timeD = time - lastClickTime;
    if (timeD < 1000) {
        return true;
    }
    lastClickTime = time;
    return false;
}

@Override
public boolean onMarkerClick(@NonNull Marker activeMarker) {
    Log.d(TAG, "onMarkerClick");
    mCurrentLatlng = activeMarker.getPosition();
    if (mCamerasAttrCache != null) {
        for (Map<LatLng, OneKilometerCamerasResponseEntity> latLngListEntityMap : mCamerasAttrCache) {
            mActiveCamera = latLngListEntityMap.get(mCurrentLatlng);
            mActiveCameraId = mActiveCamera.getId();
            mCameraTypeInt = getCameraTypeInt(mActiveCamera);
            if (mCameraTypeInt == CAMERA_QIANG_JI) {
                activeMarker.setIcon(mBoxActive);
                return true;
            } else {
                activeMarker.setIcon(mDomeActive);
                return true;
            }
        }
    }
    return true;
}

}`

@treech
Copy link
Author

treech commented Nov 22, 2018

Thanks for reaching out and reporting the issue @yeguoqiang. Unfortunately, this stack trace is not actionable for us. Would you mind providing more information? Any reproduction steps or a small example project/code would be great.

hi, can you find any problems from this activity ? otherwise i have to upload my demo app code ?

@treech
Copy link
Author

treech commented Nov 23, 2018

Thanks for reaching out and reporting the issue @yeguoqiang. Unfortunately, this stack trace is not actionable for us. Would you mind providing more information? Any reproduction steps or a small example project/code would be great.

Hi,this is my demo app ,the map activity is SpjkActivity,please run in release version,or change ip(BASE_URL) in CommonSDK/build.gradle,Thank you !
https://github.com/yeguoqiang/Tujie

@LukasPaczos
Copy link
Contributor

Thanks for providing the demo! I was able to start the map and it's displayed with no issues, simply panning around, zooming in/out or backing off to the map from a different activity works as expected. Would you be able to provide reproduction steps?

@treech
Copy link
Author

treech commented Nov 26, 2018

Thanks for providing the demo! I was able to start the map and it's displayed with no issues, simply panning around, zooming in/out or backing off to the map from a different activity works as expected. Would you be able to provide reproduction steps?

would you tell me your device models and android api ?my demo app runs crash on device Honor V8 and Xiaomi 8,All my steps are bellow:
1.login in ->视频监控 module ->click into map activity ->start location->back ->click into map activity ->app crashs odds up to 80%

@LukasPaczos
Copy link
Contributor

@yeguoqiang I'm still unable to reproduce using the Pixel 2 XL or an emulator:
ezgif com-video-to-gif 21

Is there a different set of actions I need to follow than what is presented above in order to reproduce?

@Chaoba
Copy link
Contributor

Chaoba commented Nov 27, 2018

@yeguoqiang Could you please give us a test account? Couldn't reproduce it without login on Xiaomi 8.

@treech
Copy link
Author

treech commented Nov 27, 2018

@yeguoqiang Could you please give us a test account? Couldn't reproduce it without login on Xiaomi 8.
account:
admin
password:
a123456

login in step below:
debug version:click ip->click login button->login
release version:login

@Chaoba
Copy link
Contributor

Chaoba commented Nov 27, 2018

@yeguoqiang Still couldn't reproduce it, could you please recode a video and then turn it into a gif to recode how the crash happens? You can use this website to generate gif.

@HexarA
Copy link

HexarA commented Dec 4, 2018

Hi.. I'm getting the exact same crash on a Pixel 2 XL running MapBox SDK 6.7.1 on Android 9 also.

Here's a link to the stack trace.

Seems to happen mostly when exiting the fragment containing the MapView, but sometimes just when panning / animating between bounds. We are calling the appropriate onCreate/onResume/onPause/onStop/onDestroy methods.

EDIT: I was able to prevent this crash by calling MapView#onDestroy in the fragment's onDestroyView() instead of onDestroy(). So nevermind ;)

@Kaspisijus
Copy link

@HexarA saved my day with this. Was going through stack traces with no luck. Also experienced while having mapView in fragment. This should be mentioned somewhere in documentation that onDestroyView() should be using when running map in fragment

@stale stale bot added the archived Archived because of inactivity label Jan 14, 2020
@stale
Copy link

stale bot commented Jan 14, 2020

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Jan 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android archived Archived because of inactivity crash
Projects
None yet
Development

No branches or pull requests

6 participants