Skip to content

fix: Disable Foxy separate compilation to avoid Boost.Asio ODR crash - #591

Merged
beekld merged 2 commits into
mainfrom
bklimt/SDK-2849/foxy-asio-odr-crash
Aug 4, 2026
Merged

fix: Disable Foxy separate compilation to avoid Boost.Asio ODR crash#591
beekld merged 2 commits into
mainfrom
bklimt/SDK-2849/foxy-asio-odr-crash

Conversation

@beekld

@beekld beekld commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Linking the C++ client into an app that uses Boost.Asio directly crashed the app under Boost >= 1.91. Foxy's separate-compilation mode (FOXY_FAST_BUILD) baked Asio's out-of-line internals into our library with a layout that diverges from a consumer's header-only Asio, producing an ODR violation. Under ASan this surfaces as a heap-buffer-overflow in the reactor mutex constructor. Force FOXY_FAST_BUILD=OFF so Asio stays header-only everywhere, matching how consumers compile it.

Fixes #590.


Note

Low Risk
CMake-only build configuration change with no runtime logic changes; primary effect is safer linking behavior for mixed SDK/consumer Asio builds.

Overview
Fixes crashes when apps link this SDK alongside their own Boost.Asio usage (notably Boost ≥ 1.91, issue #590).

The build now forces FOXY_FAST_BUILD=OFF before vendored Foxy is configured, so Foxy no longer enables separate compilation of Asio/Beast or links Foxy’s compiled asio.cpp/beast.cpp into the SDK. That keeps Asio header-only in the SDK artifact, aligned with typical consumer builds and avoiding ODR mismatches (e.g. ASan heap-buffer-overflow in reactor mutex setup).

The CURL networking target also drops the public BOOST_ASIO_SEPARATE_COMPILATION / BOOST_BEAST_SEPARATE_COMPILATION compile definitions that are no longer appropriate for this build mode.

Reviewed by Cursor Bugbot for commit 4392bb3. Bugbot is set up for automated code reviews on this repo. Configure here.

@beekld
beekld marked this pull request as ready for review August 4, 2026 00:52
@beekld
beekld requested a review from a team as a code owner August 4, 2026 00:52
@beekld
beekld merged commit 7332a7a into main Aug 4, 2026
50 checks passed
@beekld
beekld deleted the bklimt/SDK-2849/foxy-asio-odr-crash branch August 4, 2026 17:56
@github-actions github-actions Bot mentioned this pull request Aug 4, 2026
beekld pushed a commit that referenced this pull request Aug 4, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>launchdarkly-cpp-client: 3.11.4</summary>

##
[3.11.4](launchdarkly-cpp-client-v3.11.3...launchdarkly-cpp-client-v3.11.4)
(2026-08-04)


### Bug Fixes

* add defensive cycle guard to prerequisite evaluation
([#582](#582))
([c43057c](c43057c))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-internal bumped from 0.14.1 to 0.14.2
    * @launchdarkly/cpp-sse-client bumped from 0.7.0 to 0.7.1
</details>

<details><summary>launchdarkly-cpp-internal: 0.14.2</summary>

##
[0.14.2](launchdarkly-cpp-internal-v0.14.1...launchdarkly-cpp-internal-v0.14.2)
(2026-08-04)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-networking bumped from 0.2.0 to 0.2.1
</details>

<details><summary>launchdarkly-cpp-networking: 0.2.1</summary>

##
[0.2.1](launchdarkly-cpp-networking-v0.2.0...launchdarkly-cpp-networking-v0.2.1)
(2026-08-04)


### Bug Fixes

* Disable Foxy separate compilation to avoid Boost.Asio ODR crash
([#591](#591))
([7332a7a](7332a7a))
</details>

<details><summary>launchdarkly-cpp-server: 3.13.1</summary>

##
[3.13.1](launchdarkly-cpp-server-v3.13.0...launchdarkly-cpp-server-v3.13.1)
(2026-08-04)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-internal bumped from 0.14.1 to 0.14.2
    * @launchdarkly/cpp-sse-client bumped from 0.7.0 to 0.7.1
</details>

<details><summary>launchdarkly-cpp-server-dynamodb-source:
0.3.1</summary>

##
[0.3.1](launchdarkly-cpp-server-dynamodb-source-v0.3.0...launchdarkly-cpp-server-dynamodb-source-v0.3.1)
(2026-08-04)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-server bumped from 3.13.0 to 3.13.1
</details>

<details><summary>launchdarkly-cpp-server-otel: 0.1.5</summary>

##
[0.1.5](launchdarkly-cpp-server-otel-v0.1.4...launchdarkly-cpp-server-otel-v0.1.5)
(2026-08-04)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-server bumped from 3.13.0 to 3.13.1
</details>

<details><summary>launchdarkly-cpp-server-redis-source: 2.4.1</summary>

##
[2.4.1](launchdarkly-cpp-server-redis-source-v2.4.0...launchdarkly-cpp-server-redis-source-v2.4.1)
(2026-08-04)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-server bumped from 3.13.0 to 3.13.1
</details>

<details><summary>launchdarkly-cpp-sse-client: 0.7.1</summary>

##
[0.7.1](launchdarkly-cpp-sse-client-v0.7.0...launchdarkly-cpp-sse-client-v0.7.1)
(2026-08-04)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-networking bumped from 0.2.0 to 0.2.1
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Automated version and changelog updates only; behavioral changes are
small bug fixes already described in release notes (prerequisite cycle
guard, networking build fix).
> 
> **Overview**
> **Release Please** cut that bumps versions across the monorepo and
records what shipped since the last tags—no new feature code in this
diff beyond version metadata and changelog entries.
> 
> **Client SDK 3.11.4** includes a **defensive cycle guard** during
prerequisite evaluation (avoids unbounded recursion on cyclic
prerequisite graphs) and pulls updated **internal** and **SSE client**
dependencies.
> 
> **Networking 0.2.1** documents a fix that **disables Foxy separate
compilation** to prevent a **Boost.Asio ODR crash**; **SSE client
0.7.1** and **internal 0.14.2** depend on that networking bump.
> 
> **Server SDK 3.13.1** and the **Redis / DynamoDB / OTEL** extension
packages are patch releases that align with those dependency updates.
**Common** stays at **1.12.0**.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
d75af83. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

Application using Boost.Asio crashes when linked with Launch Darkly C++ Client

2 participants