Fortran Coder

查看: 15319|回复: 7
打印 上一主题 下一主题

[求助] release版本access violaton

[复制链接]

490

帖子

4

主题

0

精华

大宗师

F 币
3298 元
贡献
1948 点

水王勋章元老勋章热心勋章

楼主
发表于 2017-2-10 14:59:21 | 显示全部楼层
估摸着是数组索引或者指针越界

490

帖子

4

主题

0

精华

大宗师

F 币
3298 元
贡献
1948 点

水王勋章元老勋章热心勋章

沙发
发表于 2017-2-10 16:09:42 | 显示全部楼层
ksfengjia 发表于 2017-2-10 15:50
没有使用到其他的库,也不存在混编。
查看了https://software.intel.com/en-us/forums/intel-visual-fortra ...

编译的时候,开启相关检查选项
譬如
https://gcc.gnu.org/onlinedocs/g ... ml#Code-Gen-Options
-fcheck=<keyword> Enable the generation of run-time checks; the argument shall be a comma-delimited list of the following keywords. Prefixing a check with no- disables it if it was activated by a previous specification. ‘all’Enable all run-time test of -fcheck.
‘array-temps’Warns at run time when for passing an actual argument a temporary array had to be generated. The information generated by this warning is sometimes useful in optimization, in order to avoid such temporaries.
Note: The warning is only printed once per location.

‘bounds’Enable generation of run-time checks for array subscripts and against the declared minimum and maximum values. It also checks array indices for assumed and deferred shape arrays against the actual allocated bounds and ensures that all string lengths are equal for character array constructors without an explicit typespec.
Some checks require that -fcheck=bounds is set for the compilation of the main program.

Note: In the future this may also include other forms of checking, e.g., checking substring references.

‘do’Enable generation of run-time checks for invalid modification of loop iteration variables.
‘mem’Enable generation of run-time checks for memory allocation. Note: This option does not affect explicit allocations using the ALLOCATE statement, which will be always checked.
‘pointer’Enable generation of run-time checks for pointers and allocatables.
‘recursion’Enable generation of run-time checks for recursively called subroutines and functions which are not marked as recursive. See also -frecursive. Note: This check does not work for OpenMP programs and is disabled if used together with -frecursive and -fopenmp.
Example: Assuming you have a file foo.f90, the command
            gfortran -fcheck=all,no-array-temps foo.f90


will compile the file with all checks enabled as specified above except warnings for generated array temporaries.

490

帖子

4

主题

0

精华

大宗师

F 币
3298 元
贡献
1948 点

水王勋章元老勋章热心勋章

板凳
发表于 2017-2-10 16:31:40 来自移动端 | 显示全部楼层
ksfengjia 发表于 2017-2-10 16:22
ivf选项check array and string bounds已开启,debug与release编译均不报错,
release版本运行时报错(157) ...

指针 边界 内存分配呢?
ivf相关选项肯定更多
您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )

GMT+8, 2024-5-8 14:59

Powered by Tencent X3.4

© 2013-2024 Tencent

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