On Wed, Mar 3, 2021 at 5:51 AM Eli Zaretskii wrote: > > From: Pip Cet > > Date: Tue, 2 Mar 2021 20:45:04 +0000 > > > > On Tue, Mar 2, 2021 at 8:35 PM Pip Cet wrote: > > > I've looked into the problem, and it seems easy to solve and worth it > > > in terms of debuggability and performance. Since debuggability is such a concern, we probably shouldn't leak the buffer memory. Revised patch attached. (This patch also removes the lseek() syscalls; while not quite as numerous as the read() ones, those did clutter up straces here). > In particular, is it safe to allocate > large amounts of memory off the heap while dumping? Even if it isn't, we'd still be faster re-running the dump after growing the dumper image than the current approach is. >A couple of > places in pdumper.c says some parts of code should call malloc. IIUC, the prohibition on calling malloc, if it is still a concern, applies only when loading the dump, not while writing it. My main concern is the possibility of a partly-written dump file, since we no longer turn "!UMPEDGNUEMACS" into "DUMPEDGNUEMACS" after the dump. Maybe it would make sense to restore that feature? Pip