Debian Bug report logs - #95981
dpkg segfault; bug in mmap code?

version graph

Package: dpkg; Maintainer for dpkg is Dpkg Developers <>; Source for dpkg is src:dpkg.

Reported by: Itai Zukerman <>

Date: Tue, 1 May 2001 19:37:57 UTC

Severity: grave

Tags: fixed

Found in version 1.9.2

Fixed in version dpkg/1.9.4

Done: Adam Heath <>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox

Report forwarded to, Wichert Akkerman <>:
Bug#95981; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Itai Zukerman <>:
New Bug report received and forwarded. Copy sent to Wichert Akkerman <>. Full text and rfc822 format available.

Message #5 received at (full text, mbox):

From: Itai Zukerman <>
Subject: dpkg segfault; bug in mmap code?
Date: 01 May 2001 15:37:03 -0400
Package: dpkg
Version: 1.9.2
Severity: grave


# gdb dpkg
(gdb) run --unpack /var/cache/apt/archives/groff_1.16-3.4_i386.deb
Starting program: /home/zukerman/d/debian/dpkg/dpkg-1.9.2/build/main/dpkg --unpack /var/cache/apt/archives/groff_1.16-3.4_i386.deb

Program received signal SIGSEGV, Segmentation fault.
0x80622f6 in parsedb (filename=0x8081d18 "/var/lib/dpkg/status", 
    flags=pdb_weakclassification, donep=0x0, warnto=0x0, warncount=0x0)
    at /z/mirror/home/zukerman/d/debian/dpkg/dpkg-1.9.2/lib/parse.c:136

136           c= getc_mmap(dataptr); if (c!='\n' && c!=MSDOS_EOF_CHAR ) break;

I believe the patch below fixes the problem.  I apologize if this has
already been reported.


--- lib/parse.c.orig    Tue May  1 15:27:40 2001
+++ lib/parse.c Tue May  1 15:28:21 2001
@@ -123,7 +123,7 @@
   lno= 1;
   pdone= 0;
-#define EOF_mmap(dataptr, endptr)      (dataptr > endptr)
+#define EOF_mmap(dataptr, endptr)      (dataptr >= endptr)
 #define getc_mmap(dataptr)             *dataptr++;
 #define ungetc_mmap(c, dataptr, data)  dataptr--;

Tags added: fixed Request was from Adam Heath <> to Full text and rfc822 format available.

Reply sent to Adam Heath <>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Itai Zukerman <>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #12 received at (full text, mbox):

From: Adam Heath <>
To: <>
Subject: dpkg_1.9.4_i386.changes INSTALLED (fwd)
Date: Mon, 28 May 2001 11:01:23 -0500 (CDT)

---------- Forwarded message ----------
Date: Wed, 02 May 2001 06:39:18 -0400
From: Debian Installer <>
To: Adam Heath <>, Wichert Akkerman <>
Subject: dpkg_1.9.4_i386.changes INSTALLED

  to pool/main/d/dpkg/dpkg-doc_1.9.4_all.deb
  to pool/main/d/dpkg/dpkg_1.9.4.dsc
dpkg-1.9.4.tar.gz byhand
  to pool/main/d/dpkg/dpkg_1.9.4.tar.gz
dpkg-1.9.4_i386.nondebbin.tar.gz byhand
  to pool/main/d/dpkg/dpkg_1.9.4_i386.deb
  to pool/main/d/dpkg/dpkg-dev_1.9.4_all.deb
Changes: dpkg (1.9.4) unstable; urgency=low
  * Oops.  EOF_mmap incorrectly detecting the end of the data block.
    Closes: Bug#95981.
  * After fixing the above bug, and using debootstrap to build a sid
    chroot, I discovered that my previous dependency cycle fix could cause
    segfaults in some situations.
Announcing to
Setting bugs to severity fixed: 95981

If the override file requires editing, reply to this mail.

Thank you for your contribution to Debian.

Send a report that this bug log contains spam.

Debian bug tracking system administrator <>. Last modified: Thu Apr 24 07:10:33 2014; Machine Name:

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.