Segfaults on some libtool invocations due to sbrk() assumptions
From:
Samuel Thibault
Subject:
Segfaults on some libtool invocations due to sbrk() assumptions
Date:
Fri, 22 Apr 2011 19:07:40 +0200
User-agent:
Mutt/1.5.12-2006-07-14
Hello,
Copy/pasting from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614815
“
I'm having some bash crashes when running libtool. It shows up that
the issue is that bash assumes being the only user of sbrk(), and thus
caches in memtop the assumed value of brk. However, libc can make use
of brk() for its own internal allocations, and thus memtop becomes
outdated. The ((char *)p + binsize(nunits) == memtop) then becomes
bogus. The attached patch fixes the crashes by simply removing the
caching, which is useless anyway since libc already avoids calling the
kernel system call when sbrk is given 0.
”
Samuel