GUACAMOLE-2264: Set CMAKE_BUILD_TYPE=Release for FreeRDP production builds.#660
Open
escra wants to merge 1 commit intoapache:staging/1.6.1from
Open
GUACAMOLE-2264: Set CMAKE_BUILD_TYPE=Release for FreeRDP production builds.#660escra wants to merge 1 commit intoapache:staging/1.6.1from
escra wants to merge 1 commit intoapache:staging/1.6.1from
Conversation
Without an explicit build type, CMake defaults to an empty configuration which leaves WINPR_ASSERT runtime assertions enabled. These assertions call abort() on unexpected conditions, silently killing guacd child processes without any log output. Setting Release mode disables the assertions, enables compiler optimizations, and matches how Linux distributions package FreeRDP.
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
The official Dockerfile builds FreeRDP without specifying
CMAKE_BUILD_TYPE.CMake defaults to an empty build type, which in FreeRDP's case enables
WINPR_ASSERTruntime assertions (equivalent toWITH_VERBOSE_WINPR_ASSERT=ON).When FreeRDP encounters any unexpected condition at runtime,
WINPR_ASSERTcalls
abort(), which sendsSIGABRTto the guacd child process. The childprocess terminates silently -- no error message is logged by guacd because
the process is killed by the signal before it can log anything.
Observable symptoms
FreeRDP logs this warning at connection startup:
`
This build is using [runtime-check] build options:
[runtime-check] build options might slow down the application
`
Then, under certain conditions (e.g., unexpected server responses, edge cases
in NLA negotiation), the child process disappears:
guacd[1]: INFO: Connection "..." removed. guacd[1]: DEBUG: Unable to request termination of client process: No such processImpact
configurations (NLA edge cases, unusual certificate setups)
Fix
Add
-DCMAKE_BUILD_TYPE=ReleasetoFREERDP_OPTSin the Dockerfile. This:WINPR_ASSERT(assertions become no-ops in Release builds)-O2/-O3)Risk
Very low.
CMAKE_BUILD_TYPE=Releaseis the standard CMake configurationfor production builds. FreeRDP's own CI and all Linux distribution packages use
Release builds. The assertions are developer aids, not production safety nets --
they catch "should never happen" conditions by crashing, which is worse than
graceful error handling in production.
Test plan
[runtime-check]warning