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

Ubuntu18编译卡壳, c++: internal compiler error: Segmentation fault (program cc1plus) #56

Open
zhjpqq opened this issue Sep 1, 2021 · 3 comments

Comments

@zhjpqq
Copy link

zhjpqq commented Sep 1, 2021

编译环境:
Ubuntu18.04, ROS-Melodic, OpenCV3.4.9, CUDA10.2, GCC/G++5.5/7.5
image

编译时候报错:c++: internal compiler error: Segmentation fault (program cc1plus)
image
image

已经尝试过的解决方法:
找到相关issues:https://github.com/RoboMaster/RoboRTS/issues/40,但报错位置不一样,无法解决。
另参考其他博文,增加SWAP2G也不能解决,将GCC/G++从7.5降级到5.5也不能解决。
https://blog.csdn.net/u013095333/article/details/94188743

补充说明如下:
因为跟官方的ros-kinetic和ubuntu16版本不一样,用sudo apt-get install -y ros-melodic-cv-bridge安装cv-bridge,
但编译RoboRTS时会opencv报错 "CV_FOURCC找不到标识符"。
所以在src下单独添加vision_opencv进行cv_bridge的编译,且单独编译vision_opencv包可以通过。

编译出错日志如下,internal compiler error的出错位置在:
'RoboRTS/roborts_costmap/CMakeFiles/roborts_costmap.dir/src/observation_buffer.cpp.o' failed

发现上述失败之后,连续多次重复catkin_make,详细日志如下:

caktin_make 第1次编译.txt
catkin_make 第2次编译.txt
catkin_make 第4次编译.txt

最后一次显示空间不足,是刚刚出现的问题。之前 反复编译不下10次,没有空间不足报错,仍然有 internal compiler error: Segmentation fault (program cc1plus) 这个问题。

希望能尽快得到解答,谢谢!
有相同问题的,或者能帮忙解决的也可以回复下,在线等~~~
wx: zhjphust

设备相关参数和信息如下:虚拟内存已从原来的16G增加至22G
xaiver-3
xaiver-5

@zhjpqq zhjpqq changed the title c++: internal compiler error: Segmentation fault (program cc1plus) Ubuntu18编译卡壳, c++: internal compiler error: Segmentation fault (program cc1plus) Sep 1, 2021
@wdczz
Copy link

wdczz commented Dec 1, 2021

linux查看修改线程默认栈空间大小(ulimit -s),默认空间1024=1M,过小,改为10240=10M,可以编译。
查看ulimit -s

  1. 修改配置文件
    sudo vim /etc/security/limits.conf

nvidia hard stack 10240
nvidia soft stack 10240
ubuntu hard stack 10240
ubuntu soft stack 10240
root hard stack 10240
root soft stack 10240
从1024改成10240(就是给他改大一点)
3.重启
4.编译
————————————By 武汉科技大学 ————————————
——————终于解决了—————— 也秃了 ———————————

@x-yy0
Copy link

x-yy0 commented Aug 16, 2022

linux查看修改线程默认栈空间大小(ulimit -s),默认空间1024=1M,过小,改为10240=10M,可以编译。 查看ulimit -s

  1. 修改配置文件
    sudo vim /etc/security/limits.conf

nvidia hard stack 10240 nvidia soft stack 10240 ubuntu hard stack 10240 ubuntu soft stack 10240 root hard stack 10240 root soft stack 10240 从1024改成10240(就是给他改大一点) 3.重启 4.编译 ————————————By 武汉科技大学 ———————————— ——————终于解决了—————— 也秃了 ———————————

Thank you so much. You saved my life.

@Freedom-Guo
Copy link

Freedom-Guo commented Aug 16, 2022 via email

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

No branches or pull requests

4 participants