Open demiangomez opened 7 years ago
hi, check this https://github.com/blaines/RTKLIB/blob/master/src/rtkcmn.c @blaines he may find some way to fix Segmentation fault
hi, I'm trying to run rnx2rtkp on mac OS X (10.12.4) and after awhile I was finally able to compile the app (-lSystem.B might have helped). Now when a run rnx2rtkp I get the same "Segmentation fault: 11". Does anyone have an idea what could it be?
thanks
Does anyone have an idea what could it be?
Probably yet another uninitialized variable / pointer / pointer array / string. RTKLIB is full of them.
Check out the fork in https://github.com/rtklibexplorer/RTKLIB/tree/demo5 It compiles cleanly.
I've successfully compiled in OS X 10.12.3 (Sierra) using -lSystem.B as suggested in this issue: https://github.com/tomojitakasu/RTKLIB/issues/137. However, when I try to run rnx2rtkp I get "Segmentation fault: 11". I also tried removing -lrt (without adding -lSystem.B) and I get the same error. In Linux (Ubuntu 14.04) it works fine (without changing -lrt). I can't see anything wrong with the compilation, other than just some warnings (gcc seems not to know about -Wno-unused-but-set-variable):
`make CC=gcc all gcc -c -Wall -O3 -ansi -pedantic -Wno-unused-but-set-variable -I../../../src -DTRACE -DENAGLO -DENAQZS -DENAGAL -DNFREQ=3 -g ../rnx2rtkp.c warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option] ../rnx2rtkp.c:20:19: warning: unused variable 'rcsid' [-Wunused-const-variable] static const char rcsid[]="$Id: rnx2rtkp.c,v 1.1 2008/07/17 21:55:16 ttaka Exp $"; ^ 2 warnings generated. gcc -c -Wall -O3 -ansi -pedantic -Wno-unused-but-set-variable -I../../../src -DTRACE -DENAGLO -DENAQZS -DENAGAL -DNFREQ=3 -g ../../../src/rtkcmn.c warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option] ../../../src/rtkcmn.c:1566:21: warning: unused variable 'tp' [-Wunused-variable] struct timespec tp={0}; ^ ../../../src/rtkcmn.c:2979:21: warning: implicit declaration of function 'strtok_r' [-Wimplicit-function-declaration] for (p=s1,q=strtok_r(s2,"",&r);q;q=strtok_r(NULL,"",&r)) { ^ ../../../src/rtkcmn.c:2979:20: warning: incompatible integer to pointer conversion assigning to 'char ' from 'int' [-Wint-conversion] for (p=s1,q=strtok_r(s2,"",&r);q;q=strtok_r(NULL,"",&r)) { ^
~~~~~~~ ../../../src/rtkcmn.c:2979:44: warning: incompatible integer to pointer conversion assigning to 'char ' from 'int' [-Wint-conversion] for (p=s1,q=strtok_r(s2,"",&r);q;q=strtok_r(NULL,"",&r)) { ^~~~~~ ../../../src/rtkcmn.c:122:19: warning: unused variable 'rcsid' [-Wunused-const-variable] static const char rcsid[]="$Id: rtkcmn.c,v 1.1 2008/07/17 21:48:06 ttaka Exp ttaka $"; ^ 6 warnings generated. gcc -c -Wall -O3 -ansi -pedantic -Wno-unused-but-set-variable -I../../../src -DTRACE -DENAGLO -DENAQZS -DENAGAL -DNFREQ=3 -g ../../../src/rinex.c warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option] ../../../src/rinex.c:441:52: warning: if statement has empty body [-Wempty-body] else if (strstr(label,"PRN / # OF OBS" )) ; / opt / ^ ../../../src/rinex.c:441:52: note: put the semicolon on a separate line to silence this warning ../../../src/rinex.c:87:19: warning: unused variable 'rcsid' [-Wunused-const-variable] static const char rcsid[]="$Id:$"; ^ 3 warnings generated. gcc -c -Wall -O3 -ansi -pedantic -Wno-unused-but-set-variable -I../../../src -DTRACE -DENAGLO -DENAQZS -DENAGAL -DNFREQ=3 -g ../../../src/rtkpos.c warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option] ../../../src/rtkpos.c:41:19: warning: unused variable 'rcsid' [-Wunused-const-variable] static const char rcsid[]="$Id:$"; ^ 2 warnings generated. gcc -c -Wall -O3 -ansi -pedantic -Wno-unused-but-set-variable -I../../../src -DTRACE -DENAGLO -DENAQZS -DENAGAL -DNFREQ=3 -g ../../../src/postpos.c warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option] ../../../src/postpos.c:909:40: warning: address of array 'fopt->blq' will always evaluate to 'true' [-Wpointer-bool-conversion] if (popt_.mode>PMODE_SINGLE&&fopt->blq) {