Ticket #821 (new planned)

Opened 9 months ago

Last modified 5 months ago

placement-New: verify sane buffer size

Reported by: ichthyo Owned by:
Priority: grave Milestone: 1alpha
Component: lumiera Keywords: QA sanity
Cc: Blocked By:
Blocking:

Description (last modified by ichthyo) (diff)

Check that buffers used to place objects inline are of sufficient size. Preferably use STATIC_ASSERT

Explanation: we use the technique of storing an object into a local buffer quite frequently. Usually the rationale is to avoid heap storage, or to combine value semantics with polymorphism or type erasure. Since placing an object this way means to circumvent the sanity checks of the compiler, we might end up placing an object too large to fit into the buffer, overwriting memory locations behind.

So the TODO is: visit for all usages of this placement-New technique and ensure that a suitable ASSERTION is in place. Preferably use a static assertion, which kind of reinstates the compiler sanity checks.

Change History

comment:1 Changed 5 months ago by ichthyo

  • Priority changed from lesser to grave
  • Summary changed from PolymorphicValue: verify sane buffer size to placement-New: verify sane buffer size
  • Description modified (diff)
  • Milestone changed from 2beta to 1alpha

might be a concern for all usages of the PolymorphicValue template, the Singleton factory and the various Opaque holders. I've just now added two or three STATIC_ASSERTS and this already caught an error. Cough.

Note: See TracTickets for help on using tickets.