Skip to content

Comments

fix default creation of empty unique ptr#48

Merged
PeterTh merged 1 commit intocelerity:masterfrom
Fabi12345678910:master
Feb 2, 2026
Merged

fix default creation of empty unique ptr#48
PeterTh merged 1 commit intocelerity:masterfrom
Fabi12345678910:master

Conversation

@Fabi12345678910
Copy link
Contributor

Hey there,
i have spend quite some time trying to get SimSYCL running on a local machine.
Unfortunately all tests regarding group operation failed.
I was able to nail this down to the creation default per operation data.

The creation is used e.g. in schedule.cc:272 and schedule.cc:274.
The behaviour of the current default creation is to create an empty unique pointer.
When this pointer is dereferenced inside the group operation implementation (group_operation_impl.hh:256, group_operation_impl.hh:258), the behavior is undefined according to https://en.cppreference.com/w/cpp/memory/unique_ptr/operator%252A.html

using std::make_unique will return a nonempty pointer
this also fixed all local test errors.

Machine details:
OS: Arch Linux Kernel Version 6.18.1-arch1-2
gcc, g++ version: 15.2.1 20251112

@PeterTh
Copy link
Collaborator

PeterTh commented Feb 2, 2026

Thanks for resolving this, I'm really surprised that this managed to slip through multi-platform CI and usage for so long.

@PeterTh PeterTh merged commit 5811804 into celerity:master Feb 2, 2026
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.

2 participants