Why do I get a SIGABRT?

Why is my program causing SIGABRT error?

1 Like

SIGABRT errors are caused by your program aborting due to a fatal error. In C++, this is normally due to an assert statement in C++ not returning true, but some STL elements can generate this if they try to store too much memory.

3 Likes

http://www.codechef.com/viewsolution/5896387

Why do i get SIGABART here?

scanf( “%d”, &( hill + i ) );
This line is wrong in your source code. You are deferencing then asking for address, you should write either (hill+i) or &hill
. No need for * operator.

1 Like

https://www.codechef.com/viewsolution/11008844

Why do i get SIGABART here?

https://www.codechef.com/viewsolution/11160529

why do i get SIGABART here ? the code works really fine when executed on other C IDEs.

https://www.codechef.com/viewsolution/11454050 why d i get sigabrt error ?

https://www.codechef.com/viewsolution/12914859 Why SIGABRT error here? It works fine on GeeksforGeeks IDE.

1 Like

@msinojia

int* ans = new int[t]; should be written after cin>>t;

https://www.codechef.com/submit/complete/12915409

1 Like

why do i get SIGABRT here?? https://www.codechef.com/viewsolution/24406520

scanf("%d",&A[length]);
This line is the problem. The address of pointer A is being tried over here.

You’re using uninitialized variable to calloc

why do i get a SIGABRT here ??
https://www.codechef.com/viewsolution/28404310

The variable a points to a single uint with value N, not an array of N uints :slight_smile: If you want the latter, declare it as

a=new uint[N];

or, even better, just use a std::vector and avoid the whole mess :slight_smile:

1 Like