Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750730AbVJIPQ3 (ORCPT ); Sun, 9 Oct 2005 11:16:29 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750783AbVJIPQ3 (ORCPT ); Sun, 9 Oct 2005 11:16:29 -0400 Received: from 68.105.138.210.bn.2iij.net ([210.138.105.68]:53261 "HELO viper2.netfort.gr.jp") by vger.kernel.org with SMTP id S1750730AbVJIPQ2 (ORCPT ); Sun, 9 Oct 2005 11:16:28 -0400 Date: Mon, 10 Oct 2005 00:16:38 +0900 Message-ID: <87zmpi3ell.dancerj%dancer@netfort.gr.jp> From: Junichi Uekawa To: 322309-submitter@bugs.debian.org, 322309@bugs.debian.org, 329468@bugs.debian.org, 329468-submitter@bugs.debian.org, debian-devel@bugs.debian.org, linux-kernel@vger.kernel.org, 332903-submitter@bugs.debian.org Subject: Debian woody dpkg no longer works with recent linux kernel. User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/21.4 (x86_64-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1627 Lines: 88 Hi, dpkg in Debian woody (3.0) is broken by recent linux kernels; due to the following command changing behavior (mmap of zero-byte length): addr=mmap(NULL, 0, PROT_READ, MAP_SHARED, fd, 0); These bugs are caused by mmap changing behavior; it used to return NULL when given a length of 0. However, it now returns -1, and gives back an errno=EINVAL. This triggers problems in Debian installation. The workaround is to give some content to the files: /var/lib/status /var/lib/available $ uname -r 2.6.14-rc3dancer-gedb4a353 $ ./a.c b a.c: In function 'main': a.c:26: warning: comparison between pointer and integer mmap: Invalid argument $ ls -l b -rw-r--r-- 1 dancer dancer 0 2005-10-09 22:29 b $ uname -r 2.2.26 $ cat a.c /*BINFMTC: * */ #include #include #include #include #include #include int main(int argc, char **argv) { int fd; void*addr; if (argc < 2) { fprintf(stderr, "Filename required\n"); return 1; } if((fd=open(argv[1], O_RDONLY))==-1) { perror("open"); return 1; } addr=mmap(NULL, 0, PROT_READ, MAP_SHARED, fd, 0); if (addr==-1) { perror("mmap"); return 1; } printf ("%p\n", addr); if(close(fd)==-1) { perror("close"); return 1; } return 0; } $ ./a.out b (nil) regards, junichi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/