-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Issue and Steps to Reproduce
- Connect to a muscleBAN device using PLUX-API-Python3/Linux64/plux.so and example code of this repository.
- Once connection is established and stable, obstruct the Bluetooth connection (with your hands around the physical muscleBAN or by moving it out of range) for a short time Y depending on sample rate/frequency (see graph below).
- Immediately unblock the muscleBAN to reestablish Bluetooth connection.
- Depending on the length Y of the timeout, now one of three things will happen:
- (OK) If the timeout Y was shorter than the time in the graph below, the streaming of samples continues without any issues or errors.
- (OK) If the timeout Y was much larger, it will more likely raise a
RuntimeError: The communication with the device was lost. - (Not OK) If the timeout Y was only slightly larger than in the graph, one of various C/C++ memory errors occur, and Python crashes completely:
munmap_chunk(): invalid pointermalloc(): unaligned fastbin chunk detectedmalloc(): unaligned tcache chunk detectedmalloc_consolidate(): invalid chunk sizecorrupted size vs. prev_size in fastbins- Quiet crash with no message at all
Further details
- Crash occurs in both Python 3.9 and 3.13.
- Crash occurs in both Ubuntu 20.04 LTS and CachyOS (Arch Linux-based).
- Crash occurs independent of which muscleBAN device is used.
- Behavior get worse with higher sample rates/frequencies set for the muscleBAN. I tested this with different sample rates:

Workaround
- Downgrading the
plux.sofile from version 1.9 to 1.7 found in the file history of this repository fixes the issue and consistently raises expectedRuntimeError: The communication with the device was lost.instead of crashing.
Metadata
Metadata
Assignees
Labels
No labels