Ticket #23 (closed defect: fixed)

Opened 14 months ago

Last modified 14 months ago

Implement assertions and use them

Reported by: dave Owned by: dave
Priority: major Milestone: NxOS 0.2
Component: baseplate Version:
Keywords: Cc:

Description

Our code is currently very fragile when faced with precondition failures: passing a NULL pointer to a driver, violating an API contract... Are all handled by either silently ignoring the invalid API call, or by corrupting memory.

The solution to this is a rudimentary assertion mechanism, that would allow us to check preconditions, and crash-land the kernel if an assertion fails.

The assert code should print a message to screen when crash-landing, giving the source of the assert, the expression that triggred the assert, and optionally a custom error message. Users can take note of the message, then power down the brick by pressing the cancel button. There is no graceful recovery from an assertion failure, only death.

Change History

Changed 14 months ago by dave

  • status changed from new to assigned

Changed 14 months ago by dave

  • status changed from assigned to closed
  • resolution set to fixed

Changeset 366ee1d2fe79 implements assertion support and is pushed to devel. It still needs to be propagated to drivers though.

Note: See TracTickets for help on using tickets.