The problem was first triggered when I tried to upgrade diff, and continued when I tried to upgrade libc6 and dpkg. Every time I got the "invalid pointer" and backtrace. After a reboot I was able to upgrade all three packages without problems. I have no idea what caused this, I was left with a half-installed libc6, which was alarming, but the problem appears to be solved. Please close.