Skip to content

Conversation

@aalkin
Copy link
Member

@aalkin aalkin commented Jun 20, 2025

In the original code a temporary iterator to fv0a/fv0c is created and immediately discarded, leaving the result of amplitude() (which is a span, a non-owning view) a with dangling references to the internals of the iterator. This worked by accident, since the underlying array in shared memory is available regardless, but can potentially lead to problems. Switching from gsl::span to the std::span (PR AliceO2Group/AliceO2#14421) makes the original code fail to compile.

@ddobrigk @ktf

@aalkin aalkin requested review from a team, alibuild, ddobrigk, iarsene, jgrosseo and ktf as code owners June 20, 2025 07:26
@github-actions
Copy link

github-actions bot commented Jun 20, 2025

O2 linter results: ❌ 84 errors, ⚠️ 0 warnings, 🔕 0 disabled

@github-actions github-actions bot changed the title Prevent dangling reference error when switching from gsl::span to std::span [Common] Prevent dangling reference error when switching from gsl::span to std::span Jun 20, 2025
@ddobrigk
Copy link
Collaborator

Hi @aalkin, this is an impressively sneaky issue, thanks for the fix!

In practice, note you'll need a lot of approvals for this now (DPG, PWGCF and Common), so I fear you may have to ping people in other channels (e.g. mattermost) to get this merged in good time.

@aalkin
Copy link
Member Author

aalkin commented Jun 23, 2025

The issue is solved at the framework side.

@aalkin aalkin closed this Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants