lundi 27 juin 2016

CLion creates a stackdump for my program only when executed in Run Tool Window

I have Clion 2016.1.3 installed on my Windows 10 PC. Currently I'm having an issue with CLion's Run Tool. Whenever I execute a C program, It creates a mysterious (because I can't unstand it) .stackdump file for my program. I'm sure my program is healthy because It works fine when executed manually in command prompt.
This error occurs only when I tried to execute it via Run Tool. I don't know what is the reason behind this strange case. To get an Idea let me present two screenshots.

Here is what I see when I execute my program via Run Tool, enter image description here

And Here is the output when I execute It via the Terminal, enter image description here

As you can see in the first screenshot (Run Tool), It doesn't give me the output as the second screenshot. Instead, I have a .stackdump file starts with this string (I'm using Cygwin)

Exception: STATUS_ACCESS_VIOLATION at rip=0010040150B

What is this STATUS_ACCESS_VIOLATION why did is happens only on Run Tool?

As far as I know (source) STATUS_ACCESS_VIOLATION is occurred when

1) Another program's memory spaces without permissions.

2) Data past the end of a block of data (sometimes it causes an error, sometimes it doesn't. Depends on what's using the memory at the time)

3) And three, calling some string functions, like strcpy() and strcat() and passing them a pointer to a memory space that hasn't been initialized or contains nothing. (Famous combination is GETENV, and then STRCPY, killed me numerous times b/c GETENV returned null/empty)

However I can't figure out how these possibilities applies to my program, It is completely OK (If you want to see it, go here)

Could anyone please explain why this error happens and how to fix it?
I tried google but It didn't help me.

I tried these thing:

  • flush the stdout buffer, fflush(stdout);
  • used setbuf, setbuf(stdout, NULL);
  • turn off Avast! auto scan for executions

Additional Facts:

  • I tried both MinGW and Cygwin environments but no help
  • I tried this same program in ubuntu (same version of CLion), However there is no error like this.
  • And this error doesn't appear in my previous projects, which were created with CLion's previous versions (below 2016.1.2). So I can suspect this has to do something with new versions of CLion

Aucun commentaire:

Enregistrer un commentaire