找回密码
 注册
关于网站域名变更的通知
查看: 488|回复: 1
打印 上一主题 下一主题

Linux下fortran程序Segmentation fault错误

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2021-1-26 18:21 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x
在Linux下运行某个程序,总是遇到Segmentation fault错误。同样程序在自己的PC windows下运行正常,查看Linux机器,内存足够。Intel 官网上给的解决方案是:http://software.intel.com/en-us/ ... segmentation-fault/6 f( i# M, o: j% j& A
0 l+ [- j! b; D* z. Y
On Linux*, the stack space can be increased using:* V2 Y6 \2 Y- e2 `3 s1 l. {
ulimit -s unlimited     for bash shell, or
9 ]5 M( ^5 V  M& o6 z) Jlimit stacksize unlimited     for csh shell.6 {. |' K1 Z! X# m( z/ W

" C6 B; V' C0 W0 d% k4 z+ A& z' D/ [; H  u. u# ~
原因是初始分配的stack空间不足,将其设置为 unlimited即可。
# w) `* c4 L2 ^" P
9 E8 e( w6 ~7 O' M6 R8 d
+ B* O- G2 r$ T/ y; mLinux: The size of "unlimited" varies by Linux configuration, so you may need to specify a larger, specific number to ulimit (for example, 999999999). On Linux also note that many 32bit Linux distributions ship with a pthread static library (libpthread.a) that at runtime will fix the stacksize to 2093056 bytes regardless of the ulimit setting. To avoid this problem do not link with the -static option or the -fast option. Instead of -fast, use options: -ipo -O3 -no-prec-div -xP . This only affects the 32bit Linux distributions and does not apply to the 64bit Linux distributions.: y) P; F' V4 \+ w/ J" J

0 j' s' a' ]+ h4 T5 d& l6 d
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

推荐内容上一条 /1 下一条

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-11-25 00:49 , Processed in 0.140625 second(s), 23 queries , Gzip On.

深圳市墨知创新科技有限公司

地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

快速回复 返回顶部 返回列表