I noticed that diffstat(1) needlessly crashes when the input of an "Only in " line includes a UTF-8 character. It turned out that this problem is caused by the "len" argument passed to mbsrtowcs() being wrong. ---------- $ echo 'Only in .: A' | diffstat *** buffer overflow detected ***: terminated Aborted (core dumped) ---------- Reproducible: Always Additional Information: Since I couldn't find whom to report this problem from https://invisible-island.net/diffstat , I report here.
The actual data might be helpful (one of my test-scripts exercises that code, but data differs). I see the problem you're referring to, but in a quick check (Debian 12), I get no dump. Bugzilla works, but actually bugs works better, because it's mail-based, and I'm more likely to have the complete bug report and responses in my mail archive. ymmv.
fwiw, I can reproduce the problem with my Fedora42 machine.
This problem can be reproduced only when compiled with -D_FORTIFY_SOURCE=3 option. Fedora 38+ ( https://fedoraproject.org/wiki/Changes/Add_FORTIFY_SOURCE%3D3_to_distribution_build_flags ) and Ubuntu 24.04+ uses _FORTIFY_SOURCE=3. Presumably Debian 12 is using _FORTIFY_SOURCE=2.
Perhaps the detail we're discussing is also tied to the version of gcc (or libc6), since I see that I've logs from Fedora41 with FORTIFY_SOURCE=3, or something triggered by a single UTF-8 character (though that seems odd, since the mismatch would be greater for multiple characters).
Please see https://sourceware.org/bugzilla/show_bug.cgi?id=32899 for details.