FAQ Database Discussion Community


Error with stoi and debugged with gdb [closed]

c++,c++11,segmentation-fault,coredump
My OS is ubuntu 14.04, laptop, i7. The g++ version is g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2. I tried to run a simple code to test stoi: #include <string> int main() { std::string s = "123"; int i = std::stoi(s); } When I compile it with: g++ -g prueba2.cpp, I get: prueba2.cpp:...

Another coredump issue in C

c++,c,segmentation-fault,coredump
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);...

segmentation fault issue # n

c++,segmentation-fault,coredump
Is this command line wrong? FILE *TM = fopen("TM","r"); When I compile my code with: g++ -O3 -march=corei7 -mtune=corei7 -std=c++11 prueba3.cpp -o prueba3 -lstdc++ or g++ -O3 -march=corei7 -mtune=corei7 -std=c++0x prueba3.cpp -o prueba3 -lstdc++ and then run the executable, I got: Segmentation fault (core dumped) When I debug the code...

Why does scikit-learn cause core dumped?

python,scikit-learn,coredump
I try to run a simple linear fit in scikit-learn: from sklearn import linear_model clf = linear_model.LinearRegression() clf.fit ([[0, 0], [1, 1], [2, 2]], [0, 1, 2]) As a result I get: Illegal instruction (core dumped) Does anybody know what is the reason of this problem and how the problem...

get N-th byte from mmaped file

c,memory,segmentation-fault,mmap,coredump
I'm new at C and now I'm learning about mmap. I want to get N-th byte from mmaped file, but I get this error Segmentation Fault (core dumped) When I test my program with gdb I get that something is wrong with this line printf("%d\n", (int) data[sk]); and then I...

How to set breakpoints and make it break when debugging core dump with gdb?

gdb,coredump
How to set breakpoints and make it break when debugging core dump with gdb? When I use the command "gdb program core", the process halt at the crash point, how can I make the process break before halting there. If I cannot make it break, which commands I can use...

what is the reason for core dump? stack shows from oracle lib

c++,oracle11g,coredump
I have a coredmp where all thread stack look normal but one stack shows like this. Can any one tell me possible reason for this? i can see exit is being called from oracle libs, is this issue of oracle? Can any one guide me when this can happen? Thread...

fgets not reading complete line in C

c,pointers,readfile,fgets,coredump
I have a file data.csv which contains float type data: 0.22,0.33,0.44 0.222,0.333,0.444 I need to read this file into a two dimensional dynamic array. But I am not able to read the full line with fgets. Not sure why? Here is my C code which I used on Ubuntu: #include...

Segmentation fault (core dumped) C++ as I use a lot of memory [duplicate]

c++,memory,segmentation-fault,coredump
This question already has an answer here: Segmentation Fault C++ (array too large?) 3 answers In C++ I am using my 'user' class, and my code has only the following 3 lines: cout<<"size of user = "<<sizeof(user)<<endl; //prints 160 cout<<"size of all users = "<<NUM_OF_USERS*sizeof(user)<<endl; user users[NUM_OF_USERS]; //creates an...

KdTree C implementation resulting in core dump

c,coredump,kdtree
I'm dealing with a core dump issue to which whom I cannot find a solution. Any kind of help would be appreciated 'cause I'm getting hopeless. I assume the error appears when getting to the second execution of the building function but I'm clueless what's the fuss about. http://pastebin.com/XwW33VY8 struct...

segmentation fault core dump in kruskal's algorithm

c,segmentation-fault,coredump
#include<stdio.h> int find( int, int parent[10] ); int uni( int, int, int parent[10] ); int main() { int i, j, k, a, b, u, v, n, ne = 1; int min, mincost = 0, cost[9][9], parent[9]; printf( "\n\tImplementation of Kruskal's algorithm\n" ); printf( "\nEnter the no. of vertices:" ); scanf(...