with possible solution! SIGSEGV in AudioRecord::getMinFrameCount on ARMv7 on Android 11 #3963

Closed
opened 2026-02-21 01:44:53 -05:00 by deekerman · 1 comment
Owner

Originally created by @aantnn on GitHub (Jan 31, 2026).

Bug Description

Build debug version of rustdesk commit 96075fdf49

Verified:
Set a breakpoint in lldb at android::AudioRecord::getMinFrameCount.
Manually setting in lldb r2 to 0x1 (AUDIO_FORMAT_PCM_16_BIT) via expr $r2 = 1 before continuing allows the function to return successfully without a crash and start streaming successfully.

Description
A segmentation fault occurs in libaudioclient.so when initializing recording on ARMv7 devices.
Architecture: ARMv7 (32-bit)
Component: android.media.AudioRecord / libaudioclient.so
Context: RustDesk / Flutter Audio Plugin

Debug Trace Analysis
The crash occurs at android::AudioRecord::getMinFrameCount. Inspection of the ARM registers at the time of the call revealed:

r0: 0xfffd9530 (Output pointer)
r1: 0x0000bb80 (Sample Rate: 48000)
r2: 0x00000005 (Format: AUDIO_FORMAT_PCM_FLOAT)
r3: 0x0000000c (Channel Mask: Stereo)

Root Cause

The AUDIO_FORMAT_PCM_FLOAT (value 0x5) is not supported by the underlying hardware abstraction layer or the libaudioclient implementation on this specific ARMv7 SoC. When this format is passed, the native function attempts to access an invalid memory address or performs an illegal operation (likely a division by zero or a null-pointer dereference) while calculating frame sizes.

Attach LLDB to the process on an ARMv7 device.
Set a breakpoint at android::AudioRecord::getMinFrameCount.
Observe that r2 is set to 0x5.
Executing continue results in a SIGSEGV.
Workaround Verified: Manually setting r2 to 0x1 (AUDIO_FORMAT_PCM_16_BIT) via expr $r2 = 1 before continuing allows the function to return successfully without a crash.

How to Reproduce

Start stream

Expected Behavior

Start streaming

Operating system(s) on local (controlling) side and remote (controlled) side

Android -> Android 11

RustDesk Version(s) on local (controlling) side and remote (controlled) side

commit 96075fdf49

Screenshots

Image

Additional Context

No response

Originally created by @aantnn on GitHub (Jan 31, 2026). ### Bug Description Build debug version of rustdesk commit 96075fdf4969cf19f619f75e11b5a5a14c02aafa Verified: Set a breakpoint in lldb at `android::AudioRecord::getMinFrameCount`. Manually setting in lldb `r2 to 0x1` (`AUDIO_FORMAT_PCM_16_BIT`) via `expr $r2 = 1` before continuing allows the function to return successfully without a crash and start streaming successfully. Description A segmentation fault occurs in libaudioclient.so when initializing recording on ARMv7 devices. Architecture: ARMv7 (32-bit) Component: android.media.AudioRecord / libaudioclient.so Context: RustDesk / Flutter Audio Plugin Debug Trace Analysis The crash occurs at android::AudioRecord::getMinFrameCount. Inspection of the ARM registers at the time of the call revealed: ``` r0: 0xfffd9530 (Output pointer) r1: 0x0000bb80 (Sample Rate: 48000) r2: 0x00000005 (Format: AUDIO_FORMAT_PCM_FLOAT) r3: 0x0000000c (Channel Mask: Stereo) ``` Root Cause The `AUDIO_FORMAT_PCM_FLOAT` (value 0x5) is not supported by the underlying hardware abstraction layer or the libaudioclient implementation on this specific ARMv7 SoC. When this format is passed, the native function attempts to access an invalid memory address or performs an illegal operation (likely a division by zero or a null-pointer dereference) while calculating frame sizes. Attach LLDB to the process on an ARMv7 device. Set a breakpoint at `android::AudioRecord::getMinFrameCount`. Observe that `r2 is set to 0x5`. Executing continue results in a `SIGSEGV`. Workaround Verified: Manually setting `r2 to 0x1` (AUDIO_FORMAT_PCM_16_BIT) via `expr $r2 = 1` before continuing allows the function to return successfully without a crash. ### How to Reproduce Start stream ### Expected Behavior Start streaming ### Operating system(s) on local (controlling) side and remote (controlled) side Android -> Android 11 ### RustDesk Version(s) on local (controlling) side and remote (controlled) side commit 96075fdf4969cf19f619f75e11b5a5a14c02aafa ### Screenshots <img width="3693" height="2083" alt="Image" src="https://github.com/user-attachments/assets/04ce63f5-66d9-4649-9085-42c20695aab9" /> ### Additional Context _No response_
deekerman 2026-02-21 01:44:53 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@rustdesk commented on GitHub (Jan 31, 2026):

#763

@rustdesk commented on GitHub (Jan 31, 2026): #763
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rustdesk-rustdesk#3963
No description provided.