From: TeJun Huh <tj@atj.dyndns.org>
To: linux-kernel@vger.kernel.org
Subject: [BUG] mm deadlock
Date: Thu, 9 May 2002 12:21:18 +0900 [thread overview]
Message-ID: <20020509032118.GA850@atj.dyndns.org> (raw)
Running the following program on linux 2.4.18 SMP results in lockup
of the thread and some part of the system (any attempt to access the
thread list results in the lockup of the attempting thread).
The program basically mmaps memory until the mmapped region is very
close to the bottom of the stack with some unmapped region inbetween.
Then it tries to access region beyond the end of the highest mmaped
region. I think it has something to do with stack growth.
---- program follows ----
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
#define BASE_SIZE (32 << 20)
#define MIN_SIZE (512 << 10)
int main(void)
{
size_t size;
unsigned long *p, *lastp;
size_t last_size;
int i;
lastp = NULL;
size = BASE_SIZE;
while (size >= MIN_SIZE) {
p = mmap(0, size, PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_ANONYMOUS, 0, 0);
if (p == (unsigned long *)-1)
size >>= 1;
else {
lastp = p;
last_size = size;
}
}
p = lastp + last_size / sizeof(unsigned long);
for (i = 0; i < last_size / sizeof(unsigned long); i++)
p[i] = i;
printf("ok\n");
return 0;
}
reply other threads:[~2002-05-09 3:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20020509032118.GA850@atj.dyndns.org \
--to=tj@atj.dyndns.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tejun@aratech.co.kr \
/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®