transfer intrinsic segfaults on macOS, works on Windows
We have an application that crashes (SEGFAULT) on macOS 10.14/10.15 but works correctly on Windows 10. For macOS we are on ifort (IFORT) 22.214.171.1248 20200623 and on Windows 10 Intel(R) 64, Version 126.96.36.1991 Build 20190815. We were able to use GDB to get to the crashing line but the line looks reasonable.
Thread 2 received signal SIGSEGV, Segmentation fault. 0x00000001003e1f46 in image@image_base::image_build_i8 (im=..., data2=<error reading variable: value requires 8427240 bytes, which is more than max-value-size>) at /Users/mjackson/EMsoft-Dev/EMsoftPublic/Source/EMsoftLib/image.f90:482 482 im%buff = transfer(data2, im%buff)
Just above that line we print out some variables:
im%dims= 4590 1836
For some smaller input sizes this code works but at some point we start getting the segfaults, again, just on macOS. We have tried upping the ulimit thinking maybe a stack size issue but we are a bit baffled by this. GFortran on the same code base will run without any issues.
(gdb) bt #0 0x00000001003e208d in image@image_base::image_build_i8 (im=..., data2=<error reading variable: value requires 6320430 bytes, which is more than max-value-size>) at /Users/mjackson/EMsoft-Dev/EMsoftPublic/Source/EMsoftLib/image.f90:482 #1 0x0000000100009f80 in mastersubroutine (enl=..., progname=..., nmldeffile=..., .tmp.PROGNAME.len_V$ae8=512, .tmp.NMLDEFFILE.len_V$aea=512) at /Users/mjackson/EMsoft-Dev/EMsoftPublic/Source/DictionaryIndexing/EMEBSDDIpreview.f90:334 #2 0x0000000100001ded in emebsddipreview () at /Users/mjackson/EMsoft-Dev/EMsoftPublic/Source/DictionaryIndexing/EMEBSDDIpreview.f90:80 #3 0x0000000102f8f072 in main ()