Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

mremap(2) kernel diagnostic assertion for NULL address



Hi,

I just got hit by a kernel diagnostic assertion, with a mremap(2) call
with a NULL value for old address ...

panic: kernel diagnostic assertion "&map->header != entry" failed:
file "/local/src/NetBSD/src/sys/uvm/uvm_mremap.c", line 62
fatal breakpoint trap in supervisor mode
trap type 1 code 0 rip ffffffff80230595 cs 8 rflags 246 cr2
7f7ffdb8a0f0 cpl 0 rsp ffff800051f57a50
Stopped in pid 568.1 (mremap) at        netbsd:breakpoint+0x5:  leave
db{1}> bt
breakpoint() at netbsd:breakpoint+0x5
panic() at netbsd:panic+0x29a
__kernassert() at netbsd:__kernassert+0x2d
uvm_mremap() at netbsd:uvm_mremap+0x51e
sys_mremap() at netbsd:sys_mremap+0x7f
syscall() at netbsd:syscall+0xb7

Small testscase attached ...

Thanks in advance.

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.
#include <sys/mman.h>
#include <err.h>
#include <stdlib.h>

int main() {
  size_t len1, len2;
  void *buf;

  len1 = 4096; len2 = 2 * len1;

  buf = mremap(NULL, len1, NULL, len2, 0);
  if (buf != MAP_FAILED)
    err(1, "mremap failed");

  return 0; }


Home | Main Index | Thread Index | Old Index