mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Peter Seiderer" <ps.report@gmx.net>
To: linux-kernel@vger.kernel.org
Subject: Re: [BUG][2.6.8.1] Nevver dump core while /dev/men is mmaped
Date: Tue, 21 Sep 2004 16:18:47 +0200 (MEST)	[thread overview]
Message-ID: <18354.1095776327@www24.gmx.net> (raw)
In-Reply-To: <Pine.LNX.4.53.0409210944320.3495@chaos.analogic.com>

> On Tue, 21 Sep 2004, Peter Seiderer wrote:
> 
> > Hello,
> > the following short program stops my computer immediately (no more
> > input, telnet etc. possible):
> >
> > --- begin ---
> > #include <stdio.h>
> > #include <sys/types.h>
> > #include <sys/stat.h>
> > #include <fcntl.h>
> > #include <sys/mman.h>
> > #include <assert.h>
> >
> > int main(int argc, char *argv[]) {
> > 	int fd;
> > 	assert((fd = open("/dev/mem", O_RDWR)) != (-1));
> >
> > 	size_t s = 67108864;
> > 	void *m;
> > 	assert((m = mmap(NULL, s, PROT_READ|PROT_WRITE, MAP_SHARED, fd,
> > 0xd0000000)) != NULL);
>          ^^^^^^^^^^^^^^^
>  Incorrect. mmap() returns MAP_FAILED, (void *)-1, when it fails, not
> NULL, (void *)0.
> 
> 
> Cheers,
> Dick Johnson
> Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips).
>             Note 96.31% of all statistics are fiction.
> 

Shit, you are right! But did not change anything on the bad kernel
behaviour.....the mmap succeeds, and the kernel hangs in elf_core_dump.
Peter

-- 
+++ GMX DSL Premiumtarife 3 Monate gratis* + WLAN-Router 0,- EUR* +++
Clevere DSL-Nutzer wechseln jetzt zu GMX: http://www.gmx.net/de/go/dsl


      reply	other threads:[~2004-09-21 14:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-21 13:19 Peter Seiderer
2004-09-21 13:47 ` Richard B. Johnson
2004-09-21 14:18   ` Peter Seiderer [this message]

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=18354.1095776327@www24.gmx.net \
    --to=ps.report@gmx.net \
    --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

all inboxes | Powered by JetHome®