ChimeraTK / ChimeraTK/ControlSystemAdapter

TypeChangingRangeChecking decorator throws boost::numeric::{postive|negative}_overflow in preWrite

Open
#37 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

redmine
Dominant language
C++
Stars
3
Forks
3
PR merge metrics
No merged PRs in 30d

Description

If the exposed type is smaller than the wrapped type, Trying to write a value that exceeds the limits of the wrapped type will cause preWrite() to throw a boost::numeric::positive_overflow or ::negative_overflow.

This violates the TransferElement specification

If we do not declare it obsolete completely, the RangeChecking type should check type sizes on construction depending on its direction:

  • rw is illegal
  • ro widens the type from target type to decorator type (Example: target is uint8_t, decorator is int)
  • wo narrows the type from target type to decorator type (Example: target is double, decorator is float)

such that range issues during the runtime cannot happen.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing TypeChangingRangeChecking and RangeChecking through preWrite(), then consult the TransferElement specification referenced in the issue. Check how rw, ro, and wo directions handle target and decorator type sizes; done means invalid combinations are rejected at construction and runtime range errors do not produce the reported boost::numeric overflow exceptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.