From: Junichi Uekawa <dancer@netfort.gr.jp>
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.
Date: Mon, 10 Oct 2005 00:16:38 +0900 [thread overview]
Message-ID: <87zmpi3ell.dancerj%dancer@netfort.gr.jp> (raw)
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 <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/mman.h>
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
next reply other threads:[~2005-10-09 15:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-09 15:16 Junichi Uekawa [this message]
2005-10-09 22:33 ` Bug#322309: " Scott James Remnant
2005-10-10 1:07 ` Junichi Uekawa
2005-10-11 14:24 ` Junichi Uekawa
2005-10-11 15:15 ` Junichi Uekawa
2005-10-11 15:19 ` Jon Masters
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zmpi3ell.dancerj%dancer@netfort.gr.jp \
--to=dancer@netfort.gr.jp \
--cc=322309-submitter@bugs.debian.org \
--cc=322309@bugs.debian.org \
--cc=329468-submitter@bugs.debian.org \
--cc=329468@bugs.debian.org \
--cc=332903-submitter@bugs.debian.org \
--cc=debian-devel@bugs.debian.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome