]> git.ipfire.org Git - thirdparty/glibc.git/commit - ChangeLog
muntrace: reset file and hooks before finalizing the stream
authorPino Toscano <toscano.pino@tiscali.it>
Mon, 19 Nov 2012 19:01:00 +0000 (20:01 +0100)
committerPino Toscano <toscano.pino@tiscali.it>
Mon, 19 Nov 2012 19:01:00 +0000 (20:01 +0100)
commite19af3803be804f2737788e62d243e425bb03011
tree725b6d3e1e96ddea102a88887a5632b380bd2c71
parent942caa165645cf1cd0d65f8ecd4b4cbdfa32a34a
muntrace: reset file and hooks before finalizing the stream

fclose will call free, invoking its hook, then fprintf which would indirectly
try to allocate a buffer, and this can cause malloc to be used (thus its hook
to be invoked) if libio uses malloc instead of mmap; given any malloc/free hook
locks the internal lock, this leads to a deadlock.

To prevent this hook roundtrip at muntrace, first unset MALLSTREAM and the
hooks, and only after that close the trace file.
ChangeLog
malloc/mtrace.c