Is it possible to get a core dump of a running process and its symbol table?
Or run gcore $(pidof processname). This has the benefit (over running gdb and issuing commands to the CLI) that you attach and detach in the shortest possible time.
Or run gcore $(pidof processname). This has the benefit (over running gdb and issuing commands to the CLI) that you attach and detach in the shortest possible time.
By default, crashes are reported into .crash files which can be found in /Library/Logs/DiagnosticReports (system-wide) and ~/Library/Logs/DiagnosticReports (user). These files can be opened by using Console app, in User or System Reports. The .crash files are in plain text format and should include relevant information about the crash. In order to activate the full core … Read more
Linux Activate your coredumps by the following command: ulimit -c unlimited Also, check the core_pattern value by: sysctl kernel.core_pattern to see where your dumps are created (%e will be the process name, and %t will be the system time). You can change it in /etc/sysctl.conf and then reload by sysctl -p. You can test it … Read more
void create_dump(void) { if(!fork()) { // Crash the app in your favorite way here *((void*)0) = 42; } } Fork the process then crash the child – it’ll give you a snapshot whenever you want
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.
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 … Read more
You can resolve this in several ways: Use g++ in stead of gcc: g++ -g -o MatSim MatSim.cpp Add -lstdc++: gcc -g -o MatSim MatSim.cpp -lstdc++ Replace <string.h> by <string> This is a linker problem, not a compiler issue. The same problem is covered in the question iostream linker error – it explains what is … Read more
There are two common kinds of SEGV, which is an error that results from an invalid memory access: A page was accessed which had the wrong permissions. E.g., it was read-only but your code tried to write to it. This will be reported as SEGV_ACCERR. A page was accessed that is not even mapped into … Read more
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 = … Read more
This link contains a good checklist why core dumps are not generated: The core would have been larger than the current limit. You don’t have the necessary permissions to dump core (directory and file). Notice that core dumps are placed in the dumping process’ current directory which could be different from the parent process. Verify … Read more