Repository navigation
Conversation
serenity inflates every gateway payload through flate2's default `rust_backend` (miniz_oxide + simd-adler32). That stack is implicated in post-connect SIGSEGVs on x86_64 macOS release builds (openabdev#1531 saw the fault inside miniz_oxide::inflate in ShardRunner; openabdev#1535 saw it surface in handle_config_command during post-connect command sync). Force flate2's `zlib` feature whenever the `discord` feature is enabled. `any_c_zlib` outranks `rust_backend` in flate2's backend selection, so all flate2 users in the build (gateway decompress, png, zip/pre-seed) move to the OS zlib. This removes the pure-Rust decompressor from the gateway hot path at the cost of linking the platform libz, which is always present on supported targets. Refs openabdev#1535 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
Caution This PR is missing a Discord Discussion URL in the body. All PRs must reference a prior Discord discussion to ensure community alignment before implementation. Please edit the PR description to include a link like: |
|
🔒 Auto-closing: this PR has had the If you'd like to continue working on this, please submit a new PR and link to this one if necessary. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
flate2with its defaultrust_backend(miniz_oxide+simd-adler32). That stack is implicated in the post-connect SIGSEGVs reported on x86_64 macOS release builds in SIGSEGV on x86_64 macOS after commit 843bb729 (observer/lobby Phase 1 scaffold) — Discord gateway crash loop #1531 (fault insideminiz_oxide::inflateinShardRunner) and SIGSEGV in discord::Handler::handle_config_command after connect — 0.10.0-beta.4 release binary (macOS x86_64) #1535 (crash surfacing inhandle_config_commandduring post-connect command sync).discordfeature now enables openab-core'sflate2dep with thezlibfeature.any_c_zliboutranksrust_backendin flate2's backend selection, so all flate2 users in the build move to the OS zlib — removing the pure-Rust decompressor from the gateway hot path.tests/discord_gateway_zlib.rsasserts the manifest wiring andlibz-syslockfile resolution.cargo fmt --allnormalization commit plus aworkspace_fmt_hygieneguard test are included because the tree had drifted fromcargo fmt --all -- --checkunder current stable rustfmt (same drift fixed on the issue-1538 branch).Refs #1535
Review Contract
Goal
Stop the post-connect SIGSEGVs on x86_64 macOS builds by removing
miniz_oxide/simd-adler32from serenity's gateway decompression path, via a dependency-feature change with no runtime code changes.Non-goals
miniz_oxide::inflatecrash). If a crash persists on builds containing this change, it is a different defect.simd-adler32source modifications.miniz_oxidefrom the dependency graph entirely — other users (png/zip) still pull it; flate2 simply prefers the C backend at runtime.Accepted Residual Risks
discord/pre-seed(libz-sysvendors bundled zlib viaccwhen the system library is absent). Mitigation: all pinned CI/Docker build images (rust:1-bookworm, nightly-build) ship gcc andzlib1g..ipscrash logs.Acceptance Criteria
tests/discord_gateway_zlib.rspasses:discordfeature includesdep:flate2withzlibfeature, andCargo.lockresolveslibz-sys.cargo fmt --all -- --check,cargo test --workspace, andcargo clippy --workspace --all-targets -- -D warningspass on the candidate and on a clean detached replay (all verified).windows-gnucross-check attempted: cannot run in this environment (pre-existingx86_64-w64-mingw32-gccabsence;ringbuild script fails identically at base).libz-syssupports mingw targets via bundled zlib.Follow-ups
.ipslogs if crashes persist.default-features = falseto the flate2 dep to drop the deadrust_backendcode when it is the sole declarer (cosmetic; serenity/png still request it in practice).Generated with Devin