June 28th, 2013, 08:30 AM
Segmentation Fault At Run Time
Debugging I have a Suspended Signal SIGSEGV : Segmantation Fault before entering the function:
void prefilterCompilation(double** radius, double** theta, int cols , int rows);
It must be an error about radius and theta but I don' t understand why. What I did with this variables in the main:
The strange thing is that I could enter in the function before. After changing something in , now I can not enter inside again. And what I change in a first time was working good.when I finish to change every thing with relationship with the first thing I changed, I could not enter again.
double** radius, **theta;
June 28th, 2013, 10:12 AM
OK, where is the real code?
raidus is spelled wrong, and there's a missing ) at the end of the statement.
> for(int i=0;i<rows;i++);
There is an extra ; at the end. What this means is the loop does nothing at all, then....
This becomes an out of bound memory access.
Also, remove all those casts on the result of malloc. It serves NO useful purpose in a correctly written C program (at worst, it hides a serious bug).
If you get warnings about "cannot convert void*", then stop using C++ to compile your C code.
If this really is C++ code, then in the first instance you should be using std::vector, or failing that, the new operator.
June 28th, 2013, 10:28 AM
for the first and second points, I just dind copy well because I m using a VM and can not use from there internet. Now why the third is an error? I studied C language for this I write in C, but my work is about image-processing, so I have to use C++ for some function of this library.