-
Notifications
You must be signed in to change notification settings - Fork 14
AddressSanitizer: CHECK failed: sanitizer_posix.cpp:61 #17
Description
Hi, I am trying to integrate the Flurry SDK and it crashes several seconds after my app starts. I was able to reproduce the crash with a basic test project with Flurry as the only dependency. It appears there is an address sanitization issue that Xcode catches. One can work around this issue by turning off Runtime Sanitization but I have needed to use that to debug a few issues in some C code bundled with our app. In the interim I will probably just comment out the Flurry init code if I need to debug something with address sanitization turned on. If there's any other info you need, let me know. Below are the steps to reproduce.
Versions
Flurry 12.1.3
Swift 5
Targeting iOS 16.0
Running on real device running 16.1.1
MacOS 12.6
Xcode 14.0.1
- Create a new SwiftUI project
- Add the Flurry dependency per the README instructions (using the Swift package)
- Edit the scheme used to run it, and enable
Runtime Sanitizationand theDetect use of stack after returnoption within theDiagnosticstab for that scheme - Insert the following in the main App file and run it:
import SwiftUI
import UIKit
import Flurry_Config
import Flurry_iOS_SDK
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
let sb = FlurrySessionBuilder()
.build(logLevel: FlurryLogLevel.all)
.build(crashReportingEnabled: true)
.build(appVersion: Bundle.main.appVersion)
Flurry.startSession(apiKey: "API_KEY_GOES_HERE", sessionBuilder: sb)
return true
}
}
@main
struct flurrytestApp: App {
// inject ApplicationDelegate into the SwiftUI lifecycle
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
WindowGroup {
VStack {
Text("Hello, world!")
}
.padding()
}
}
}Crash output is:
[3A1F73BF-5C70-4AF7-BE8E-5CC46922BAE6]
2022-11-22 07:16:24.113528-0600 flurrytest[68232:4139969] -[FlurryStreamCoreBuffer streamMessage:]: msg = <FlurryStreamPreviousReport: 0x10b0007a0, type = 166, json = { "fl.frame.version" : 1, "fl.report.previous.success" : true }>
2022-11-22 07:16:24.117458-0600 flurrytest[68232:4139977] FlurryDataSender: Not sent blocks count [0]
2022-11-22 07:16:24.117665-0600 flurrytest[68232:4139977] -[FlurryBackgroundTaskTracker stopBackgroundTasksTracking]: stop background task
2022-11-22 07:16:24.133335-0600 flurrytest[68232:4139977] [tcp] tcp_input [C2.1.1.1:3] flags=[R] seq=1245760913, ack=0, win=0 state=CLOSED rcv_nxt=1245760913, snd_una=3560979046
==68232==ERROR: AddressSanitizer failed to deallocate 0x10000 (65536) bytes at address 0x000105914800
AddressSanitizer: CHECK failed: sanitizer_posix.cpp:61 "(("unable to unmap" && 0)) != (0)" (0x0, 0x0) (tid=4139970)
<empty stack>
warning: hit breakpoint while running function, skipping commands and conditions to prevent recursion
AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report.