---
title: "4. Safety and the known bug classes · perennial"
description: "Each advisory against the target family becomes a negative test in tests/advisories/. The trigger patterns are described in docs/spec/advisories.md (written…"
canonical: "https://perennial.avarok.net/docs/design/04-safety/"
lastmod: "2026-12-01T20:11:23Z"
tokens: 1292
---

1. [Docs](https://perennial.avarok.net/docs/)
2. [Design](https://perennial.avarok.net/docs/design/)

# 4\. Safety and the known bug classes

perennial@0.1.0·Updated 2026-12-01·1 min read·[View as markdown](https://perennial.avarok.net/docs/design/04-safety/index.md)

Each advisory against the target family becomes a negative test in `tests/advisories/`. The trigger patterns are described in `docs/spec/advisories.md` (written by the spec agent from the advisory texts); the tests are written from that description, not from any source.

| Advisory                                 | Bug class                                                                                            | Our test                                                                                                                                                                                                                                                                                                                                                                        |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RUSTSEC-2026-0251 / -0255 (sized-chunks) | a panic in user code during a chunk operation leaves slots that are dropped twice or read after drop | user types whose `Clone`, `Ord`, `Hash`, `Eq` and `Drop` panic on the n-th call, for every n up to the operation's call count, on every mutating method of all five collections; each element carries a live counter, and the test asserts every element is dropped at most once and the collection still satisfies its invariants (or was left unchanged) after `catch_unwind` |
| RUSTSEC-2023-0126 (im OrdSet aliasing)   | a mutation through one handle is visible through a clone                                             | clone, mutate each handle with every mutating method, and compare both against independent std models; run under Miri in CI                                                                                                                                                                                                                                                     |
| RUSTSEC-2026-0250 / -0248 (unmaintained) | not a code defect                                                                                    | the release pipeline, CI, dependabot and SECURITY.md are the answer                                                                                                                                                                                                                                                                                                             |

## Rules that make the classes impossible by construction

- `#![forbid(unsafe_code)]` in every crate; CI greps that the attribute is present.
- No manual memory management; all node storage is `Vec`/`arrayvec` (permissive, audited).
- User callbacks (`Ord::cmp`, `Hash::hash`, `Clone::clone`) are never called while a node is in a half-moved state that our own code would later drop: edits build the new node contents first, then swap them in.
- `Drop` of a deep structure is iterative, not recursive, so dropping a huge Vector or map cannot overflow the stack (tested with 10⁷ elements in a thread with a small stack).

## Fuzzing

`cargo fuzz` targets drive a random sequence of operations against a std model for each collection, with and without panicking element types. CI runs each for a fixed time on every PR.

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@id": "https://thomaspbraun.com/#person",
      "@type": "Person",
      "name": "Thomas Braun",
      "sameAs": [
        "https://github.com/tbraun96",
        "https://x.com/tbraun96"
      ],
      "url": "https://thomaspbraun.com",
      "worksFor": {
        "@type": "Organization",
        "name": "Avarok",
        "url": "https://avarok.net"
      }
    },
    {
      "@id": "https://perennial.avarok.net/docs/design/04-safety/",
      "@type": "WebPage",
      "author": {
        "@id": "https://thomaspbraun.com/#person"
      },
      "dateModified": "2026-12-01T20:11:23Z",
      "description": "Each advisory against the target family becomes a negative test in tests/advisories/. The trigger patterns are described in docs/spec/advisories.md (written…",
      "inLanguage": "en",
      "isPartOf": {
        "@id": "https://perennial.avarok.net/#website",
        "@type": "WebSite",
        "name": "perennial",
        "url": "https://perennial.avarok.net/"
      },
      "name": "4. Safety and the known bug classes · perennial",
      "url": "https://perennial.avarok.net/docs/design/04-safety/"
    }
  ]
}
```
