[Pkg-rust-maintainers] Bug#1113923: rust-chrono breaks rust-tera autopkgtest: builtins::filters::common::tests::date_errors_on_incorrect_format seems to hang

Peter Green plugwash at debian.org
Sat Sep 6 11:21:30 BST 2025


> 
> While hanging, it's consuming more and more memory, until all memory 
> (251 GiB + 148 GiB swap) is exhausted and the OOM-killer kicks in.

I've dug into this issue and found the following.

When passed a particular incorrect format string (I have not tested
if it happens for other incorrect format strings) the chrono function
"StrftimeItems" in chrono 0.4.41 returns an apparently never-ending
iterator of errors. tera tries to "collect" this never-ending iterator
into a Vec. The result is the Vec produces a series of ever-larger
memory allocations until either a memory allocation fails or the
program is hit by the OOM killer.

I'd argue there are two bugs here. On the one hand Chrono probably
should not be returning a never-ending iterator. On the other hand
there is no reason for the check in tera not to stop at the first
error.

I've filed upstream bugs with both chrono and tera, and uploaded
a patched version of tera to Debian.

My proposal for next steps would be.

1. Get rust-tera 1.20.0-2 into testing (with force if needed).
2. Remove the blacklist of rust-tera's autopkgtest.
3. Downgrade this bug to "important" and assign it to rust-chrono
4. Wait for a response from rust-chrono upstream to decide if we
    need to do anything further.



More information about the Pkg-rust-maintainers mailing list