Parma Polyhedra Library requirements
Native watchdog timer and signal interfaces
PPL-SPEC-000871
1. Watchdog platform availability and initialization prerequisites UID: PPL-SPEC-000871 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

Watchdog timers shall be available when the configured platform provides the required setitimer, sigaction and pthread_sigmask operations. In that configuration, clients shall retain the library/class initialization and exclusive signal-ownership protocols of 🔗 11. Process timer ownership and signal-safe callbacks, 🔗 18. Class initialization and preceding signal action and 🔗 19. Class finalization and pending-notification cleanup. If any required operation is unavailable, all construction forms shall throw std::logic_error and shall neither publish a notification nor modify the supplied flag holder, regardless of the supplied duration. Construction may also report a resource failure while creating its exception object.

RATIONALE:

Availability must follow the configured timer/signal capabilities rather than imply that every supported library target has native timers.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

class Watchdog;
VERIFICATION_CRITERIA:

Compile controlled configurations with each required capability unavailable; check both constructor forms over positive, zero and negative durations and unchanged notification objects.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

PPL-SPEC-000872
2. Flag-form watchdog registration UID: PPL-SPEC-000872 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

On an available, correctly initialized platform, successful volatile flag-form construction shall own one handler bound to the supplied holder/flag under 🔗 2. Flag-handler binding and binding-preserving copies and 🔗 3. Strict-priority flag installation, register one pending event for its admitted duration, and leave those external notification objects borrowed. Registration shall neither install the flag nor query its priority as a notification. At expiration, priority selection shall use the then-current holder and flag. The flag's priority operation shall satisfy 🔗 11. Process timer ownership and signal-safe callbacks. Failure shall retain 🔗 8. Failed watchdog construction and surviving events.

In a thread-safe build an additional overload shall borrow an atomic pointer holder and compatible flag. Expiration shall only record a notification in non-thread-local handler storage. At a subsequent ordinary checkpoint in the constructing thread, release compare-and-exchange shall install the flag only when the holder is null. No existing request shall be dereferenced, replaced, or compared by priority. Among multiple eligible atomic watchdogs the most recently constructed binding shall be tried first. Selected pending atomic notifications shall precede computational-threshold checks, retaining the snapshot rule in 🔗 1. Computational-weight value and current-state binding. This publication need not use a lock-free borrowed holder because it takes place outside signal context.

Construction, checkpoints and destruction shall use the single watchdog owner/signal-receiving thread. Holder and flag shall remain alive through destruction; a published flag shall additionally outlive its readers. Cancellation may discard an unconsumed notification and shall not clear an already published request. The caller shall cancel before clearing the holder or releasing its flag. A failed construction shall leave no notification binding or pending event behind.

RATIONALE:

Flag registration and later signal-context notification require separate ownership and execution rules.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

template <typename Flag_Base, typename Flag>
Watchdog(long centiseconds, const Flag_Base* volatile& holder, Flag& flag);

// Thread-safe builds only.
template <typename Flag_Base, typename Flag>
Watchdog(long centiseconds, std::atomic<const Flag_Base*>& holder,
         Flag& flag);
VERIFICATION_CRITERIA:

Check distinct flag handlers, unchanged registration-time state, serial priority changes, due notification, cancellation and constructor failures under a controlled timer.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc; tests/atomicwatchdogspec1.cc.

PPL-SPEC-000873
3. Function-form watchdog registration UID: PPL-SPEC-000873 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

On an available, correctly initialized platform, successful function-form construction shall own one handler retaining the supplied function under 🔗 4. Function-handler target binding and copies, register one pending event and not invoke that function merely to register it. A pending callback shall be nonnull, live and satisfy 🔗 11. Process timer ownership and signal-safe callbacks. Dispatch shall invoke that bound function exactly once for its successfully completed event. Failure shall retain 🔗 8. Failed watchdog construction and surviving events.

RATIONALE:

A one-shot notification must preserve callback identity without executing it during registration.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

Watchdog(long centiseconds, void (*function)());
VERIFICATION_CRITERIA:

Use distinct function callbacks and a controlled timer to check registration, ordering, cancellation, exact callback counts and failed construction.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

PPL-SPEC-000874
4. Positive watchdog duration and exact nominal units UID: PPL-SPEC-000874 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

When native timers are available, both construction forms shall accept a positive long duration in centiseconds and interpret its nominal value as c ⁄ 100 seconds. A zero or negative duration shall throw std::invalid_argument without registering an event; construction cleanup shall retain 🔗 8. Failed watchdog construction and surviving events. Large positive durations through LONG_MAX shall retain their full logical value under 🔗 7. Logical deadlines and bounded physical timer checkpoints, subject to supported resource or timer-system-call failures. Timer resolution, signal delivery and masked operations shall retain 🔗 11. Process timer ownership and signal-safe callbacks.

RATIONALE:

Duration validation and exact nominal units must not silently truncate large supported requests to a kernel checkpoint.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

Watchdog(long centiseconds, void (*function)());
template <typename Flag_Base, typename Flag>
Watchdog(long centiseconds, const Flag_Base* volatile& holder, Flag& flag);
VERIFICATION_CRITERIA:

Check zero and negative boundaries, centisecond normalization, one-day boundaries and huge positive durations against an independent controlled elapsed-time model.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

PPL-SPEC-000875
5. Stable watcher and notification lifetimes UID: PPL-SPEC-000875 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

An available-platform watchdog shall not be default constructible, copy constructible, move constructible or assignable. Its stable live address shall retain its expiration state and event identity until destruction. Borrowed holder/flag/function objects shall remain valid whenever the event may notify. Clients shall not end a live watchdog's lifetime from its callback or concurrently with signal dispatch; the masking/exclusive-use protocol shall govern admitted cancellation.

RATIONALE:

Queue entries borrow watcher expiration state and external notification objects, so their lifetimes cannot be transferred implicitly.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

class Watchdog;
~Watchdog() noexcept;
VERIFICATION_CRITERIA:

Check available-platform type traits, stable simultaneous event identities, distinct expired/unexpired destruction and admitted external binding lifetimes.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

PPL-SPEC-000876
6. Ordered event multiplicity and existing-event preservation UID: PPL-SPEC-000876 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

Each successful constructor shall add one distinct event to the shared queue. Equal logical deadlines shall retain all registered events; their relative callback order shall be unspecified. An earlier or later insertion shall preserve every other event's logical deadline and bound notification. Registration and cancellation shall not notify unrelated events merely because the queue or physical timer has changed.

RATIONALE:

Distinct watchers remain distinct even when their nominal deadlines coincide or the timer is replaced.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

class Watchdog;
VERIFICATION_CRITERIA:

Interleave earlier/equal/later events and cancellation against an independent deadline-to-callback multiset, including previously active timers and multiple due events.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

PPL-SPEC-000877
7. Logical deadlines and bounded physical timer checkpoints UID: PPL-SPEC-000877 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

The first event shall establish a relative logical time base. Later registration shall account for elapsed time observed from the armed timer and retain the requested relative duration in its full logical deadline. Each nonzero physical timer request shall be at most one day (86400 seconds), using an intermediate checkpoint when a logical interval is longer. A checkpoint before a pending event's deadline shall not notify it; subsequent checkpoints shall preserve the remaining interval and other event deadlines. Bounded requests shall not imply that every kernel accepts them or guarantee exact elapsed deadlines across arbitrary signal-masked one-shot expiration periods.

RATIONALE:

A bounded kernel request must preserve a potentially much longer logical deadline and timer replacement history.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

Watchdog(long centiseconds, void (*function)());
VERIFICATION_CRITERIA:

Compare one-day boundary, huge duration, earlier/equal/later insertion and retained/deferred chunk histories with exact controlled timer arithmetic.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

8. Failed watchdog construction and surviving events UID: PPL-SPEC-000878 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

When construction reports a supported recoverable exception, it shall release its allocated handler and not leave the failed event pending. Previously live watchdogs shall remain usable with their logical notifications/deadlines preserved. This shall cover invalid duration, handler/node allocation failure, signal-block failure, timer-read failure, invalid successful timer read and timer-arm failure, including a failure while reporting another error. The constructor shall restore its internal critical-section state and caller signal mask before propagation, subject to the fatal restoration rule of 🔗 12. Signal-mask transactions and fatal restoration failures. Internal freed nodes may remain owned by the shared queue's reuse pool.

RATIONALE:

A failed constructor must release its own resources without disabling surviving timers or borrowing its unwound stack.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

Watchdog(long centiseconds, void (*function)());
template <typename Flag_Base, typename Flag>
Watchdog(long centiseconds, const Flag_Base* volatile& holder, Flag& flag);
VERIFICATION_CRITERIA:

Inject every constructor allocation/system-call failure for both forms, compare existing events before/after and exercise exact later notifications with balanced handler ownership.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

PPL-SPEC-000879
9. Nonthrowing destruction and ordinary cancellation UID: PPL-SPEC-000879 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

~Watchdog() shall not throw. It shall destroy its owned handler exactly once while its timer signal is blocked, before restoring the caller's signal mask. An unexpired watchdog shall remove its own event without notifying it; an expired watchdog shall not remove or notify another event. Cancellation of a nonleading or equal-deadline event shall preserve remaining deadlines; canceling the first event shall schedule the next one or stop the timer when no event remains. If a next deadline is already due, cancellation shall schedule a short nonzero checkpoint rather than dispatch a notification from the destructor. System-call failure and fatal masking outcomes shall retain 🔗 10. Cancellation failure and retained-checkpoint fallback and 🔗 12. Signal-mask transactions and fatal restoration failures.

RATIONALE:

Destruction owns cancellation and handler cleanup while notification remains a signal-dispatch operation.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

~Watchdog() noexcept;
VERIFICATION_CRITERIA:

Check nonleading/equal/leading/last and already-expired cancellation, pending-signal races, unwinding and due-next-event rescheduling without destructor notification.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

10. Cancellation failure and retained-checkpoint fallback UID: PPL-SPEC-000880 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

If cancellation cannot read a valid timer interval, rearm the next event or stop the last timer, it shall still erase the canceled event without propagating that system-call exception. The previous physical timer/bookkeeping shall remain as a checkpoint for remaining events; its later signal shall notify only events whose logical deadlines are due and schedule others for their remaining duration. A failed last-event stop may leave a physical notification, which shall not invoke a canceled handler. Later cancellation/insertion shall remain consistent with the retained checkpoint rather than assume it equals the first remaining event's deadline.

RATIONALE:

Nonthrowing cleanup needs a safe scheduling fallback even when a timer cannot be changed.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

~Watchdog() noexcept;
VERIFICATION_CRITERIA:

Inject failed reads, invalid read intervals, failed rearm/stop and chained cancellation histories; compare remaining event times and assert canceled objects never notify.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

11. Process timer ownership and signal-safe callbacks UID: PPL-SPEC-000881 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

The facility shall reserve ITIMER_PROF/SIGPROF, or ITIMER_REAL/SIGALRM on Cygwin, GNU Hurd and profiling builds. One thread shall own all watchdog operations and receive the selected signal; every other thread shall keep it blocked. These restrictions shall also apply to a thread-safe PPL build, and clients shall not independently replace/use the owned timer or signal while the facility owns them. Callbacks and priority queries of the function/volatile-flag forms shall use only operations valid in asynchronous signal context. The atomic-holder form shall instead record a non-TLS notification in signal context and defer holder publication to ordinary owner code. They shall not throw, construct/destroy watchdogs or reenter their queue. Signal resolution, delivery delays and arbitrary prolonged masked operations shall not imply a hard elapsed-time guarantee.

RATIONALE:

The native timer and asynchronous callback context remain process resources despite other thread-local library facilities.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

class Watchdog;
VERIFICATION_CRITERIA:

Inspect platform timer/signal selection and documented ownership; use signal-safe counters/holders in controlled and native smoke cases and check exact signal-mask restoration.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

12. Signal-mask transactions and fatal restoration failures UID: PPL-SPEC-000882 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

Construction and cancellation shall block the selected signal while updating shared queue/timer state and restore the caller's exact previous mask afterward, including unrelated blocked signals. Failure to block the signal shall propagate from construction with 🔗 8. Failed watchdog construction and surviving events. The same failure during noexcept cancellation, or any failure to restore the mask, shall invoke std::terminate rather than continue with unprotected state or a newly retained mask. Pending delivery released by mask restoration shall see a consistent published queue and timer state.

RATIONALE:

Shared timer transactions must remain protected through both ordinary updates and synchronous delivery on unblocking.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

class Watchdog;
~Watchdog() noexcept;
VERIFICATION_CRITERIA:

Check originally blocked/unblocked and unrelated signals, delivery before/after transaction points, construction block failure and isolated-process fatal block/restore controls.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

13. Stale timer-notification suppression UID: PPL-SPEC-000883 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

On timeout entry, if a successful timer-state read yields a valid nonzero remaining interval, the notification shall be treated as stale and shall return without advancing the logical clock or notifying a replacement event. If the read fails or is invalid, dispatch shall use the timeout fallback of 🔗 14. Due-event signal dispatch and successful one-shot expiration; this fallback shall not promise to preserve a still-armed replacement deadline when the signal was in fact stale. A valid zero interval shall be processed as an actual timeout. Replacing a timer shall not assume that a previously pending signal has been retracted.

RATIONALE:

A delayed notification must not consume a newer timer whenever its still-armed state can be established.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

extern "C" void PPL_handle_timeout(int signum);
VERIFICATION_CRITERIA:

Check immediate/delayed/coalesced stale signals, valid zero/nonzero reads and failed/malformed snapshots without equating fallback behavior with guaranteed stale suppression.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

PPL-SPEC-000884
14. Due-event signal dispatch and successful one-shot expiration UID: PPL-SPEC-000884 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

An actual timeout outside an active timer transaction shall advance the logical clock by the accounted last requested span, inspect events in deadline order and invoke each event whose deadline is no later than that clock. After its signal-safe action returns, dispatch shall mark it expired and remove it. A future event shall remain pending and be scheduled for its remaining logical interval. When no event remains, the logical alarm shall become inactive. An empty-queue signal shall not invoke a handler. The errno and fatal rearm outcomes shall retain 🔗 16. Fatal signal-context timer-rearm failure and 🔗 20. Timeout and signal-mask errno preservation.

RATIONALE:

Successful signal delivery must distinguish due, future and already removed events with exact one-shot ownership.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

extern "C" void PPL_handle_timeout(int signum);
VERIFICATION_CRITERIA:

Use independent callback/deadline logs for multiple due events, equal deadlines, remaining future events and empty/canceled queues, including subsequent expired destruction.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

PPL-SPEC-000885
15. Deferred timeout accounting inside a transaction UID: PPL-SPEC-000885 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

If an actual timeout is processed while the internal transaction state is active, it shall defer event dispatch by arming a short nonzero checkpoint. The previously consumed timeout span shall remain included in the elapsed-time accounting for that later dispatch; repeated replacement/chunk histories shall not lose the consumed span. A deferred checkpoint by itself shall not notify a future event. Failure to arm this checkpoint shall retain 🔗 16. Fatal signal-context timer-rearm failure.

RATIONALE:

A timeout deferred during publication must preserve the elapsed interval already consumed, including a capped long interval.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

extern "C" void PPL_handle_timeout(int signum);
VERIFICATION_CRITERIA:

Inject timeout delivery at read/publication/transaction boundaries and compare ordinary and chunked deferred histories with a separately maintained logical clock.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

16. Fatal signal-context timer-rearm failure UID: PPL-SPEC-000886 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

When timeout dispatch or transaction deferral cannot rearm the required timer, it shall call std::abort. It shall not report that failure by constructing or throwing a C++ exception in signal context. Earlier successfully completed callbacks in that dispatch shall retain their effects up to process termination. This fatal policy shall not be replaced by silently leaving future pending events unscheduled.

RATIONALE:

Once pending timeouts cannot be scheduled, continuing would lose required notifications and exception creation is unsafe in signal context.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

extern "C" void PPL_handle_timeout(int signum);
VERIFICATION_CRITERIA:

Use isolated-process fatal controls for rearm and deferral failures with allocation disabled and distinguish abort from exception, terminate and silent return.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

PPL-SPEC-000887
17. Timer-read validity and context-specific error channels UID: PPL-SPEC-000887 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

A valid timer interval shall have nonnegative seconds representable by long and microseconds in [0, 1000000). A failed timer read shall not be interpreted as a successful sample. During construction, a successful read outside this range shall report std::runtime_error with 🔗 8. Failed watchdog construction and surviving events. During cancellation it shall use 🔗 10. Cancellation failure and retained-checkpoint fallback, and during signal entry it shall use the fallback in 🔗 13. Stale timer-notification suppression. Successful zero and boundary-valid intervals shall retain their ordinary context meaning.

RATIONALE:

The same malformed platform snapshot requires different safe reporting in construction, noexcept cleanup and asynchronous dispatch.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

class Watchdog;
extern "C" void PPL_handle_timeout(int signum);
VERIFICATION_CRITERIA:

Inject negative seconds/microseconds, excessive microseconds and supported wider-second overflow in each context, with valid zero/nonzero boundary controls.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

18. Class initialization and preceding signal action UID: PPL-SPEC-000888 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

On an available platform, class initialization shall establish a one-shot timer protocol (zero repeated interval), install the watchdog signal action for the selected signal and preserve its preceding action for later restoration. Failed installation shall report its system-call failure. The caller/library shall provide balanced initialization and finalization, without independently repeated initialization or live watchdogs before setup. If later library initialization fails after this signal action was acquired but before any timer/event was acquired, its internal rollback shall restore the preceding action without modifying an unrelated existing interval timer.

RATIONALE:

Signal-handler acquisition and later library setup rollback must preserve the resource that preceded the PPL lifecycle.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

static void initialize();
VERIFICATION_CRITERIA:

Check controlled preceding actions and installation failure; inspect and exercise post-acquisition initialization rollback separately from ordinary active-timer finalization.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

19. Class finalization and pending-notification cleanup UID: PPL-SPEC-000889 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Public RELATIONS (Parent): STATEMENT:

On an available platform, finalization shall require no live pending watchdog events. With the selected signal blocked, it shall stop the owned timer, mark the logical alarm inactive, discard an owned pending notification and restore the preceding signal action. It shall restore the caller's exact mask and preserve errno when it returns. Failure to block, stop the timer, install the discard action, restore the preceding action or restore the mask shall invoke std::terminate. A stale notification from a canceled timer shall not escape later to the preceding client handler.

RATIONALE:

Returning signal ownership must dispose of notifications still owned by the timer being finalized.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

static void finalize();
VERIFICATION_CRITERIA:

Use controlled previous actions/masks, queued canceled notifications and isolated-process failure controls for each finalization step, with no live pending watchdogs.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.

20. Timeout and signal-mask errno preservation UID: PPL-SPEC-000890 STATUS: APPROVED COMPONENT: RUNTIME APPLICABILITY: IF_CPP VERIFICATION_METHODS: Test, Analysis, Inspection LANGUAGE: CPP VISIBILITY: Internal RELATIONS (Parent): STATEMENT:

Whenever timeout dispatch returns normally, it shall restore its entry errno, including a stale-signal return, callback effects and successful read/rearm calls that change errno. Signal-mask acquisition and restoration shall preserve the errno with which those individual mask operations were entered. Finalization shall preserve its entry errno on return under 🔗 19. Class finalization and pending-notification cleanup. This shall not turn a reported constructor system-call failure into an unchanged-errno promise.

RATIONALE:

Asynchronous notification must not corrupt the interrupted computation's error state.

INTERFACE:

Public C++ header: ppl.hh; defining source header: Watchdog_defs.hh. Names belong to Parma_Polyhedra_Library. Constructor/destructor and static member excerpts apply to Watchdog. Static class lifecycle members exist only when the required timer/signal operations are available; PPL_handle_timeout is the internal signal-entry bridge.

extern "C" void PPL_handle_timeout(int signum);
static void finalize();
VERIFICATION_CRITERIA:

Set distinct sentinel error values and clobber read/rearm/callback operations in stale, ordinary, deferred and chunked histories; verify successful mask/finalization preservation.

SOURCE:

src/Watchdog_defs.hh; src/Watchdog_inlines.hh; src/Watchdog.cc; src/Init.cc; tests/Watchdog/watchdog1.cc; tests/Watchdog/watchdog2.cc; tests/Watchdog/watchdogtimerfixture.hh; tests/Watchdog/watchdoglifecyclespec1.cc; tests/Watchdog/watchdogunavailablespec1.cc; tests/watchdogpublic1.cc.