https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82055

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed also on trunk (8.0).

With the following change

--- mo_gas_optics_specification.orig.F90        2017-08-31 16:51:24.000000000
+0200
+++ mo_gas_optics_specification.F90     2017-08-31 18:56:56.000000000 +0200
@@ -408,7 +408,7 @@ contains

     ! Number of molecules per cm^2
     real(wp), dimension(size(play,dim=1), size(play,dim=2)), target  ::
col_dry_arr
-    real(wp), dimension(:,:),                                pointer ::
col_dry_wk => NULL()
+    real(wp), dimension(:,:),                                pointer ::
col_dry_wk !=> NULL()
     ! ----------------------------------------------------------
     ! Code starts
     !
@@ -525,13 +525,11 @@ contains
     !

     ! Compute column amounts (number of molecule per cm^2) if user hasn't
provided them
-    if (present(col_dry)) then
-      col_dry_wk => col_dry
-    else
+    if (.not.present(col_dry)) then
       idx_h2o = string_loc_in_array('h2o', terse_gas_names)
       col_dry_arr = get_col_dry(vmr(:,:,idx_h2o), plev, tlay) ! column dry
amounts computation
-      col_dry_wk => col_dry_arr
     end if
+    col_dry_wk => col_dry_arr

     ! Make list of minor gases that are defined in specification and have
available concentrations
     ! Includes key species that are also considered minor at some g-points 

the ICE is

mo_gas_optics_specification.F90:532:0:

     col_dry_wk => col_dry_arr

internal compiler error: Segmentation fault: 11

I have tried to reduce the code, but it is pretty touchy.

My instrumented compiler gives

../../work/gcc/tree.h:3211:28: runtime error: member access within null pointer
of type 'tree_node *[2]'
ASAN:DEADLYSIGNAL
=================================================================
==3334==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc
0x000102a5e033 bp 0x7fff5fbfc190 sp 0x7fff5fbfc140 T0)
==3334==The signal is caused by a READ memory access.
==3334==Hint: address points to the zero page.
    #0 0x102a5e032 in size_binop_loc(unsigned int, tree_code, tree_node*,
tree_node*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x102a5e032)
    #1 0x102872296 in get_inner_reference(tree_node*, long long*, long long*,
tree_node**, machine_mode*, int*, int*, int*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x102872296)
    #2 0x102a66495 in fold_unary_loc(unsigned int, tree_code, tree_node*,
tree_node*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x102a66495)
    #3 0x102a6c03f in fold_build1_loc(unsigned int, tree_code, tree_node*,
tree_node*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x102a6c03f)
    #4 0x102a6d813 in fold_convert_loc(unsigned int, tree_node*, tree_node*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x102a6d813)
    #5 0x100586c86 in gfc_trans_string_copy(stmtblock_t*, tree_node*,
tree_node*, int, tree_node*, tree_node*, int)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x100586c86)
    #6 0x10058836f in gfc_trans_scalar_assign(gfc_se*, gfc_se*, gfc_typespec,
bool, bool, bool)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x10058836f)
    #7 0x100611dfd in gfc_trans_assignment_1(gfc_expr*, gfc_expr*, bool, bool,
bool, bool)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x100611dfd)
    #8 0x1006125bb in gfc_trans_assignment(gfc_expr*, gfc_expr*, bool, bool,
bool, bool)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x1006125bb)
    #9 0x1006127e2 in gfc_trans_assign(gfc_code*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x1006127e2)
    #10 0x10041c403 in trans_code(gfc_code*, tree_node*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x10041c403)
    #11 0x10041d8e2 in gfc_trans_code(gfc_code*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x10041d8e2)
    #12 0x100550a0a in gfc_generate_function_code(gfc_namespace*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x100550a0a)
    #13 0x100429dca in gfc_generate_module_code(gfc_namespace*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x100429dca)
    #14 0x10027ff87 in translate_all_program_units(gfc_namespace*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x10027ff87)
    #15 0x10029aca0 in gfc_parse_file()
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x10029aca0)
    #16 0x1003f14f2 in gfc_be_parse_file()
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x1003f14f2)
    #17 0x1045a4bac in compile_file()
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x1045a4bac)
    #18 0x1045ad7fe in do_compile()
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x1045ad7fe)
    #19 0x10651f30d in toplev::main(int, char**)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x10651f30d)
    #20 0x1065249ce in main
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x1065249ce)
    #21 0x7fffbcb65234 in start (/usr/lib/system/libdyld.dylib+0x5234)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x102a5e032)
in size_binop_loc(unsigned int, tree_code, tree_node*, tree_node*)
==3334==ABORTING
==3334==WARNING: ASan is ignoring requested __asan_handle_no_return: stack top:
0x7fff5fc00000; bottom 0x000154fd4000; size: 0x7ffe0ac2c000 (140729078956032)
False positive error reports may follow
For details see https://github.com/google/sanitizers/issues/189
mo_gas_optics_specification.F90:532:0:

     col_dry_wk => col_dry_arr

internal compiler error: Abort trap: 6

Reply via email to