Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault when running make test #3

Closed
ftesser opened this issue Jun 24, 2016 · 1 comment
Closed

Segmentation fault when running make test #3

ftesser opened this issue Jun 24, 2016 · 1 comment

Comments

@ftesser
Copy link
Contributor

ftesser commented Jun 24, 2016

I successfully followed the compiling instructions.

Running make test I always obtain segfault.

I put below the output:

$$ make test 
cc -DFP_TYPE=float -Ofast -std=c99 -Wall -fPIC  -o ./build/pyin-test test/test.c external/matlabfunctions.c ./build/libpyin.a external/libgvps/build/libgvps.a -lm
test/test.c: In function ‘main’:
test/test.c:48:16: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
   FP_TYPE* x = wavread(argv[1], & fs, & nbit, & nx);
                ^
external/matlabfunctions.c: In function ‘wavread’:
external/matlabfunctions.c:197:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
     fread(for_int_number, 1, quantization_byte, fp);  // "data"
     ^
external/matlabfunctions.c: In function ‘CheckHeader’:
external/matlabfunctions.c:39:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
   fread(data_check, 1, 4, fp);  // "RIFF"
   ^
external/matlabfunctions.c:46:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
   fread(data_check, 1, 4, fp);  // "WAVE"
   ^
external/matlabfunctions.c:51:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
   fread(data_check, 1, 4, fp);  // "fmt "
   ^
external/matlabfunctions.c:56:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
   fread(data_check, 1, 4, fp);  // 1 0 0 0
   ^
external/matlabfunctions.c:62:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
   fread(data_check, 1, 2, fp);  // 1 0
   ^
external/matlabfunctions.c:67:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
   fread(data_check, 1, 2, fp);  // 1 0
   ^
external/matlabfunctions.c: In function ‘GetParameters’:
external/matlabfunctions.c:83:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
   fread(for_int_number, 1, 4, fp);
   ^
external/matlabfunctions.c:88:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
   fread(for_int_number, 1, 2, fp);
   ^
external/matlabfunctions.c:94:7: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
       fread(&data_check[1], 1, 3, fp);
       ^
external/matlabfunctions.c:107:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
   fread(for_int_number, 1, 4, fp);  // "data"
   ^
./build/pyin-test test/vaiueo2d.wav
makefile:12: recipe for target 'test' failed
make: *** [test] Segmentation fault (core dumped)

During the compiling I noticed the follwing, warning:

In file included from pyin.c:34:0:
external/libgvps/gvps.h:37:0: warning: "FP_TYPE" redefined
 #define FP_TYPE double
 ^
<command-line>:0:0: note: this is the location of the previous definition

I suspect this redefinition can be the origin of the issue.

@Sleepwalking
Copy link
Owner

Hello ftesser,

You are absolutely right. FP_TYPE should be consistent across all libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants