coredump

How to generate a core dump in Linux on a segmentation fault?

不问归期 提交于 2019-12-16 20:14:22
问题 I have a process in Linux that's getting a segmentation fault. How can I tell it to generate a core dump when it fails? 回答1: This depends on what shell you are using. If you are using bash, then the ulimit command controls several settings relating to program execution, such as whether you should dump core. If you type ulimit -c unlimited then that will tell bash that its programs can dump cores of any size. You can specify a size such as 52M instead of unlimited if you want, but in practice

Another coredump issue in C

荒凉一梦 提交于 2019-12-14 03:32:11
问题 when I compile my code with g++ -g -o prueba prueba.cpp -lstdc++ -O3 -march=corei7 -mtune=corei7 -std=c++0x After debugging with g++ -g prueba.cpp , I got these: prueba.cpp:24:6: error: ‘stoi’ is not a member of ‘std’ tm = std::stoi(string2); ^ prueba.cpp:34:7: error: ‘stoi’ is not a member of ‘std’ ler = std::stoi(string1); ^ prueba.cpp:77:8: error: ‘stoi’ is not a member of ‘std’ C[i]=std::stoi(string); ^ The way I declare stoi as std::stoi was based on this example. And the broken block is

get the creation time from core dump

别等时光非礼了梦想. 提交于 2019-12-13 14:16:47
问题 I am working on a c++ application. I got some core files from the client which he says are generated now but is not willing to say how are they generated and what he has done from generating them. I doubt he is wrong and may be he gave me the dump which were generated long time ago. Is there any way where I can get the actual creation time of the file? I doubt the files may be created in some other servers and he has transferred them. Anyone pls help. If its not in the core file, may be Unix

compiling outdated PHP yields core dump with OpenSSL functions. OpenSSL version mismatch?

馋奶兔 提交于 2019-12-12 19:45:26
问题 I compiled OpenSSL 0.9.8x with these ./config options: ./config --prefix=/usr/local/openssl-0.9.8 --openssldir=/usr/local/openssl-0.9.8 I'm compiling my PHP version with these ./configure options (among others): --with-openssl=/usr/local/openssl-0.9.8 --with-openssl-dir=/usr/local/openssl-0.9.8 The problem is that when I run a PHP script with openssl_public_encrypt I'm getting a segmentation fault. Here's what gdb says: Program terminated with signal 11, Segmentation fault. #0

Unable to create a core file for my crashed program

守給你的承諾、 提交于 2019-12-12 08:36:26
问题 I am using Ubuntu 12.04 LTS. I wrote a simple program as follows to create crash // null.c #include<stdio.h> int main() { int *p = NULL; int k=*p; printf("%d",sizeof(0)); return 0; } Now I run with "gcc -g null.c" and then "./a.out" and the output is as expected. Segmentation fault (core dumped) Now I want to see the core dump file using gdb. I did the following things I checked the current directory, there is no core dump file I tried tried to change the /proc/sys/kernel/core_pattern with

how to generate a stack trace from a core dump file in C, without invoking an external tool such as gdb

南笙酒味 提交于 2019-12-12 02:21:07
问题 I am looking for a simple way to pull the stack trace out of a Linux core dump file programmatically, without having to invoke gdb. Anybody has an idea? To avoid confusion: I am not looking for a way to get my own back trace from inside a process. I am looking for a way to get a backtrace out of a completely independent core dump file I have. 回答1: If you really can't invoke gdb, but want a backtrace like the ones it provides, you could just copy the bits of gdb's source that are needed for

GDB debugging trace with no relevant info (#0 0x2e6e6f69 in ?? ())

牧云@^-^@ 提交于 2019-12-12 00:55:32
问题 I am facing a specific challenge while debugging with GDB. My binary is generating core. When i am debugging it GDB. I am not getting relevant debugging information. GDB stack trace (bt):- [root@ussdgw5 bin]# gdb pull core.11328 GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5) Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO

Segmentation fault (core dumped) runtime error in C

浪尽此生 提交于 2019-12-11 09:52:38
问题 Hi so I am new to C and just wrote my first program in the language and keep getting the segmentation fault error when I try to run it. I'm sure there are multiple small mistakes I have made throughout the code. I have gone through it and I can't figure out where my mistake is. Here is my code: // $Id: crpn.c,v 1.1 2013-10-22 13:28:04-07 - - $ #include <assert.h> #include <libgen.h> #include <stdio.h> #include <stdlib.h> int exit_status = EXIT_SUCCESS; #define EMPTY (-1) #define SIZE 16

Segmentation fault while using MPI_Barrier in `libpmpi.12.dylib`

北战南征 提交于 2019-12-11 08:08:02
问题 I install mpich using brew install mpich , but if I use MPI_Barrier , I will get segmentation fault. See the simple code below: // A.c #include "mpi.h" #include <stdio.h> int main(int argc, char *argv[]) { int rank, nprocs; MPI_Init(&argc,&argv); MPI_Comm_size(MPI_COMM_WORLD,&nprocs); MPI_Comm_rank(MPI_COMM_WORLD,&rank); MPI_Barrier(MPI_COMM_WORLD); printf("Hello, world. I am %d of %d\n", rank, nprocs);fflush(stdout); MPI_Finalize(); return 0; } mpicc A.c -g -O0 -o A After running mpirun -n 2

How to change this app to disable input from command line?

[亡魂溺海] 提交于 2019-12-11 07:29:18
问题 This is the Original code: #include <stdio.h> #include <string.h> #include <assert.h> #if defined(_WIN32) && !defined(__CYGWIN__) #include <windows.h> #else #include <sys/select.h> #endif #include <sphinxbase/err.h> #include <sphinxbase/ad.h> #include "pocketsphinx.h" static const arg_t cont_args_def[] = { POCKETSPHINX_OPTIONS, /* Argument file. */ {"-argfile", ARG_STRING, NULL, "Argument file giving extra arguments."}, {"-adcdev", ARG_STRING, NULL, "Name of audio device to use for input."},