superpoweredSDK / Low-Latency-Android-iOS-Linux-Windows-tvOS-macOS-Interactive-Audio-Platform

🇸Superpowered Audio, Networking and Cryptographics SDKs. High performance and cross platform on Android, iOS, macOS, tvOS, Linux, Windows and modern web browsers.
https://superpowered.com
1.34k stars 285 forks source link

Crashes type EXC_BAD_ACCESS KERN_INVALID_ADDRESS, SuperpoweredIOSAudioIO incorrect data writing #787

Open AndrewRudyk opened 2 weeks ago

AndrewRudyk commented 2 weeks ago

Superpowered version: 2.6.6

Describe the bug My app uses Superpowered SDK to create different effects: AutomaticVocalPitchCorrection, ThreeBandEQ, TimeStretching, Bitcrusher, etc. Now I have a lot of reports from Firebase Crashlytics

image image

A lot of problems arise in the variable "samplerate" from class SuperpoweredIOSAudioIO that comes with the SDK.

Xcode shows a lot of Warnings in this class, for example "This code path does interprocess communication underneath which can cause non-deterministic delays. Investigate ways to do this work off the main thread

There are reports of this code path causing UI hangs. See Xcode Organizer for details . Look for the report that shows calls to -[AVAudioSession currentRoute] underneath"

I think that SuperpoweredIOSAudioIO writes incorrect data to the samplerate variable, which is then used by other SuperpoweredSDK objects.

Can you fix this?

Steps to Reproduce Due to the nature of the bug, the reproduction paths vary, and the crash does not happen predictably, making it challenging to outline specific steps to trigger the issue.

Device information Please list which devices have this bug.

ivannador commented 1 week ago

Could you please try with the latest update to the SuperpoweredIOSAudioIO class?

https://github.com/superpoweredSDK/Low-Latency-Android-iOS-Linux-Windows-tvOS-macOS-Interactive-Audio-Platform/commit/caf2102570ba86997cced5e47a6a9090031c166a

AndrewRudyk commented 1 week ago

Could you please try with the latest update to the SuperpoweredIOSAudioIO class?

caf2102

Hello! I'll check it and get back to you with the results. We will have more results after we release the app. Thank you.

AndrewRudyk commented 2 days ago

Hello, I updated Superpowered SDK to 2.2.8 and sent our app to AppStore. And I see current statistics in Firebase,

image image image image

But something still goes wrong:)

I saw comment in SuperpoweredIOSAudioIO

image

Perhaps this problem is still too common

gaborszanto commented 2 days ago

Some memory handling is wrong in your Superpowered.mm file, and therefore the Superpowered features you're using are crashing. Please check your buffer sizes.