mParticle / mparticle-apple-sdk

mParticle Apple SDK
Apache License 2.0
46 stars 66 forks source link

Crash EXC_BAD_ACCESS [MPMessageBuilder withLocation:] #256

Open AnilVarghese opened 8 months ago

AnilVarghese commented 8 months ago

Since updated to v8.18.0, we are seeing an occasional crash in the SDK

CrashReporter Key:  f328923fa2d7f274b443b2aee2539d224740a677
Hardware Model:     iPhone9,3
Process:            Glover
Identifier:         com.glovo.glover
Version:            2.219.0
Role:               Background
OS Version:         iOS 15.8
Exception Type:     EXC_BAD_ACCESS 
Exception Subtype:  KERN_INVALID_ADDRESS

EXC_BAD_ACCESS: Attempted to dereference garbage pointer 0xe9cca61a0.

0  libobjc.A.dylib +0x2d20         _objc_release
1  mParticle_Apple_SDK +0x74148    -[MPMessageBuilder withLocation:] (MPMessageBuilder.m:414:1)
2  mParticle_Apple_SDK +0x1d340    -[MPBackendController confirmEndSessionMessage:] (MPBackendController.m:266:26)
3  mParticle_Apple_SDK +0x205ac    -[MPBackendController uploadOpenSessions:completionHandler:] (MPBackendController.m:751:9)
4  mParticle_Apple_SDK +0x1e7a0    -[MPBackendController processOpenSessionsEndingCurrent:completionHandler:] (MPBackendController.m:443:5)
5  mParticle_Apple_SDK +0x28338    __43-[MPBackendController endSessionIfTimedOut]_block_invoke (MPBackendController.m:2076:13)
6  libdispatch.dylib +0x63090      __dispatch_call_block_and_release
7  libdispatch.dylib +0x64090      __dispatch_client_callout
8  libdispatch.dylib +0xa738       __dispatch_lane_serial_drain$VARIANT$mp
9  libdispatch.dylib +0xb1f0       __dispatch_lane_invoke$VARIANT$mp
10 libdispatch.dylib +0x14ec4      __dispatch_workloop_worker_thread
11 libsystem_pthread.dylib +0x1dfc __pthread_wqthread

Crash report from Xcode

einsteinx2 commented 8 months ago

Thank you for your report. I'll get a bug opened internally to investigate this.

einsteinx2 commented 8 months ago

@AnilVarghese I took a look at what's in the 8.18.0 release and there's nothing related to this code that changed, so if this was a regression it must have been introduced in an earlier release. Can you please confirm what version you were using before updating to 8.18.0? Thanks.

einsteinx2 commented 8 months ago

Tracking internally as https://go.mparticle.com/work/SQDSDKS-6174

AnilVarghese commented 8 months ago

@einsteinx2 It actually started from version 8.17.0 , sorry for the wrong info before. We were on 8.11.2 and when updated to 8.17.0 this crash started happening for some users.

einsteinx2 commented 8 months ago

Thank you I'll add that to our internal ticket. We will be looking into this soon.