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

version graph

Package: dpkg; Maintainer for dpkg is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg is src:dpkg.

Reported by: Itai Zukerman <zukerman@math-hat.com>

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 <adam@lapdoog.doogie.brainfood.com>

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 debian-bugs-dist@lists.debian.org, Wichert Akkerman <wakkerma@debian.org>:
Bug#95981; Package dpkg. Full text and rfc822 format available.

Acknowledgement sent to Itai Zukerman <zukerman@math-hat.com>:
New Bug report received and forwarded. Copy sent to Wichert Akkerman <wakkerma@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Itai Zukerman <zukerman@math-hat.com>
To: submit@bugs.debian.org
Subject: dpkg segfault; bug in mmap code?
Date: 01 May 2001 15:37:03 -0400
Package: dpkg
Version: 1.9.2
Severity: grave

Hi,

# 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.

-itai

--- 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 <doogie@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Reply sent to Adam Heath <adam@lapdoog.doogie.brainfood.com>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Itai Zukerman <zukerman@math-hat.com>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #12 received at 95981-done@bugs.debian.org (full text, mbox):

From: Adam Heath <adam@lapdoog.doogie.brainfood.com>
To: <95981-done@bugs.debian.org>
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 <installer@ftp-master.debian.org>
To: Adam Heath <doogie@debian.org>, Wichert Akkerman <wakkerma@debian.org>
Subject: dpkg_1.9.4_i386.changes INSTALLED


Installing:
dpkg-doc_1.9.4_all.deb
  to pool/main/d/dpkg/dpkg-doc_1.9.4_all.deb
dpkg_1.9.4.dsc
  to pool/main/d/dpkg/dpkg_1.9.4.dsc
dpkg-1.9.4.tar.gz byhand
dpkg_1.9.4.tar.gz
  to pool/main/d/dpkg/dpkg_1.9.4.tar.gz
dpkg-1.9.4_i386.nondebbin.tar.gz byhand
dpkg_1.9.4_i386.deb
  to pool/main/d/dpkg/dpkg_1.9.4_i386.deb
dpkg-dev_1.9.4_all.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 debian-devel-changes@lists.debian.org
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 <owner@bugs.debian.org>. Last modified: Thu Apr 24 07:10:33 2014; Machine Name: buxtehude.debian.org

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