-
Notifications
You must be signed in to change notification settings - Fork 813
fix: prevent segfault on Linux if device isn't opened #2924
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
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe pull request enhances the USB communication handler by checking the result of the device open operation and aborting further setup if opening the device fails, preventing potential segfaults on Linux. Sequence diagram for improved device opening in USB communication handlersequenceDiagram
participant Handler as DesktopUSBCommunicationHandler
participant Device as UsbSerialDevice
participant Logger
Handler->>Device: open()
alt Device fails to open
Device-->>Handler: false
Handler->>Logger: e("Failed to open device")
Handler-->>Handler: return (abort setup)
else Device opens successfully
Device-->>Handler: true
Handler->>Device: setBaudRate(1000000)
Handler->>Device: setDataBits(dataBits8)
Handler->>Device: setStopBits(stopBits1)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build StatusBuild successful. APKs to test: https://github.com/fossasia/pslab-app/actions/runs/17850626378/artifacts/4053354979. Screenshots |
|
Is there an issue about this, which one? Please stick to best practices https://blog.fossasia.org/open-source-developer-guide-and-best-practices-at-fossasia/ |
45ebf6d to
a4e38fc
Compare
a4e38fc to
7839c80
Compare







-1_instruments_screen.png?raw=true)
-2_nav_drawer.png?raw=true)
-3_accelerometer.png?raw=true)
-4_power_source.png?raw=true)
-5_multimeter.png?raw=true)
-6_wave_generator.png?raw=true)
-7_oscilloscope.png?raw=true)
Fixes #2926
Summary by Sourcery
Prevent segmentation fault on Linux by verifying that the USB device opens successfully before configuring it
Bug Fixes: