Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in VitalCPUReader.swift: arithmetic overflow #1181

Closed
lfurukawa-ml opened this issue Feb 27, 2023 · 5 comments
Closed

Crash in VitalCPUReader.swift: arithmetic overflow #1181

lfurukawa-ml opened this issue Feb 27, 2023 · 5 comments
Assignees
Labels
crash SDK crashes

Comments

@lfurukawa-ml
Copy link

The crash

Hey guys,
We are seeing an Swift runtime failure: arithmetic overflow error on our crash reporting tool, in the class VitalCPUReader.swift

As we did not find any issue related to this class, I'm opening this one. Unfortunately, we've still not been able to trigger/reproduce the problem.
Could you help us figure out this issue?
Thanks in advance!

Hardware Model:     iPhone9,4
Version:            2.259.1
Role:               Foreground
OS Version:         iOS 15.4.1
Exception Type:     EXC_BREAKPOINT 
Exception Subtype:  KERN_INVALID_ADDRESS

EXC_BREAKPOINT: 

0  Datadog +0x181cf4               Swift runtime failure: arithmetic overflow (VitalCPUReader.swift:24:46)
1  Datadog +0x181df0               protocol witness for SamplingBasedVitalReader.readVitalData() in conformance VitalCPUReader (<compiler-generated>)
2  Datadog +0x182268               VitalInfoSampler.takeSample() (VitalInfoSampler.swift:86:41)
3  Datadog +0x13b1b0               specialized VitalInfoSampler.init(cpuReader:memoryReader:refreshRateReader:frequency:maximumRefreshRate:) (VitalInfoSampler.swift:66:9)
4  Datadog +0x158770               VitalInfoSampler.init(cpuReader:memoryReader:refreshRateReader:frequency:maximumRefreshRate:) (<compiler-generated>)
5  Datadog +0x13954c               specialized RUMViewScope.init(isInitialView:parent:dependencies:identity:path:name:attributes:customTimings:startTime:serverTimeOffset:) (RUMViewScope.swift)
6  Datadog +0x138b80               RUMSessionScope.process(command:context:writer:) (RUMSessionScope.swift:143:13)
7  Datadog +0xc0c48                protocol witness for RUMScope.process(command:context:writer:) in conformance RUMSessionScope (<compiler-generated>)
8  Datadog +0x12d034               closure #1 in closure #1 in RUMMonitor.process(command:) (RUMMonitor.swift:614:43)
9  Datadog +0x6573c                thunk for @callee_guaranteed () -> () (<compiler-generated>)
10 Datadog +0x6575c                thunk for @escaping @callee_guaranteed () -> () (<compiler-generated>)
11 libdispatch.dylib +0x64090      __dispatch_client_callout
12 libdispatch.dylib +0x1195c      __dispatch_lane_barrier_sync_invoke_and_complete
13 Datadog +0x12cf08               closure #1 in RUMMonitor.process(command:) (RUMMonitor.swift:611:24)
14 Datadog +0x72eac                partial apply for closure #1 in RUMMonitor.process(command:) (<compiler-generated>)
15 Datadog +0x72fd8                $s7Datadog10RUMMonitorC7process7commandyAA10RUMCommand_p_tFyAA0A7ContextV_AA6Writer_ptcfU_TA.55
16 Datadog +0x60b40                closure #1 in DatadogCoreFeatureScope.eventWriteContext(bypassConsent:_:) (DatadogCore.swift:407:21)
17 Datadog +0x5d55c                closure #1 in DatadogContextProvider.read(block:) (DatadogContextProvider.swift:108:23)
18 Datadog +0x128838               thunk for @escaping @callee_guaranteed () -> () (<compiler-generated>)
19 libdispatch.dylib +0x63090      __dispatch_call_block_and_release
20 libdispatch.dylib +0x64090      __dispatch_client_callout
21 libdispatch.dylib +0xa734       __dispatch_lane_serial_drain$VARIANT$mp
22 libdispatch.dylib +0xb1ec       __dispatch_lane_invoke$VARIANT$mp
23 libdispatch.dylib +0x14ec0      __dispatch_workloop_worker_thread
24 libsystem_pthread.dylib +0x1e0c __pthread_wqthread

Datadog SDK versions:

1.14.0

Last stable Datadog SDK version:

It is our first release using Datadog's RUM SDK

Volume:

What % of your app sessions is impacted with this crash?
On average, 60 sessions of 60 users, per day

OS version:

Seen more frequently on:

  • iOS 15.7.3 (43,5%)
  • iOS 16.3.1 (6,4%)
  • iOS 16.2 (5,7%)

Deployment Target:

iOS 13, iPhone

Device version:

Seen more frequently on:

  • iPhone 7 (17%)
  • iPhone 7 Plus (12,4%)
  • iPhone 6S (12%)
  • iPhone 11 (9,4%)
  • iPhone 7 Plus (CDMA) (9%)

Environment:

80,6% of crashes happening on startup

@lfurukawa-ml lfurukawa-ml added the crash SDK crashes label Feb 27, 2023
@maciejburda
Copy link
Member

Thanks for reporting @lfurukawa-ml.

It's very likely related to this: #1177
Our team is looking into the issue. I'll let you know as soon as the fix is deployed.

@lfurukawa-ml
Copy link
Author

hey @maciejburda,
it definitely seems related to the issue you mentioned! thanks for the update!
we're looking forward to this deployment 😄

@maciejburda
Copy link
Member

@lfurukawa-ml

We just released new version 1.16.0 with the fix.
Please take a look.

@maciejburda maciejburda self-assigned this Mar 2, 2023
@lfurukawa-ml
Copy link
Author

Thanks @maciejburda we are going to test this new version in our next week's release

@cltnschlosser
Copy link
Contributor

Starting to get enough traffic, I think I can say this is solved on my end. Thanks for the quick responses!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash SDK crashes
Projects
None yet
Development

No branches or pull requests

3 participants