Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cygwin Exception : open stack dump file

I am developing in C language a linux command interpreter on windows 7, using Cygwin. My code was compiling and running correctly, until I get this error:

cygwin_exception::open_stackdumpfile:Dumping stack trace to jstack dump
like image 450
Wissem Ayari Avatar asked Sep 14 '14 20:09

Wissem Ayari


3 Answers

I find that I get this error when I try passing a value into a function when the funtion is expecting a pointer.

For example:

int arr[] = {1, 2, 3};
int i = 3;
memmove(i, arr, 3);

This code will get a cygwin_exception::open_stackdumpfile because you are passing int i, which is a value, into a function which is expecting a memory address.

However, this is based purely off of my experience and it is certainly possible that there are other causes for this error.

like image 126
Steve Avatar answered Nov 14 '22 07:11

Steve


I just had this problem today. I found out that there was another cygwin session (shell) running in the background. Its possible that they affected each others memory locations/allocation. Once I killed them both, opened a new one, and everything back to normal! I hope it helps

like image 2
salouri Avatar answered Nov 14 '22 07:11

salouri


I had this error trying to use memcpy(). The problem was that I was trying to copy an array into a non-initialized pointer.

The error code:

int array[] = {1, 2, 3, 4, 5};
int *arrPtr = array;
int *mem_ptr = NULL;                           // this row
memcpy(mem_ptr, array, 5 * sizeof(int));

How I solved:

int array[] = {1, 2, 3, 4, 5};
int *arrPtr = array;
int *mem_ptr = malloc(sizeof(int) * 5);       // this row
memcpy(mem_ptr, array, 5 * sizeof(int));
like image 1
Cătălina Sîrbu Avatar answered Nov 14 '22 05:11

Cătălina Sîrbu