Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Race condition in global g_spacemesh_api_abort_flag #79

Open
fasmat opened this issue Nov 9, 2022 · 0 comments
Open

Race condition in global g_spacemesh_api_abort_flag #79

fasmat opened this issue Nov 9, 2022 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@fasmat
Copy link
Member

fasmat commented Nov 9, 2022

g_spacemesh_api_abort_flag (defined here https://github.com/spacemeshos/gpu-post/blob/develop/src/api_internal.cpp#L15) is used as a termination condition to stop calculation of hashes early (e.g. here https://github.com/spacemeshos/gpu-post/blob/develop/src/cuda/driver-cuda.cpp#L220).

This global variable isn't protected from concurrent access, so stopping a running process is inherently unsafe at the moment. This should be fixed by protecting g_spacemesh_api_abort_flag with mutexes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant