Text-Value Ownership in Pcee's Memory Model: An Empirical Investigation and Design Note for Phase 9

This deposit documents an empirical investigation into whether "free everything at scope exit" — the approach proposed for Pcee v0.8.0's Phase 9 memory model — is actually safe. It is not: three distinct failure modes (heap-use-after-free on returned strings, double-free on aliasing, and a free-of-non-heap-memory bug caused by Pcee's lack of a literal-vs-heap-pointer distinction) were reproduced against the compiler's generated C and confirmed with AddressSanitizer. A block-local text-provenance pass was implemented as a proof of concept and verified: all three failure modes fixed and ASan-clean, all 17 existing regression tests unchanged byte-for-byte, no new crashes. A known, deliberate limitation (cross-block escape) is left unresolved and documented. The design note grounds these findings in prior art — principally CERT/CMU's Pointer Ownership Model (POM), plus CCured, Cyclone, and recent Rust-inspired borrow-checking work for C — and gives concrete recommendations for Pcee's actual Phase 9 design. IMPORTANT: the accompanying code (pcee_compile_patched.c) is validation evidence for this design investigation only. It is not the Phase 9 implementation and should not be cited or reused as one. Contents: design note (markdown), patched compiler source, 5 test cases (.pcy) reproducing the failure modes, and a README.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-07-28
DOI
https://doi.org/10.5281/zenodo.21636964
Primary Topic
Security and Verification in Computing
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Text-Value Ownership in Pcee's Memory Model: An Empirical Investigation and Design Note for Phase 9

Prashant ARYA
Zenodo (CERN European Organization for Nuclear Research)
Security and Verification in Computing
preprint

Text-Value Ownership in Pcee's Memory Model: An Empirical Investigation and Design Note for Phase 9

Prashant ARYA
preprint en

Abstract

This deposit documents an empirical investigation into whether "free everything at scope exit" — the approach proposed for Pcee v0.8.0's Phase 9 memory model — is actually safe. It is not: three distinct failure modes (heap-use-after-free on returned strings, double-free on aliasing, and a free-of-non-heap-memory bug caused by Pcee's lack of a literal-vs-heap-pointer distinction) were reproduced against the compiler's generated C and confirmed with AddressSanitizer. A block-local text-provenance pass was implemented as a proof of concept and verified: all three failure modes fixed and ASan-clean, all 17 existing regression tests unchanged byte-for-byte, no new crashes. A known, deliberate limitation (cross-block escape) is left unresolved and documented. The design note grounds these findings in prior art — principally CERT/CMU's Pointer Ownership Model (POM), plus CCured, Cyclone, and recent Rust-inspired borrow-checking work for C — and gives concrete recommendations for Pcee's actual Phase 9 design. IMPORTANT: the accompanying code (pcee_compile_patched.c) is validation evidence for this design investigation only. It is not the Phase 9 implementation and should not be cited or reused as one. Contents: design note (markdown), patched compiler source, 5 test cases (.pcy) reproducing the failure modes, and a README.

Zenodo (CERN European Organization for Nuclear Research)
Security and Verification in Computing
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.