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

SDK causing pthread kill when malloc #4607

Open
arnavgupta180 opened this issue Dec 10, 2024 · 2 comments
Open

SDK causing pthread kill when malloc #4607

arnavgupta180 opened this issue Dec 10, 2024 · 2 comments

Comments

@arnavgupta180
Copy link

arnavgupta180 commented Dec 10, 2024

Platform

macOS

Environment

Production

Installed

Swift Package Manager

Version

8.36

Xcode Version

15.4

Did it work on previous versions?

No response

Steps to Reproduce


Thread 34 Crashed:
0   libsystem_kernel.dylib               0x00007ff81b2e9202 __pthread_kill + 10
1   libsystem_pthread.dylib              0x00007ff81b320ee6 pthread_kill + 262
2   libsystem_c.dylib                    0x00007ff81b247b45 abort + 122
3   libsystem_malloc.dylib               0x00007ff81b15e752 malloc_vreport + 887
4   libsystem_malloc.dylib               0x00007ff81b173a08 malloc_zone_error + 182
5   libsystem_malloc.dylib               0x00007ff81b16c07c nanov2_guard_corruption_detected + 33
6   libsystem_malloc.dylib               0x00007ff81b16b37f nanov2_allocate_outlined + 384
7   libsystem_malloc.dylib               0x00007ff81b1530ae nanov2_calloc + 581
8   libobjc.A.dylib                      0x00007ff81af93ca5 0x7ff81af85000 + 60581
9   libobjc.A.dylib                      0x00007ff81af93b42 0x7ff81af85000 + 60226
10  libobjc.A.dylib                      0x00007ff81af938fa 0x7ff81af85000 + 59642
11  Sentry                               0x00000001079e8e2a +[SentrySDK currentHub] (SentrySDK.m:83)
12  Sentry                               0x00000001079ea9f9 +[SentrySDK addBreadcrumb:] (SentrySDK.m:398)
13  Sentry                               0x000000010797ab45 -[SentryBreadcrumbTracker connectivityChanged:typeDescription:] (SentryBreadcrumbTracker.m:153)
14  Sentry                               0x00000001079e17b2 SentryConnectivityCallback (SentryReachability.m:121)
15  SystemConfiguration                  0x00007ff81bf1fc28 reachPerformAndUnlock + 636
16  Network                              0x00007ff8220be81d __nw_path_necp_update_evaluator_block_invoke + 428
17  libdispatch.dylib                    0x00007ff81b17ed91 _dispatch_call_block_and_release + 11

Expected Result

App should not crash due to sentry

Actual Result

App getting crash

Are you willing to submit a PR?

yes

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Dec 10, 2024
@arnavgupta180 arnavgupta180 changed the title getting a crash in Sentry SDk getting a crash in Sentry SDk> currentHub Dec 10, 2024
@philipphofmann philipphofmann changed the title getting a crash in Sentry SDk> currentHub SDK causing pthread kill when malloc Dec 11, 2024
@philipphofmann
Copy link
Member

Similar stacktraces

Stacktrace 1

Due to sentry SDK app is getting crashed. 
Thread 0 Crashed:
0   libsystem_kernel.dylib               0x00007ff80aa5d14a __pthread_kill + 10
1   libsystem_pthread.dylib              0x00007ff80aa95ebd pthread_kill + 261
2   libsystem_c.dylib                    0x00007ff80a9bba79 abort + 125
3   libsystem_malloc.dylib               0x00007ff80a8c03a9 malloc_vreport + 856
4   libsystem_malloc.dylib               0x00007ff80a8e3c5b malloc_zone_error + 182
5   CoreFoundation                       0x00007ff80ab168f8 0x7ff80aaf7000 + 129272
6   Sentry                               0x000000010a1cce9c (anonymous namespace)::_sentry_threadUnsafe_transmitChunkEnvelope() (SentryContinuousProfiler.mm:54)
7   Sentry                               0x000000010a1cd342 +[SentryContinuousProfiler timerExpired] (SentryContinuousProfiler.mm:169)
8   Foundation                           0x00007ff80bb62c64 __NSFireTimer + 66
9   CoreFoundation                       0x00007ff80ab8e44c 0x7ff80aaf7000 + 619596
10  CoreFoundation                       0x00007ff80ab8dffa 0x7ff80aaf7000 + 618490
11  CoreFoundation                       0x00007ff80ab8dc36 0x7ff80aaf7000 + 617526
12  CoreFoundation                       0x00007ff80ab71f12 0x7ff80aaf7000 + 503570
13  CoreFoundation                       0x00007ff80ab71112 0x7ff80aaf7000 + 499986
14  HIToolbox                            0x00007ff81558aa09 RunCurrentEventLoopInMode + 291
15  HIToolbox                            0x00007ff81558a816 ReceiveNextEventCommon + 664
16  HIToolbox                            0x00007ff81558a561 _BlockUntilNextEventMatchingListInModeWithFilter + 65
17  AppKit                               0x00007ff80e1e1c61 _DPSNextEvent + 879
18  AppKit                               0x00007ff80eaf5dc0 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1272
19  AppKit                               0x00007ff80e1d3075 -[NSApplication run] + 602
20  AppKit                               0x00007ff80e1a6ff3 NSApplicationMain + 815
21  ???                                  0x00007ff80a70a366 0x0 + 0

Stacktace 2

Thread 0 Crashed:
0   libsystem_kernel.dylib               0x00007ff80aa5d14a __pthread_kill + 10
1   libsystem_pthread.dylib              0x00007ff80aa95ebd pthread_kill + 261
2   libsystem_c.dylib                    0x00007ff80a9bba79 abort + 125
3   libsystem_malloc.dylib               0x00007ff80a8c03a9 malloc_vreport + 856
4   libsystem_malloc.dylib               0x00007ff80a8e3c5b malloc_zone_error + 182
5   CoreFoundation                       0x00007ff80ab168f8 0x7ff80aaf7000 + 129272
6   Sentry                               0x000000010a1cce9c (anonymous namespace)::_sentry_threadUnsafe_transmitChunkEnvelope() (SentryContinuousProfiler.mm:54)
7   Sentry                               0x000000010a1cd342 +[SentryContinuousProfiler timerExpired] (SentryContinuousProfiler.mm:169)
8   Foundation                           0x00007ff80bb62c64 __NSFireTimer + 66
9   CoreFoundation                       0x00007ff80ab8e44c 0x7ff80aaf7000 + 619596
10  CoreFoundation                       0x00007ff80ab8dffa 0x7ff80aaf7000 + 618490
11  CoreFoundation                       0x00007ff80ab8dc36 0x7ff80aaf7000 + 617526
12  CoreFoundation                       0x00007ff80ab71f12 0x7ff80aaf7000 + 503570
13  CoreFoundation                       0x00007ff80ab71112 0x7ff80aaf7000 + 499986
14  HIToolbox                            0x00007ff81558aa09 RunCurrentEventLoopInMode + 291
15  HIToolbox                            0x00007ff81558a816 ReceiveNextEventCommon + 664
16  HIToolbox                            0x00007ff81558a561 _BlockUntilNextEventMatchingListInModeWithFilter + 65
17  AppKit                               0x00007ff80e1e1c61 _DPSNextEvent + 879
18  AppKit                               0x00007ff80eaf5dc0 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1272
19  AppKit                               0x00007ff80e1d3075 -[NSApplication run] + 602
20  AppKit                               0x00007ff80e1a6ff3 NSApplicationMain + 815
21  ???                                  0x00007ff80a70a366 0x0 + 0

Stacktrace 3


Thread 0 Crashed:
0   libsystem_kernel.dylib               0x00007ff80fd09b52 __pthread_kill + 10
1   libsystem_pthread.dylib              0x00007ff80fd43f85 pthread_kill + 261
2   libsystem_c.dylib                    0x00007ff80fc64b19 abort + 125
3   libsystem_malloc.dylib               0x00007ff80fb63975 malloc_vreport + 856
4   libsystem_malloc.dylib               0x00007ff80fb8b3aa malloc_zone_error + 182
5   CoreFoundation                       0x00007ff80fdcd180 0x7ff80fdad000 + 131456
6   Sentry                               0x000000010c7a550c -[SentryMetricProfiler clear] (SentryMetricProfiler.mm:214)
7   Sentry                               0x000000010c75fe9c (anonymous namespace)::_sentry_threadUnsafe_transmitChunkEnvelope() (SentryContinuousProfiler.mm:54)
8   Sentry                               0x000000010c760342 +[SentryContinuousProfiler timerExpired] (SentryContinuousProfiler.mm:169)
9   Foundation                           0x00007ff810e8e830 __NSFireTimer + 66
10  CoreFoundation                       0x00007ff80fe41b3e 0x7ff80fdad000 + 609086
11  CoreFoundation                       0x00007ff80fe416ec 0x7ff80fdad000 + 607980
12  CoreFoundation                       0x00007ff80fe41318 0x7ff80fdad000 + 607000
13  CoreFoundation                       0x00007ff80fe27f93 0x7ff80fdad000 + 503699
14  CoreFoundation                       0x00007ff80fe2708e 0x7ff80fdad000 + 499854
15  HIToolbox                            0x00007ff81b540ec3 RunCurrentEventLoopInMode + 291
16  HIToolbox                            0x00007ff81b5468a4 ReceiveNextEventCommon + 645
17  HIToolbox                            0x00007ff81b546a42 _BlockUntilNextEventMatchingListInModeWithFilter + 65
18  AppKit                               0x00007ff813741b7f _DPSNextEvent + 901
19  AppKit                               0x00007ff8141766b4 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1289
20  AppKit                               0x00007ff813732c59 -[NSApplication run] + 609
21  AppKit                               0x00007ff813705f96 NSApplicationMain + 822
22  ???                                  0x00007ff80f9b62cd 0x0 + 0

@philipphofmann
Copy link
Member

@arnavgupta180, thanks for reporting all the issues. I closed a couple of them cause they are all pointing to a potential memory problem. As already asked by @brustolin in #4615 (comment):

  1. Are these errors happening in production or during development?
  2. Are you using any custom memory management or tracking solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: Needs Discussion
Development

No branches or pull requests

2 participants