Skip to content

Register assertion handler to print failure details to stderr#299

Open
shegazyy wants to merge 2 commits into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/make-assertion-messages-visible
Open

Register assertion handler to print failure details to stderr#299
shegazyy wants to merge 2 commits into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/make-assertion-messages-visible

Conversation

@shegazyy

@shegazyy shegazyy commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Without a registered handler, SCORE_LANGUAGE_FUTURECPP_ASSERT failures call std::abort silently, giving no indication of what failed or where.

Register a handler at daemon startup that writes the failed condition, optional message, file, line, and function to stderr before abort.

Closes: #296

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: e4c5fec9-24c0-4ee0-b9a2-c8a09f00ee76
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (33 packages loaded, 10 targets configured)

Analyzing: target //:license-check (63 packages loaded, 10 targets configured)

Analyzing: target //:license-check (139 packages loaded, 925 targets configured)

Analyzing: target //:license-check (151 packages loaded, 4156 targets configured)

Analyzing: target //:license-check (156 packages loaded, 5498 targets configured)

Analyzing: target //:license-check (161 packages loaded, 5547 targets configured)

Analyzing: target //:license-check (161 packages loaded, 5547 targets configured)

Analyzing: target //:license-check (164 packages loaded, 7434 targets configured)

Analyzing: target //:license-check (164 packages loaded, 7434 targets configured)

Analyzing: target //:license-check (167 packages loaded, 10275 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

INFO: Analyzed target //:license-check (169 packages loaded, 10409 targets configured).
[14 / 16] [Prepa] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar
[15 / 16] Building license.check.license_check.jar (); 0s disk-cache, multiplex-worker
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 28.206s, Critical Path: 2.58s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@shegazyy

shegazyy commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Hey @danth 🙏 ready for review whenever you have a moment!

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

@danth danth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When an assertion fails inside bazel test, the punctuation gets split onto separate lines:

[2026-07-09 09:38:49.947] [INFO] [launch_manager] Assertion failed:
[2026-07-09 09:38:49.947] [INFO] [launch_manager] osal_result != OsalReturnType::kSuccess
[2026-07-09 09:38:49.947] [INFO] [launch_manager] Location:
[2026-07-09 09:38:49.947] [INFO] [launch_manager] score/launch_manager/src/daemon/src/process_group_manager/details/process_group_manager.cpp
[2026-07-09 09:38:49.947] [INFO] [launch_manager] :
[2026-07-09 09:38:49.947] [INFO] [launch_manager] 166
[2026-07-09 09:38:49.947] [INFO] [launch_manager] (
[2026-07-09 09:38:49.947] [INFO] [launch_manager] bool score::lcm::internal::ProcessGroupManager::initializeControlClientHandler()
[2026-07-09 09:38:49.947] [INFO] [launch_manager] )
[2026-07-09 09:38:49.948] [INFO] [launch_manager] Message:
[2026-07-09 09:38:49.948] [INFO] [launch_manager] ControlClientChannel semaphore init failed

Maybe we should build the string and write it to cerr in one go (or at most once per line) to avoid this.

Without a registered handler, SCORE_LANGUAGE_FUTURECPP_ASSERT failures
call std::abort silently, giving no indication of what failed or where.

Register a handler at daemon startup that writes the failed condition,
optional message, file, line, and function to stderr before abort.

Closes: eclipse-score#296
@shegazyy shegazyy force-pushed the fix/make-assertion-messages-visible branch from e7fb36e to 5cbbe7c Compare July 12, 2026 10:08
@shegazyy shegazyy temporarily deployed to workflow-approval July 12, 2026 10:08 — with GitHub Actions Inactive
@shegazyy shegazyy temporarily deployed to workflow-approval July 12, 2026 10:08 — with GitHub Actions Inactive
@NicolasFussberger NicolasFussberger requested a review from danth July 13, 2026 06:50
@shegazyy shegazyy requested a deployment to workflow-approval July 13, 2026 10:49 — with GitHub Actions Waiting
@shegazyy shegazyy requested a deployment to workflow-approval July 13, 2026 10:49 — with GitHub Actions Waiting
@shegazyy

Copy link
Copy Markdown
Contributor Author

@NicolasFussberger @danth branch is updated with the latest main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Make assertion messages visible

3 participants