[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#719629: regression: apt: crashes with MALLOC_CHECK_ and MALLOC_PERTURB_ set



On Tue, Aug 13, 2013 at 08:16:58PM +0200, Paul Wise wrote:
> Package: apt
> Version: 0.9.10
> Severity: important
> Usertags: malloc
> 
> With the glibc malloc checks enabled, the new version of apt in unstable
> crashes with a SIGABRT on apt-get update and other operations. This is a
> regression from testing, which doesn't have this issue. After
> recompiling apt with debug symbols and no optimisation I obtained the
> backtrace listed below. This means that there is probably a new issue
> with uninitialised memory in apt from unstable.
[..]

Thanks! I can reproduce this and the following diff fixes it for me:

$ git diff
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc
index 1c79ee7..99cedc7 100644
--- a/apt-pkg/tagfile.cc
+++ b/apt-pkg/tagfile.cc
@@ -60,7 +60,7 @@ pkgTagFile::pkgTagFile(FileFd *pFd,unsigned long
long Size)
       return;
    }
    
-   d->Buffer = new char[Size];
+   d->Buffer = new char[Size+1];
    d->Start = d->End = d->Buffer;
    d->Done = false;
    d->iOffset = 0;

But I need to investigate further to get to the root cause.

Cheers,
 Michael


Reply to: