Opened 2 years ago

Last modified 17 months ago

#64361 assigned defect

ncarg @6.6.2_7: setfileoption segmentation fault

Reported by: cmstuber (Chris Stuberg) Owned by: tenomoto (Takeshi Enomoto)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc: Dave-Allured (Dave Allured)
Port: ncarg

Description

setfileoption gives segmentation fault with default ncarg build. Building ncarg and hdf5 with variant +gcc10 resolves segmentation fault.

I'm getting similar segmentation fault errors as reported in https://trac.macports.org/ticket/53031.

Here's a list of selected deps that are installed:

hdf4 @4.2.15_1 (active)
hdf5 @1.12.1_0+cxx+hl (active)
hdfeos @2.20_0 (active)
hdfeos5 @1.16_6 (active)
netcdf @4.8.1_0+cdf5+dap+netcdf4 (active)
netcdf-cxx @4.2_17 (active)
netcdf-fortran @4.5.3_0+gcc11 (active)
gcc10 @10.3.0_0 (active)
gcc11 @11.2.0_2 (active)

ncarg is being built with defaults

root@mac66 Build # port install ncarg            
--->  Computing dependencies for ncarg
--->  Fetching archive for ncarg
--->  Attempting to fetch ncarg-6.6.2_7+accelerate+gfortran.darwin_19.x86_64.tbz2 from https://packages.macports.org/ncarg
--->  Attempting to fetch ncarg-6.6.2_7+accelerate+gfortran.darwin_19.x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/ncarg
--->  Attempting to fetch ncarg-6.6.2_7+accelerate+gfortran.darwin_19.x86_64.tbz2 from https://mse.uk.packages.macports.org/ncarg
--->  Fetching distfiles for ncarg
--->  Verifying checksums for ncarg
--->  Extracting ncarg
--->  Applying patches to ncarg
--->  Configuring ncarg
--->  Building ncarg
--->  Staging ncarg into destroot                        
--->  Installing ncarg @6.6.2_7+accelerate+gfortran      
--->  Activating ncarg @6.6.2_7+accelerate+gfortran
--->  Cleaning ncarg
--->  Scanning binaries for linking errors
--->  No broken files found.                             
--->  No broken ports found.

Build is successful. However when using setfileoption in ncl I get a seg fault.

root@mac66 Build # echo $NCARG_ROOT
/opt/local
root@mac66 Build # ncl
 Copyright (C) 1995-2019 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.6.2
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.
ncl 0> setfileoption("nc","Format","NetCDF4")
Segmentation fault: 11
root@mac66 Build #

Using the test3 script posted in ticket #53031, it errors with the seg fault as well

root@mac66 Desktop # ncl test3.ncl
 Copyright (C) 1995-2019 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.6.2
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.
zsh: segmentation fault  ncl test3.ncl
root@mac66 Desktop # 

Rebuilding ncarg against gcc10 seems to have resolved the issue for me, although it requires rebuilding hdf5 against gcc10 as well.

root@mac66 Desktop # port uninstall ncarg
--->  Deactivating ncarg @6.6.2_7+accelerate+gfortran
--->  Cleaning ncarg
--->  Uninstalling ncarg @6.6.2_7+accelerate+gfortran
--->  Cleaning ncarg
root@mac66 Desktop # port -f clean ncarg
--->  Cleaning ncarg
root@mac66 Desktop # port install ncarg +accelerate+gcc10
--->  Computing dependencies for ncarg
--->  Fetching archive for ncarg
--->  Attempting to fetch ncarg-6.6.2_7+accelerate+gcc10.darwin_19.x86_64.tbz2 from https://packages.macports.org/ncarg
--->  Attempting to fetch ncarg-6.6.2_7+accelerate+gcc10.darwin_19.x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/ncarg
--->  Attempting to fetch ncarg-6.6.2_7+accelerate+gcc10.darwin_19.x86_64.tbz2 from https://mse.uk.packages.macports.org/ncarg
--->  Configuring ncarg
Error: Install hdf5 +gcc10
Error: Failed to configure ncarg: hdf5 +gcc10 not installed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_science_ncarg/ncarg/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port ncarg failed
root@mac66 Desktop # port uninstall hdf5
Note: It is not recommended to uninstall/deactivate a port that has dependents as it breaks the dependents.
The following ports will break:
 netcdf @4.8.1_0
 hdfeos5 @1.16_6
 wgrib2 @3.0.2_0
 nco @5.0.3_2
 grads @2.2.1_11
 cdo @2.0.0_0
Continue? [y/N]: y
Warning: Uninstall forced.  Proceeding despite dependencies.
--->  Deactivating hdf5 @1.12.1_0+cxx+hl
--->  Cleaning hdf5
--->  Uninstalling hdf5 @1.12.1_0+cxx+hl
--->  Cleaning hdf5
root@mac66 Desktop # port -f clean hdf5
--->  Cleaning hdf5
root@mac66 Desktop # port install hdf5 +cxx+hl+gcc10
--->  Computing dependencies for hdf5
--->  Fetching archive for hdf5
--->  Attempting to fetch hdf5-1.12.1_0+cxx+gcc10+hl.darwin_19.x86_64.tbz2 from https://packages.macports.org/hdf5
--->  Attempting to fetch hdf5-1.12.1_0+cxx+gcc10+hl.darwin_19.x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/hdf5
--->  Attempting to fetch hdf5-1.12.1_0+cxx+gcc10+hl.darwin_19.x86_64.tbz2 from https://mse.uk.packages.macports.org/hdf5
--->  Fetching distfiles for hdf5
--->  Verifying checksums for hdf5
--->  Extracting hdf5
--->  Applying patches to hdf5
--->  Configuring hdf5
--->  Building hdf5                                      
--->  Staging hdf5 into destroot                         
--->  Installing hdf5 @1.12.1_0+cxx+gcc10+hl             
--->  Activating hdf5 @1.12.1_0+cxx+gcc10+hl
--->  Cleaning hdf5
--->  Scanning binaries for linking errors
--->  No broken files found.                             
--->  No broken ports found.
root@mac66 Desktop # port install ncarg +accelerate+gcc10
--->  Computing dependencies for ncarg
--->  Fetching archive for ncarg
--->  Attempting to fetch ncarg-6.6.2_7+accelerate+gcc10.darwin_19.x86_64.tbz2 from https://packages.macports.org/ncarg
--->  Attempting to fetch ncarg-6.6.2_7+accelerate+gcc10.darwin_19.x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/ncarg
--->  Attempting to fetch ncarg-6.6.2_7+accelerate+gcc10.darwin_19.x86_64.tbz2 from https://mse.uk.packages.macports.org/ncarg
--->  Configuring ncarg
--->  Building ncarg
--->  Staging ncarg into destroot                        
--->  Installing ncarg @6.6.2_7+accelerate+gcc10         
--->  Activating ncarg @6.6.2_7+accelerate+gcc10
--->  Cleaning ncarg
--->  Scanning binaries for linking errors
--->  No broken files found.                             
--->  No broken ports found.

Running the test3.ncl script finishes successfully now.

root@mac66 Desktop # ncl test3.ncl 
 Copyright (C) 1995-2019 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.6.2
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.
(0)	99
root@mac66 Desktop # 

Change History (4)

comment:1 Changed 2 years ago by jmroot (Joshua Root)

Cc: takeshi@… removed
Owner: set to tenomoto
Status: newassigned

comment:2 Changed 2 years ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:3 Changed 17 months ago by tenomoto (Takeshi Enomoto)

The following combination seems to circumvent segmentation faults.

hdf5 @1.12.2_1+gcc12+hl (active)
ncarg @6.6.2_15+accelerate+gcc12 (active)

hdf5 1.12.x is a major update breaking API. However, -DH5_USE_110_API API Compatibility Macros did not help.

comment:4 Changed 17 months ago by Dave-Allured (Dave Allured)

This might have little or nothing to do with HDF5. The basic setfileoption function seems to be broken. This is with my own ncarg built from source, including -DH5_USE_110_API (hence the fake rev 16 on the portfile).

  hdf5 @1.12.2_1+cxx+hl (active)
  ncarg @6.6.2_16+accelerate+gfortran (active)
> ncl -Q
ncl 0> setfileoption ("bin", "ReadByteOrder", "LittleEndian")
Segmentation fault

I got the same result with the original rev 15 portfile, also with -DH5_USE_18_API.

Changing the first arg to "bin" should result in no calls at all to HDF5, unless someone is doing something too clever under the hood.

Note: See TracTickets for help on using tickets.