[ncl-install] Segmentation fault when compiling NCL from source on Amazon Linux 2 (ARM64)

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Fri Sep 3 18:48:45 MDT 2021


Oops, sent to wrong list.  Now I CC to ncl-install.


On Fri, Sep 3, 2021 at 4:39 PM Dave Allured - NOAA Affiliate <
dave.allured at noaa.gov> wrote:

> I think fontc is a standalone program that is used only during the NCL
> build process.  You may be able to sidestep the program issue completely,
> by simply copying over the compiled fontcap files from a different build.
> Look at one of the X86 binary distributions, or a working install on any
> X86 system.  I suspect that the only compatibility issue is endianness of
> 16- and 32-bit integers.  ARM64 and X86 should both be little endian; not
> sure because I lack ARM experience.
>
>
> On Wed, Sep 1, 2021 at 11:37 AM Michael Graf via ncl-install <
> ncl-install at mailman.ucar.edu> wrote:
>
>> Dear all,
>>
>> Thanks for adding me to the NCL mailing list.
>>
>> I am trying to compile the latest NCL Version 6.6.2 from scratch on Amazon
>> Linux 2 (ARM64 architecture). Everything works fine except that a
>> segmentation fault occurs when the fontcaps are compiled respectively when
>> the fontc binary is processing fontcaps (see output below). No other error
>> occurs. The ncl binary is compiled and it can be started without problems,
>> but when I run a plotting script a segmentation fault occurs that is
>> probably related to the compilation error in fontcap.
>>
>> I also compiled a minimal version with as few dependencies as possible (no
>> GDAL, HDF5, NETCDF-4 and so on) to rule out that they cause the problem
>> without any effect. I have also randomly tried different compiler options
>> for the compilation in the folder fontcap, but the error always remains
>> the
>> same. I suspect that the compiler is causing the problem, but there is no
>> alternative on Amazon Linux 2 so far. I'm using gfortran (version 7.3.1)
>> and
>> gcc (version 7.3.1), but here only Fortran77 code seems to be compiled.
>>
>> It would be great if somebody has a hint how to overcome this problem.
>> Maybe
>> there is another option, so that I don't have to build it from scratch.
>> The
>> installation with conda does not work on ARM64.
>>
>> Best, Michael
>>
>> ************************************************************************
>> Making ./common/src/fontcap
>> make[4]: Entering directory
>> `/home/ec2-user/wrf/NCL/ncl_ncarg-6.6.2/common/src/fontcap'
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O   -c
>> cfaamn.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> cfrdln.o cfrdln.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> cfwrit.o cfwrit.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> ffgttk.o ffgttk.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> ffinfo.o ffinfo.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> ffphol.o ffphol.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> ffppkt.o ffppkt.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> ffprcf.o ffprcf.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> ffprsa.o ffprsa.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> fftbkd.o fftbkd.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> fftkin.o fftkin.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> sffndc.o sffndc.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> sfgtin.o sfgtin.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> sfgtkw.o sfgtkw.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> sfprcf.o sfprcf.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> sfskbk.o sfskbk.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -c
>> -o
>> sftbkd.o sftbkd.f
>> gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp  -O    -o
>> fontc cfaamn.o  cfrdln.o  cfwrit.o  ffgttk.o  ffinfo.o  ffphol.o  ffppkt.o
>> ffprcf.o ffprsa.o  fftb
>> kd.o  fftkin.o  sffndc.o  sfgtin.o  sfgtkw.o  sfprcf.o  sfskbk.o sftbkd.o
>> -L../../.././common/src/libncarg_c -lncarg_c -L/usr/local/ncarg_gdal/lib
>> -L/usr/local/lib
>> Processing fontcap font1
>>
>> Program received signal SIGSEGV: Segmentation fault - invalid memory
>> reference.
>>
>> Backtrace for this error:
>> #0  0x40001dcb99a3
>> #1  0x40001dcb888f
>> #2  0x40001dc90667
>> #3  0x403bdc
>> #4  0x403c63
>> #5  0x4032af
>> #6  0x400efb
>> #7  0x401213
>> #8  0x40001df5ace3
>> #9  0x400d07
>> make[4]: *** [font1] Segmentation fault
>> make[4]: Leaving directory
>> `/home/ec2-user/wrf/NCL/ncl_ncarg-6.6.2/common/src/fontcap'
>>
>> ************************************************************************
>> gfortran -g -fbacktrace -Wall -fcheck=all      -o fontc cfaamn.o  cfrdln.o
>> cfwrit.o  ffgttk.o  ffinfo.o  ffphol.o  ffppkt.o  ffprcf.o ffprsa.o
>> fftbkd.o  fftkin.o  sffndc.o
>>   sfgtin.o  sfgtkw.o  sfprcf.o  sfskbk.o sftbkd.o
>> -L../../.././common/src/libncarg_c -lncarg_c -L/usr/local/ncarg/lib
>> -L/usr/local/lib
>> Processing fontcap font1
>>
>> Program received signal SIGSEGV: Segmentation fault - invalid memory
>> reference.
>>
>> Backtrace for this error:
>> #0  0x40001a29595b in ???
>> #1  0x40001a29488f in ???
>> #2  0x40001a26c667 in ???
>> #3  0x40723c in ???
>> #4  0x4072e7 in ???
>> #5  0x405c97 in sfgtwk_
>> at /home/ec2-user/wrf/NCL/ncl_ncarg-6.6.2/common/src/fontcap/sfgtkw.f:95
>> #6  0x4061cb in sfprcf_
>> at /home/ec2-user/wrf/NCL/ncl_ncarg-6.6.2/common/src/fontcap/sfprcf.f:108
>> #7  0x40119b in cfaamn
>> at /home/ec2-user/wrf/NCL/ncl_ncarg-6.6.2/common/src/fontcap/cfaamn.f:304
>> #8  0x401633 in main
>> at /home/ec2-user/wrf/NCL/ncl_ncarg-6.6.2/common/src/fontcap/cfaamn.f:358
>> make: *** [font1] Segmentation fault
>>
>> ************************************************************************
>> gfortran -g -fsanitize=address,undefined      -o fontc cfaamn.o  cfrdln.o
>> cfwrit.o  ffgttk.o  ffinfo.o  ffphol.o  ffppkt.o  ffprcf.o ffprsa.o
>> fftbkd.o  fftkin.o  sffndc.o
>>  sfgtin.o  sfgtkw.o  sfprcf.o  sfskbk.o sftbkd.o
>> -L../../.././common/src/libncarg_c -lncarg_c -L/usr/local/ncarg/lib
>> -L/usr/local/lib
>> Processing fontcap font1
>> ASAN:DEADLYSIGNAL
>> =================================================================
>> ==2477==ERROR: AddressSanitizer: SEGV on unknown address 0x100005104df40
>> (pc
>> 0x00000040ffd0 bp 0xffffd104daf0 sp 0xffffd104daf0 T0)
>> ==2477==The signal is caused by a READ memory access.
>>     #0 0x40ffcf in gbyte_
>> (/home/ec2-user/wrf/NCL/ncl_ncarg-6.6.2/common/src/fontcap/fontc+0x40ffcf)
>>     #1 0x410057 in gbytes_
>> (/home/ec2-user/wrf/NCL/ncl_ncarg-6.6.2/common/src/fontcap/fontc+0x410057)
>>     #2 0x40deab in sfprcf_
>> /home/ec2-user/wrf/NCL/ncl_ncarg-6.6.2/common/src/fontcap/sfprcf.f:117
>>     #3 0x40213f in cfaamn
>> /home/ec2-user/wrf/NCL/ncl_ncarg-6.6.2/common/src/fontcap/cfaamn.f:304
>>     #4 0x402d7b in main
>> /home/ec2-user/wrf/NCL/ncl_ncarg-6.6.2/common/src/fontcap/cfaamn.f:358
>>     #5 0x40002cbc7ce3 in __libc_start_main (/lib64/libc.so.6+0x1fce3)
>>     #6 0x4018a7
>> (/home/ec2-user/wrf/NCL/ncl_ncarg-6.6.2/common/src/fontcap/fontc+0x4018a7)
>>
>> AddressSanitizer can not provide additional info.
>> SUMMARY: AddressSanitizer: SEGV
>> (/home/ec2-user/wrf/NCL/ncl_ncarg-6.6.2/common/src/fontcap/fontc+0x40ffcf)
>> in gbyte_
>> ==2477==ABORTING
>> make: *** [font1] Error 1
>>
>> _______________________________________________
>> ncl-install mailing list
>> List instructions, subscriber options, unsubscribe:
>> https://mailman.ucar.edu/mailman/listinfo/ncl-install
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-install/attachments/20210903/e52feaf4/attachment.html>


More information about the ncl-install mailing list