On 26. Feb 2026, at 0.03, Aurelien Jarno <[email protected]> wrote: > > > The problems happen in o_stream_file_writev() from > src/lib/ostream-file.c. When an error happens, it calls > p_strdup_vprintf(), which in turns call t_buffer_alloc() which might > indirectly through successive functions call malloc(). In some > conditions, malloc() might change errno even if there is no error. This > means that o_stream_file_writev() might return with the wrong errno > (ENOENT from malloc) while the real errno might be EINTR or EAGAIN, > for which a retry is triggered. > > A possible fix might be to save errno around the malloc code, fixing the > issue at the root, as there might be more latent issues than the ones > found by the testsuite:
Thanks for the explanation. I've now fixed this in a bunch of places: https://github.com/dovecot/core/commit/fd81e9b15d0c430e25e99e3c46f562d9cfb74efc

