[GHC] #14192: Change to 1TB VIRT allocation makes it impossible to core-dump Haskell programs
GHC
ghc-devs at haskell.org
Mon Sep 25 13:23:57 UTC 2017
#14192: Change to 1TB VIRT allocation makes it impossible to core-dump Haskell
programs
-------------------------------------+-------------------------------------
Reporter: nh2 | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Runtime System | Version: 8.0.2
Resolution: | Keywords: gdb,
| debugging
Operating System: Unknown/Multiple | Architecture:
Type of failure: Runtime | Unknown/Multiple
performance bug | Test Case:
Blocked By: | Blocking:
Related Tickets: #9706 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by bgamari):
Ahh, I see, `advise` isn't a bitmap; I've confirmed that this,
{{{#!c
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <sys/mman.h>
int main() {
const int len = 1024*1024*1024;
void *p = mmap(NULL, len, PROT_NONE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0);
if (p == MAP_FAILED) {
printf("uh oh: mmap failed: %s\n", strerror(errno));
}
int res = madvise(p, len, MADV_DONTDUMP);
if (res != 0) {
printf("uh oh: madvise failed: %s\n", strerror(errno));
}
assert(0); // use generate-core-file in gdb when this is hit
return 0;
}
}}}
produces a small (510kB) core dump in `gdb`.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14192#comment:15>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list