chichengcn / gici-open

GNSS/INS/Camera Integrated Navigation Library
GNU General Public License v3.0
399 stars 112 forks source link

gici_main: run GIC-“segment fault” #6

Closed layfolk1999 closed 8 months ago

layfolk1999 commented 11 months ago

[ 96%] Building CXX object CMakeFiles/gici.dir/src/fusion/multisensor_estimating.cpp.o [ 96%] Building CXX object CMakeFiles/gici.dir/src/fusion/rtk_imu_camera_rrr_estimator.cpp.o [ 97%] Building CXX object CMakeFiles/gici.dir/src/fusion/rtk_imu_tc_estimator.cpp.o [ 97%] Building CXX object CMakeFiles/gici.dir/src/fusion/spp_imu_camera_rrr_estimator.cpp.o [ 98%] Building CXX object CMakeFiles/gici.dir/src/fusion/spp_imu_tc_estimator.cpp.o [ 99%] Linking CXX shared library libgici.so [ 99%] Built target gici Scanning dependencies of target gici_main [ 99%] Building CXX object CMakeFiles/gici_main.dir/src/gici_main.cpp.o [100%] Linking CXX executable gici_main /usr/bin/ld: warning: libglog.so.0, needed by libgici.so, may conflict with libglog.so.1 [100%] Built target gici_main liyi@liyi:~/code/gici-open-master/build$ ./gici_main ../option/pseudo_real_time_estimation_RTK.yaml 段错误

微信截图_20230711202938

Could you tell me how to solve this problem? Thanks!

chichengcn commented 11 months ago

It is so weird. Commonly, GICI would not terminate with segment fault without any error message presented.

It looks like an initialization-stage error, meaning the code did not run to line 80 in gici_main.cpp. You can add some breakpoints in debug mode or just add some std::cerr or std::cout at the lines before line 80 in gici_main.cpp. And then tell me which line causes the segment fault.

layfolk1999 commented 11 months ago

Thanks for your answer, so far only build succeeded, not yet compiled through, can't step by step debugging, I'll check again.

JINGERGER commented 11 months ago

I got the same issue yesterday. You have to make sure that your system only have one libglog.so which used by your project.I deleted other old libglogs and add some softlinks pointing a same libglog which links to the project.And it works.

layfolk1999 commented 11 months ago

Hello, @JINGERGERJ. About libglog, there are 3 files in "usr/local/lib", such as libglog.so, libglog.so.0.6.0 and libglog.so.1, the linking order is "libglog.so->libglog.so.1->libglog.so.0.6.0". I removed libglog.so.1 by 'rm' command and linked libglog.so to libglog.so.0.6.0, still there is warning "warning: libglog.so.0, needed by libgici.so, may conflict with libglog.so.1". I entered the command "locate I entered the command "locate libglog | grep usr" and found that libglog.so.1 still exists in the directory "usr/local/lib".

微信截图_20230712114043

Have you encountered this problem?

zzzzyp-sgg commented 11 months ago

Hello, @JINGERGERJ. About libglog, there are 3 files in "usr/local/lib", such as libglog.so, libglog.so.0.6.0 and libglog.so.1, the linking order is "libglog.so->libglog.so.1->libglog.so.0.6.0". I removed libglog.so.1 by 'rm' command and linked libglog.so to libglog.so.0.6.0, still there is warning "warning: libglog.so.0, needed by libgici.so, may conflict with libglog.so.1". I entered the command "locate I entered the command "locate libglog | grep usr" and found that libglog.so.1 still exists in the directory "usr/local/lib".

微信截图_20230712114043

Have you encountered this problem?

Actullay I encountered a similar problem when I try to run the example data, and I shared my solution in my blog:glog problem Please check whether you have ever installed the "glog" library using the "apt-get install" command. And the easiest method is to delete all "glog" and "gflags" and re-install them. But you have to watch out for other libraries linking to them. Hope this helps.

JINGERGER commented 11 months ago

Try to remove the one in /usr/local/lib

On Wed, Jul 12, 2023 at 11:56 layfolk1999 @.***> wrote:

Hello, @JINGERGERJ. About libglog, there are 3 files in "usr/local/lib", such as libglog.so, libglog.so.0.6.0 and libglog.so.1, the linking order is "libglog.so->libglog.so.1->libglog.so.0.6.0". I removed libglog.so.1 by 'rm' command and linked libglog.so to libglog.so.0.6.0, still there is warning "warning: libglog.so.0, needed by libgici.so, may conflict with libglog.so.1". I entered the command "locate I entered the command "locate libglog | grep usr" and found that libglog.so.1 still exists in the directory "usr/local/lib". [image: 微信截图_20230712114043] https://user-images.githubusercontent.com/139234731/252851141-740047ce-3869-4673-b2c1-e4f3c75bdd56.png

Have you encountered this problem?

— Reply to this email directly, view it on GitHub https://github.com/chichengcn/gici-open/issues/6#issuecomment-1631810236, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD3W6BMNDMF4E262J77AJKTXPYN6FANCNFSM6AAAAAA2F55QEY . You are receiving this because you commented.Message ID: @.***>

layfolk1999 commented 11 months ago

Ok, Thank you for your patience, the problem was successfully solved ! @zzzzyp-sgg @JINGERGER When I installed "glog" and "gflags" before, I did not distinguish the order of installation. And installing "libgoogle-glog-dev" and "libgflags*" related toolkits via "apt-get install" may cause the above problem.

In addition, the previous "segment error" was caused by my installation of a dependency, not an internal problem with the "gici-open" function. Thank you for your answer ! @chichengcn