On Thu, Feb 16, 2017, at 07:11 AM, Peter Stephenson wrote: > Yes, it doesn't fix the problem, and it looks like it's a bit more > subtle than simply a wrong length. > > I've managed to get valgrind reporting errors but with and without > --enable-zsh-mem. Here's one without: --enable-zsh-debug is on > but that's all. > > I'm afraid that's all I'm going to have time to do. > > pws > > % zmodload zsh/db/gdbm > % ztie -d db/gdbm -f db.gdbm dbase > % dbase[testkey]=somewhat > ==25034== Invalid write of size 1 > ==25034== at 0x80E0B78: metafy (utils.c:4652) I've used HEAP_ALLOC instead of HEAP_DUP in argument for metafy. Fixing this resolves valgrind report. Important catch.. Hopefully it will resolve enable-zsh-mem problem (I cannot reproduce that). Sending as complete patch plus db_gdbm.c file. -- Sebastian Gniazdowski psprint2@fastmail.com