0

In my project I added a new module and now my process is being terminated by signal 11 . I want to track and understand the problem but no coredump file is generated by freebsd. I set sysctl like :

sysctl -a | grep core
kern.corefile: /usr/core
kern.nodump_coredump: 1
kern.coredump: 1
kern.sugid_coredump: 1
debug.elf64_legacy_coredump: 1
debug.elf32_legacy_coredump: 1

I also set ulimit -c unlimited

From my code I removed all code about signal like "sigaction(SIGTERM, &signal, &signal_old);" for not preventing kernel to generate coredump.

Why I can't see any coredump still ? What I am missing ?

Also are there any method forcing a program which run on freebsd to create coredump an equivalent to do_coredump() in linux?

4

2 回答 2

2

问题出在:

kern.corefile: /usr/core

类似以下的内容应该会有所帮助:

sysctl -w kern.corefile = "%N.core"

于 2013-05-17T14:01:28.830 回答
1

If I recall correctly, kern.corefile is the complete name of the resulting corefile, not the directory in which it should be placed. It also needs to be writable by the user running the process. /usr/core looks like a directory and/or a location writable only by root.

kern.nodump_coredump: 1 also looks suspicious.I don't remember that sysctl existing in the last version of FreeBSD I used, but it looks like it's intended to disable core dumps. Try setting it to 0.

于 2013-05-17T14:10:12.583 回答