Skip to content

fix: explicitly check construct function error in thread_safe.h#5184

Merged
ReenigneArcher merged 1 commit into
LizardByte:masterfrom
Kishi85:explicitly-check-error-from-constructor
May 25, 2026
Merged

fix: explicitly check construct function error in thread_safe.h#5184
ReenigneArcher merged 1 commit into
LizardByte:masterfrom
Kishi85:explicitly-check-error-from-constructor

Conversation

@Kishi85
Copy link
Copy Markdown
Contributor

@Kishi85 Kishi85 commented May 25, 2026

Description

Explicitly check if the constructor was erroring out in thread_safe.h as the implicit writing does somehow not seem to catch all cases.

This is the reason for #5163 as the audio socket binding fails there. The constructor function (start_broadcast) is returning -1 in that case but instead of returning a nullptr ref it's using the created but broken broadcast_ctx instead from there on and continues to use it despite the broken audio_socket binding causing a segfault after a few retries.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@sonarqubecloud
Copy link
Copy Markdown

@Kishi85 Kishi85 changed the title fix: explicitly check constructor error in thread_safe.h fix: explicitly check construct function error in thread_safe.h May 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Bundle Report

Bundle size has no change ✅

@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 17.80%. Comparing base (dbce229) to head (ef65ac9).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/thread_safe.h 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5184      +/-   ##
==========================================
- Coverage   17.81%   17.80%   -0.01%     
==========================================
  Files         111      111              
  Lines       24143    24143              
  Branches    10687    10687              
==========================================
- Hits         4301     4299       -2     
+ Misses      14681    14667      -14     
- Partials     5161     5177      +16     
Flag Coverage Δ
Archlinux 11.19% <0.00%> (ø)
FreeBSD-aarch64 ?
FreeBSD-amd64 13.32% <0.00%> (+0.01%) ⬆️
Homebrew-ubuntu-22.04 13.53% <0.00%> (ø)
Linux-AppImage 12.11% <0.00%> (ø)
Windows-AMD64 14.85% <0.00%> (ø)
Windows-ARM64 13.19% <0.00%> (-0.01%) ⬇️
macOS-arm64 18.86% <0.00%> (ø)
macOS-x86_64 18.34% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/thread_safe.h 57.20% <0.00%> (ø)

... and 14 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dbce229...ef65ac9. Read the comment docs.

@ReenigneArcher ReenigneArcher merged commit b91ace7 into LizardByte:master May 25, 2026
73 of 74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Segfault if UDP port 48000 is taken

2 participants