coredump

How to generate core dump file in Ubuntu [duplicate]

独自空忆成欢 提交于 2019-11-26 15:46:43
问题 This question already has answers here : How to generate a core dump in Linux on a segmentation fault? (12 answers) Closed 5 years ago . I would like to know how to generate a core dump file in Ubuntu. I am using Ubuntu 8.04.1 and gcc compiler 4.2.3. I have written a simple C program to generate a core dump. I have compiled the program as in -- gcc -g badpointer.c . When I run the program its gives segmentation fault but no core dump is generated. What additional things do i have to do to

How can a C program produce a core dump of itself without terminating?

喜你入骨 提交于 2019-11-26 15:37:55
问题 I want a C program to produce a core dump under certain circumstances. This is a program that runs in a production environment and isn't easily stopped and restarted to adjust other kinds of debugging code. Also, since it's in a production environment, I don't want to call abort(). The issues under investigation aren't easily replicated in a non-production environment. What I'd like is for the program, when it detects certain issues, to produce a core dump on its own, preferably with enough

Core dump file analysis [duplicate]

陌路散爱 提交于 2019-11-26 12:34:48
This question already has an answer here: How do I analyze a program's core dump file with GDB when it has command-line parameters? 9 answers What are all the things I will need to check while analyzing core dump file? Please tell me from scratch. You just need a binary (with debugging symbols included) that is identical to the one that generated the core. Then you can run gdb path/to/the/binary path/to/the/core to debug it. When it starts up, you can use bt (for backtrace) to get a stack trace from the time of the crash. In the backtrace, each function invocation is given a number. You can

How to generate core dumps in Mac OS X?

夙愿已清 提交于 2019-11-26 10:58:43
问题 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… 回答1: 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

Core dump file is not generated

老子叫甜甜 提交于 2019-11-26 10:34:35
问题 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? 回答1: Make sure your current directory (at the time of

Mark data as sensitive in python

半腔热情 提交于 2019-11-26 09:42:58
问题 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? 回答1: 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

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

心不动则不痛 提交于 2019-11-26 07:55:18
问题 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. 回答1: 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

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

我是研究僧i 提交于 2019-11-26 07:23:56
问题 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. 回答1: 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

Core dump file analysis [duplicate]

情到浓时终转凉″ 提交于 2019-11-26 02:59:45
问题 This question already has an answer here: How do I analyze a program's core dump file with GDB when it has command-line parameters? 9 answers What are all the things I will need to check while analyzing core dump file? Please tell me from scratch. 回答1: You just need a binary (with debugging symbols included) that is identical to the one that generated the core. Then you can run gdb path/to/the/binary path/to/the/core to debug it. When it starts up, you can use bt (for backtrace) to get a

How do I analyze a program's core dump file with GDB when it has command-line parameters?

戏子无情 提交于 2019-11-26 01:46:37
问题 My program operates like this: exe -p param1 -i param2 -o param3 It crashed and generated a core dump file, core.pid . I want to analyze the core dump file by gdb ./exe -p param1 -i param2 -o param3 core.pid But GDB recognizes the parameters of the EXE file as GDB\'s input. How do I analyze a core dump file in this situation? 回答1: You can use the core with gdb in many ways, but passing parameters which is to be passed to executable to gdb is not the way to use core file. This could also be