Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug with long multiline strings?
On Jan 18, 1:34pm, Bart Schaefer wrote:
}
} Took me a few passes, but I traced the bug to this:
}
} #0 freeheap () at ../../zsh-5.0/Src/mem.c:382
} #1 0x0808bd23 in execfor (state=0xbfeb4a20, do_exec=0)
} at ../../zsh-5.0/Src/loop.c:188
}
} That freeheap() is discarding a heap that is still in use.
Patch below seems to do the trick. The bug is a consequence of my change
in workers/29175, and it's only tickled if heap memory is allocated and
re-allocated in chunks of a certain size (because if I repeat Frank's
steps using longer lines at each PS2 prompt, it doesn't happen).
I imagine Peter is getting rather tired of crash bugs getting found and
fixed only days after he does a release.
diff --git a/Src/mem.c b/Src/mem.c
index 5275c6c..d15721c 100644
--- a/Src/mem.c
+++ b/Src/mem.c
@@ -367,6 +367,15 @@ freeheap(void)
}
#endif
} else {
+ if (h == fheap && h != heaps) {
+ /*
+ * When deallocating the last arena with free space,
+ * loop back through the list to find another one.
+ */
+ fheap = NULL;
+ hn = heaps;
+ continue;
+ }
#ifdef USE_MMAP
munmap((void *) h, h->size);
#else
Messages sorted by:
Reverse Date,
Date,
Thread,
Author