IPC breaks on the 9,223,372,036,854,775,808th workspace set
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.1k
- Forks
- 237
- Avg merge
- 1h 43m
- Merged PRs (30d)
- 1
Description
Wayfire version
Any
Describe the bug
According to the IPC code, the uint64_t wset_index is cast to a int64_t in plugins/ipc-rules/ipc-rules-common.hpp line 202. This means that for any workspace set index above int64::max, the cast will invoke undefined behaviour and (probably) cast to a negative number, conflicting with -1 being used to indicate the lack of a workspace set and meaning that the index won't be accepted by other workspace endpoints.
Expected behavior
The full uint64_t should be returned to avoid this issue, and perhaps instead of returning -1 to indicate a lack of a workspace, the JSON null value can be used instead.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at plugins/ipc-rules/ipc-rules-common.hpp line 202 and trace how the workspace-set index is serialized and consumed by the other workspace endpoints. Confirm the behavior for values above int64::max and for a missing workspace set, then verify that the returned representation remains compatible with those endpoints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 56/100