我正在使用Cygwin(在Windows10中使用CYGWIN_NT-10.0 DESKTOP-*** 3.0.7(0.338 / 5/3))和在x64(英特尔)四核笔记本电脑中使用GCC(7.4.0)。当我使用OpenMP编译Fortran程序时,使用gdb分析器会出现以下错误:
Thread 1 "siesta" received signal SIGSEGV, Segmentation fault.
___chkstk_ms () at
/usr/src/debug/gcc-7.4.0-1/libgcc/config/i386/cygwin.S:146
146 orq $0x0, (%rcx) /* probe there */
(gdb) where
#0 ___chkstk_ms () at
/usr/src/debug/gcc-7.4.0-1/libgcc/config/i386/cygwin.S:146
#1 0x000000010071b29f in ldau_specs::ldau_proj_gen (isp=<error reading
variable: Cannot access memory at address 0xffc78f78>)
at /home/gpkmo/siesta-4.1-b4/Src/ldau_specs.f:649
#2 0x00000001004f582e in initatom (ns=3) at
/home/gpkmo/siesta-4.1-b4/Src/initatom.f:151
#3 0x000000010060c684 in m_siesta_init::siesta_init () at
/home/gpkmo/siesta-4.1-b4/Src/siesta_init.F:379
#4 0x00000001010d359d in siesta () at
/home/gpkmo/siesta-4.1-b4/Src/siesta.F:53
#5 0x00000001010d3669 in main (argc=2, argv=0x60004a790) at
/home/gpkmo/siesta-4.1-b4/Src/siesta.F:10
#6 0x000000018004a816 in _cygwin_exit_return () at
/usr/src/debug/cygwin-3.0.7-1/winsup/cygwin/dcrt0.cc:1022
#7 0x0000000180048353 in _cygtls::call2 (this=0xffffce00, func=0x1800497f0
<dll_crt0_1(void*)>, arg=0x0, buf=buf@entry=0xffffcdf0)
at /usr/src/debug/cygwin-3.0.7-1/winsup/cygwin/cygtls.cc:40
#8 0x0000000180048404 in _cygtls::call (func=<optimized out>,
arg=<optimized out>) at
/usr/src/debug/cygwin-3.0.7-1/winsup/cygwin/cygtls.cc:27
#9 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
==============================================================================
谁知道此错误是怎么发生的?
是否可能由于某些版本冲突(与带有libgomp的GCC等)?还是我需要自己重新编译libgomp? (因为该程序的串行版本运行正常)
我已经尝试(1)通过ulimit命令增加堆栈大小(2)gfortran -Wl,-stack,4194304等。但这没有帮助。
源链接在这里: https://drive.google.com/file/d/1uRrWJ2FAfVdJF-zIreUDZCknziZbCFV5/view?usp=sharing