maps icon indicating copy to clipboard operation
maps copied to clipboard

[Bug]: iOS crash [SIGTRAP & SIGILL]

Open iboy15 opened this issue 10 months ago • 4 comments

Mapbox Implementation

Mapbox

Mapbox Version

10.1.37

React Native Version

0.73.6

Platform

iOS

@rnmapbox/maps version

10.1.37

Standalone component to reproduce

import React from 'react';
import {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
} from '@rnmapbox/maps';

const aLine = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}}>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
        <ShapeSource id="idStreetLayer" shape={aLine}>
          <LineLayer id="idStreetLayer" />
        </ShapeSource>
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

No response

Expected behavior

no crash

Notes / preliminary analysis

No response

Additional links and references

  • Crash Type: SIGTRAP exception
  • Affected Components: MapboxCoreMaps, MapboxCommon The crash occurred in Thread 0 with the following key findings:
  1. The crash originated in the MapboxCoreMaps framework during a map rendering operation
  2. The stack trace shows involvement of both MapboxCoreMaps (0x106fc0000) and MapboxCommon (0x106ca4000) frameworks
  3. The crash appears to be related to the map's core functionality, possibly during an animation or rendering cycle This crash report provides sufficient information to create a detailed issue report for Mapbox's GitHub repository, highlighting a potential issue in the map rendering pipeline that causes a SIGTRAP exception in production environments.

iboy15 avatar Mar 12 '25 12:03 iboy15

I am seeing the same on 10.1.36, React Native 0.74.5, Expo 51

Module Address Function / Location Notes
Birda +0x25f96cc closure in RNMBXMapView.setupEvents () In App
Birda +0x25f5f50 closure in RNMBXMapView.onEvery<T> In App
Birda +0x25ff634 closure in RNMBXMapView.onNext<T> () In App
MapboxMaps +0x00b054c closure in MapboxObservable.onNext<T> In App
MapboxMaps +0x00b1ad0 closure in MapboxObservable.onNext<T> () In App
MapboxMaps +0x00b06a4 MapboxObservable.BlockObserver.notify (MapboxObservable.swift:166) In App
MapboxMaps +0x00b06a4 MapboxObservable.BlockObserver.notify (:165) In App
MapboxCoreMaps +0x00297f0 mapbox::bindgen::mapbox::maps::Observer::notify In App
MapboxCoreMaps +0x0095640 mapbox::maps::ObserverWrapper::notify In App
MapboxCoreMaps +0x0560d14 std::__1::__function::__func<T>::operator()
MapboxCommon +0x004dc94 mapbox::common::platform::taskScope In App
CoreFoundation +0x00c90e4 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
CoreFoundation +0x00d4d58 __CFRunLoopDoSource0
CoreFoundation +0x0060018 __CFRunLoopDoSources0
CoreFoundation +0x0075134 __CFRunLoopRun
CoreFoundation +0x0079d1c CFRunLoopRunSpecific
GraphicsServices +0x0001994 GSEventRunModal
UIKitCore +0x0371348 -[UIApplication _run]
UIKitCore +0x0370fc0 UIApplicationMain
Birda +0x0008410 main (main.m:7) In App
0x1a97b4344

On closer inspection, the problem in RNMBXMapView.setupEvents looks to occur on line 1109

default	11:14:17.437761+0100	ReportCrash	ASI found [libswiftCore.dylib] (sensitive) 'rnmapbox_maps/RNMBXMapView.swift:1109: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
self.addFeaturesToMap(style: self.mapboxMap.style)

shedworth avatar Apr 08 '25 08:04 shedworth

Rolling back to 10.1.32 fixes the issue for me

shedworth avatar Apr 09 '25 13:04 shedworth

My application is also exhibiting this same bug sometimes based on the logs from my users. I've tried bumping them to 10.1.38 and it still occurs. Expo 52.0.42 and react native 0.76.9. @shedworth , did you also try versions 10.1.33-35 when you were rolling back? Or it only seemed to resolve when you went all the way to 10.1.32?

I cannot actually reproduce this myself with the iOS simulator, or I would try to check each version.

devguy22 avatar Apr 15 '25 18:04 devguy22

@devguy22 I didn't try every version, just rolled back to the earliest version I could get away with.

shedworth avatar Apr 16 '25 08:04 shedworth

Is this something still happening? Can this be reproduced, or happens only on user devices?

mfazekas avatar Sep 20 '25 06:09 mfazekas

Using the latest version of rnmapbox, I haven't observed any of my users still having this issue. But it wasn't reliably reproducible before either (for me).

devguy22 avatar Oct 06 '25 13:10 devguy22