coredump

How to generate core dumps in Mac OS X?

纵然是瞬间 提交于 2019-11-27 03:59:01
It seems like I can not generate core dumps in Mac OS X 10.6.8. $ ulimit -c unlimited $ ./a.out Hello world! Segmentation fault $ find ~/ -type f -name core # ls -la /cores/ total 0 drwxrwxr-t@ 2 root admin 68 24 jui 2010 . drwxrwxr-t 31 root admin 1122 17 oct 15:52 .. My current directory, my HOME and /cores/ remain empty… TOC You can generate core dump files on Mac Os X like this: Create the file : /etc/launchd.conf , then : echo "limit core unlimited" | sudo tee -a /etc/launchd.conf Restart your Mac. And that's it, the core dump files are generated in the /cores directory. Be careful the

Core dump file is not generated

谁都会走 提交于 2019-11-27 03:37:12
Every time, my application crash a core dump file is not generated. I remember that few days ago, on another server it was generated. I'm running the app using screen in bash like this: #!/bin/bash ulimit -c unlimited while true; do ./server; done As you can see I'm using ulimit -c unlimited which is important if I want to generate a core dump, but it still doesn't generate it, when I got an segmentation fault. How can I make it work? Make sure your current directory (at the time of crash -- server may change directories) is writable. If the server calls setuid , the directory has to be

How do I dump an entire Python process for later debugging inspection?

大城市里の小女人 提交于 2019-11-27 02:06:17
问题 I have a Python application in a strange state. I don't want to do live debugging of the process. Can I dump it to a file and examine its state later? I know I've restored corefiles of C programs in gdb later, but I don't know how to examine a Python application in a useful way from gdb. (This is a variation on my question about debugging memleaks in a production system.) 回答1: There is no builtin way other than aborting (with os.abort(), causing the coredump if resource limits allow it) --

Minimal core dump (stack trace + current frame only)

烂漫一生 提交于 2019-11-27 01:57:56
问题 Can I configure what goes into a core dump on Linux? I want to obtain something like the Windows mini-dumps (minimal information about the stack frame when the app crashed). I know you can set a max size for the core files using ulimit , but this does not allow me to control what goes inside the core (i.e. there is no guarantee that if I set the limit to 64kb it will dump the last 16 pages of the stack, for example). Also, I would like to set it in a programmatic way (from code), if possible.

Mark data as sensitive in python

a 夏天 提交于 2019-11-27 01:35:32
I need to store a user's password for a short period of time in memory. How can I do so yet not have such information accidentally disclosed in coredumps or tracebacks? Is there a way to mark a value as "sensitive", so it's not saved anywhere by a debugger? Unknown Edit I have made a solution that uses ctypes (which in turn uses C) to zero memory. import sys import ctypes def zerome(string): location = id(string) + 20 size = sys.getsizeof(string) - 20 memset = ctypes.cdll.msvcrt.memset # For Linux, use the following. Change the 6 to whatever it is on your computer. # memset = ctypes.CDLL("libc

How to debug Java OutOfMemory exceptions?

拟墨画扇 提交于 2019-11-27 01:10:30
问题 What is the best way to debug java.lang.OutOfMemoryError exceptions? When this happens to our application, our app server (Weblogic) generates a heap dump file. Should we use the heap dump file? Should we generate a Java thread dump? What exactly is the difference? Update: What is the best way to generate thread dumps? Is kill -3 (our app runs on Solaris) the best way to kill the app and generate a thread dump? Is there a way to generate the thread dump but not kill the app? 回答1: Analyzing

Where are core dumps written on Mac?

坚强是说给别人听的谎言 提交于 2019-11-27 00:00:32
问题 On Mac OS X, if I send SIGQUIT to my C program, it terminates, but there is no core dump file. Do you have to manually enable core dumps on Mac OS X (how?), or are they written to somewhere else instead of the working directory? 回答1: It seems they are suppressed by default. Running $ ulimit -c unlimited Will enable core dumps for the current terminal, and it will be placed in /cores as core.PID . When you open a new session, it will be set to the default value again. 回答2: On macOS, your crash

How to programmatically cause a core dump in C/C++

南楼画角 提交于 2019-11-26 21:24:04
I would like to force a core dump at a specific location in my C++ application. I know I can do it by doing something like: int * crash = NULL; *crash = 1; But I would like to know if there is a cleaner way? I am using Linux by the way. paxdiablo Raising of signal number 6 ( SIGABRT in Linux) is one way to do it (though keep in mind that SIGABRT is not required to be 6 in all POSIX implementations so you may want to use the SIGABRT value itself if this is anything other than quick'n'dirty debug code). #include <signal.h> : : : raise (SIGABRT); Calling abort() will also cause a core dump, and

How to analyze information from a Java core dump? [closed]

删除回忆录丶 提交于 2019-11-26 19:43:48
If a process crashes and leaves a core dump or I create one with gcore then how can I analyze it? I'd like to be able to use jmap , jstack , jstat etc and also to see values of all variables. This way I can find the reasons for a crashed or frozen JVM. Okay if you've created the core dump with gcore or gdb then you'll need to convert it to something called a HPROF file. These can be used by VisualVM, Netbeans or Eclipse's Memory Analyzer Tool (formerly SAP Memory Analyzer). I'd recommend Eclipse MAT. To convert the file use the commandline tool jmap . # jmap -dump:format=b,file=dump.hprof /usr

Core dumped, but core file is not in the current directory?

淺唱寂寞╮ 提交于 2019-11-26 19:16:58
While running a C program, It says "(core dumped)" but I can't see any files under the current path. I have set and verified the ulimit : ulimit -c unlimited ulimit -a I also tried to find a file named "core", but didn't get the core dumped file? Any help, where is my core file? ephemient Read /usr/src/linux/Documentation/sysctl/kernel.txt . [/proc/sys/kernel/]core_pattern is used to specify a core dumpfile pattern name. If the first character of the pattern is a '|', the kernel will treat the rest of the pattern as a command to run. The core dump will be written to the standard input of that