2010/2/8 Vadim Zhukov <[email protected]>: > Looks like I was just lucky. :) I do not use malloc.conf. And mktemp(1) > failed for me only sometimes (I'm using it for generating > passwords: "mktemp XXXXXXXXXX"). After a few crashes I realized that it > hurts me too much... Do not remember what snapshot it was, though, but > it was definitely something from 2009.
Huh, weird. Wonder if the changes in malloc made it no longer trivially triggerable. > I'll try to write some regression tests, if you wish - never did this > before, but I have some spare time now. If you can, that would be great! (That goes for anyone, really, not just you!) In this case, perhaps the underrun can be tested for by using mmap() and mprotect() to set up a three pages, the first and last of which are PROT_NONE and the middle PROT_READ|PROT_WRITE, then put "XXXXXX" at the start of the middle page and call mkstemp() on it. Similarly, putting the template right at the end of the middle page can be used to verify there's no overrun. Verifying that all the trailing X's a considered for replacement (the bug in what I committed...) will probably need to be probabilistic... Take a look at regress/lib/libc/* for examples of how these sorts of things appear in the tree. I usually start by copying the source of whichever existing test is closest to what I'm looking at and hacking it from there... Philip Guenther
