Ticket #93 (accepted defect)

Opened 9 years ago

Last modified 5 years ago

mfef90/whirl2f SEGV with INT conversion within exponent expression for power intrinsic

Reported by: Utke Owned by: utke
Priority: 4 Milestone:
Component: Whirl2F Keywords:
Cc:

Description (last modified by utke) (diff)

A source code (see attachement) when translated with mfef90 leads to a SEGV in whirl2f upon an attempt to translate the B file back to fortran.
ir_b2a on the same .B file works ok.

Attachments

GasOil.xb.x2w.w2f.pp_inact_42nd.f Download (20.9 KB) - added by Utke 8 years ago.
input code producing the SEGV
powOp.f Download (256 bytes) - added by utke 5 years ago.
shortened version

Change History

Changed 8 years ago by Utke

input code producing the SEGV

Changed 5 years ago by utke

  • status changed from Assigned to new
  • description modified (diff)

Changed 5 years ago by utke

  • owner changed from Mellor-Crummey to utke
  • status changed from new to accepted

call stack is:
Program received signal SIGSEGV, Segmentation fault.
0x400f04f9 in TCON_ty (tcon=@0x797e5)

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/be/../../common/com/targ_const.h:187

187 TCON_ty (const TCON& tcon) { return tcon.ty; }
(gdb) where
#0 0x400f04f9 in TCON_ty (tcon=@0x797e5)

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/be/../../common/com/targ_const.h:187

#1 0x4052407e in WN2F_const (tokens=0x8081a30, wn=0x40236d90, context={flags = 262144, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f_expr.cxx:1815

#2 0x40521265 in WN2F_translate (tokens=0x8081a30, wn=0x40236d90, context={flags = 262144, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f.cxx:1268

#3 0x40523bbd in WN2F_parm (tokens=0x8081a30, wn=0x40236d74, context={flags = 262144, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f_expr.cxx:2006

#4 0x40521265 in WN2F_translate (tokens=0x8081a30, wn=0x40236d74, context={flags = 262144, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f.cxx:1268

#5 0x4052437d in WN2F_Translate_Arithmetic_Operand (tokens=0x8081a30, opnd=0x40236d74, assumed_ty=2819, call_by_value=1, context=

{flags = 262144, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f_expr.cxx:581

#6 0x40524fff in WN2F_Intr_Infix (tokens=0x8081a30, op_name=0x4054652a "**", opnd0=0x40236cc8, opnd1=0x40236d74, call_by_value=1, context=

{flags = 262144, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f_expr.cxx:995

#7 0x405256a7 in WN2F_intrinsic_op (tokens=0x8081a30, wn=0x40236cac, context={flags = 262144, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f_expr.cxx:1172

#8 0x40521265 in WN2F_translate (tokens=0x8081a30, wn=0x40236cac, context={flags = 262144, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f.cxx:1268

#9 0x4052371c in WN2F_paren (tokens=0x8081a30, wn=0x40236c90, context={flags = 262144, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f_expr.cxx:1422

#10 0x40521265 in WN2F_translate (tokens=0x8081a30, wn=0x40236c90, context={flags = 0, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f.cxx:1268

#11 0x4052437d in WN2F_Translate_Arithmetic_Operand (tokens=0x8081a30, opnd=0x40236c90, assumed_ty=11, call_by_value=1, context={flags = 0, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f_expr.cxx:581

#12 0x40525fa9 in WN2F_Infix_Op (tokens=0x8081a30, opcode=OPC_F8MPY, result_ty=2819, wn0=0x40236c90, wn1=0x40236dac, context={flags = 0, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f_expr.cxx:657

#13 0x405265f1 in WN2F_binaryop (tokens=0x8081a30, wn=0x40236c74, context={flags = 262176, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f_expr.cxx:1085

#14 0x40521265 in WN2F_translate (tokens=0x8081a30, wn=0x40236c74, context={flags = 262176, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f.cxx:1268

#15 0x4052371c in WN2F_paren (tokens=0x8081a30, wn=0x40236c58, context={flags = 262176, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f_expr.cxx:1422

#16 0x40521265 in WN2F_translate (tokens=0x8081a30, wn=0x40236c58, context={flags = 32, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f.cxx:1268

#17 0x4052b985 in WN2F_stid (tokens=0x80746a8, wn=0x40236c3c, context={flags = 32, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f_load_store.cxx:1128

#18 0x40521265 in WN2F_translate (tokens=0x80746a8, wn=0x40236c3c, context={flags = 0, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f.cxx:1268

#19 0x405349c0 in WN2F_block (tokens=0x809f548, wn=0x40236860, context={flags = 0, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f_stmt.cxx:1763

#20 0x40521265 in WN2F_translate (tokens=0x809f548, wn=0x40236860, context={flags = 1, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f.cxx:1268

#21 0x4052300e in WN2F_func_entry (tokens=0x809f548, wn=0x40236498, context={flags = 1, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f.cxx:1101

#22 0x40521265 in WN2F_translate (tokens=0x809f548, wn=0x40236498, context={flags = 0, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f.cxx:1268

#23 0x4053fdd6 in W2F_Outfile_Translate_Pu (pu=0x40236498)

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/w2f_driver.cxx:1411

#24 0x0804d90c in Post_LNO_Processing (current_pu=0x8073660, pu=0x40236498)

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/be/../../be/be/driver.cxx:572

#25 0x0804d9e2 in Backend_Processing (current_pu=0x8073660, pu=0x40236498)

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/be/../../be/be/driver.cxx:681

#26 0x0804e362 in Preorder_Process_PUs (current_pu=0x8073660)

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/be/../../be/be/driver.cxx:849

#27 0x0804ef19 in main (argc=3, argv=0x80617d0)

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/be/../../be/be/driver.cxx:1045

$1 = (const TCON &) @0x797e5: <error reading variable>
(gdb) up
#1 0x4052407e in WN2F_const (tokens=0x8081a30, wn=0x40236d90, context={flags = 262144, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f_expr.cxx:1815

1815 switch (TCON_ty(tcon))
(gdb) p tcon
$2 = (TCON &) @0x797e5: <error reading variable>
(gdb) up
#2 0x40521265 in WN2F_translate (tokens=0x8081a30, wn=0x40236d90, context={flags = 262144, wn = 0x0})

at /m_home/m_utkej/Argonne/Dev/Current/OpenAD/Open64/osprey1.0/targ_ia32_ia64_linux/whirl2f/../../be/whirl2f/../whirl2f/wn2f.cxx:1268

1268 WN2F_STATUS ret = WN2F_Handler[WN_opc_operator(wn)](tokens, wn, context);
(gdb) p wn
$3 = (WN *) 0x40236d90
(gdb) p *wn
$4 = {u1u2 = {uu = {ua = {load_offset = 0, lda_offset = 0, store_offset = 0, idname_offset = 0, num_entries = 0, loadx_addr_ty = 0, cvtl_bits = 0,

label_number = 0, call_flag = 0, if_flag = 0, io_flag = 0, asm_flag = 0, asm_operand_num = 0, eq_logical_flag = 0, li = {trip_est = 0,

loop_depth = 0}, pragma = {pragma_flags = 0, pragma_id = 0}, io_item_ty = 0, region = {region_kind = REGION_KIND_PRAGMA, region_id = 0}}, ub = {

st_idx = 2819, ty = 2819, id = 2819, intrinsic = 2819, iostatement = 2819, ioitem = 2819, prefetch_flag = 2819, loop_flag = 2819,
last_label = 2819, ereg_supp = 2819, label_level = 2819}}, element_size = 12107512807424}, common = {wn_operator = OPR_CONST, rtype = 11,

kid_count = 0, desc = 20, map_id = 47}, u3 = {ty_fields = {dummy1 = 0x0, ty = 0}, kids = {0x0, 0x0}, const_val = 0, asm_fields = {num_inputs = 0,

num_clobbers = 0}, label_flag_fields = {dummy2 = 0x0, label_flag = 0}, block = {first = 0x0, last = 0x0}, pragma = {pragma_arg64 = 0, up1 = {

pragma_arg1 = 0, {pragma_arg2 = 0, asm_pragma = {pragma_asm_opnd_num = 0, pragma_asm_copyout_preg = 0}}}, up2 = {pragma_pad1 = 0,
pragma_distr_type = 0 '\0', pragma_index = 0 '\0', pragma_preg = 0}}}}

also whirl2sexp fails here:

(FUNC_ENTRY V V ((st "m_gasoilkinetics_" 1 28))

(IDNAME V V ((st "NE" 2 1) 0))
(IDNAME V V ((st "F_V" 2 2) 0))
(IDNAME V V ((st "F_D" 2 3) 0))
(IDNAME V V ((st "NI" 2 4) 0))
(IDNAME V V ((st "G_V" 2 5) 0))
(IDNAME V V ((st "G_D" 2 6) 0))
(IDNAME V V ((st "T_V" 2 7) 0))
(IDNAME V V ((st "T_D" 2 8) 0))
(IDNAME V V ((st "X_V" 2 9) 0))
(IDNAME V V ((st "X_D" 2 10) 0))
(IDNAME V V ((st "XDOT_V" 2 11) 0))
(IDNAME V V ((st "XDOT_D" 2 12) 0))
(IDNAME V V ((st "IX" 2 13) 0))
(IDNAME V V ((st "PIX" 2 14) 0))
(IDNAME V V ((st "ISEL" 2 15) 0))
(IDNAME V V ((st "IS" 2 16) 0))
(IDNAME V V ((st "PIS" 2 17) 0))
(IDNAME V V ((st "IPAR" 2 18) 0))
(IDNAME V V ((st "II" 2 19) 0))
(IDNAME V V ((st "PII" 2 20) 0))
(IDNAME V V ((st "RPAR_V" 2 21) 0))
(IDNAME V V ((st "RPAR_D" 2 22) 0))
(IDNAME V V ((st "IR" 2 23) 0))
(IDNAME V V ((st "PIR" 2 24) 0))
(IDNAME V V ((st "IU1" 2 25) 0))
(IDNAME V V ((st "IU2" 2 26) 0))
(BLOCK V V ())
(BLOCK V V ())
(BLOCK V V ()

(PRAGMA V V (120 (st "" 0 0) (oflg 0x0) 0))
(USE V V ((st "inactive_module_" 1 21)))
(STID V I4 ((st "L_P1" 2 29) 0 (ty ".predef_I4" 4 4) 0)

(INTCONST I4 V (1)))

(STID V I4 ((st "L_P2" 2 30) 0 (ty ".predef_I4" 4 4) 0)

(ADD I4 V ()

(LDID I4 I4 ((st "L_P1" 2 29) 0 (ty ".predef_I4" 4 4) 0))
(INTCONST I4 V (1))))

(STID V I4 ((st "L_P3" 2 31) 0 (ty ".predef_I4" 4 4) 0)

(ADD I4 V ()

(LDID I4 I4 ((st "L_P2" 2 30) 0 (ty ".predef_I4" 4 4) 0))
(INTCONST I4 V (1))))

(STID V I4 ((st "L_Y1" 2 32) 0 (ty ".predef_I4" 4 4) 0)

(INTCONST I4 V (1)))

(STID V I4 ((st "L_Y2" 2 33) 0 (ty ".predef_I4" 4 4) 0)

(ADD I4 V ()

(LDID I4 I4 ((st "L_Y1" 2 32) 0 (ty ".predef_I4" 4 4) 0))
(INTCONST I4 V (1))))

(STID V F8 ((st "OPENAD_SYMBOL_2" 2 46) 0 (ty ".predef_F8" 11 8) 0)

(PAREN F8 V ()

(INTRINSIC_OP F8 V (F8EXPEXPR (oflg 0x0))

(PARM F8 V ((oflg 0x2) (ty ".predef_F8" 11 8))

(ILOAD F8 F8 (0 0 (ty ".predef_F8" 11 8) (ty "anon_ptr." 29 8))

(ARRAY U8 V (8)

(LDID U8 U8 ((st "X_V" 2 9) 0 (ty "anon_ptr." 48 8) 0))
(INTCONST I4 V (1))
(LDID I4 I4 ((st "L_Y1" 2 32) 0 (ty ".predef_I4" 4 4) 0)))))

(PARM F8 V ((oflg 0x2) (ty ".predef_F8" 11 8))

(CONST F8 V ((st " 2.000000000000000" 1 30)))))))

(STID V F8 ((st "OPENAD_SYMBOL_0" 2 35) 0 (ty ".predef_F8" 11 8) 0)

(PAREN F8 V ()

(MPY F8 V ()

(PAREN F8 V ()

(INTRINSIC_OP F8 V (F8EXPEXPR (oflg 0x0))

(PARM F8 V ((oflg 0x2) (ty ".predef_F8" 11 8))

(ILOAD F8 F8 (0 0 (ty ".predef_F8" 11 8) (ty "anon_ptr." 29 8))

(ARRAY U8 V (8)

(LDID U8 U8 ((st "X_V" 2 9) 0 (ty "anon_ptr." 48 8) 0))
(INTCONST I4 V (1))
(LDID I4 I4 ((st "L_Y1" 2 32) 0 (ty ".predef_I4" 4 4) 0)))))

(PARM F8 V ((oflg 0x2) (ty ".predef_F8" 11 8))

(CONST F8 V (Signal: Segmentation fault in Reading WHIRL file phase.

which indicates that the problem comes from the line:

OpenAD_Symbol_0 = (2.0D00*(X_v(L_Y1)**(2.0D00-INT(1 _w2fi8))))

Changed 5 years ago by utke

shortened version

Changed 5 years ago by utke

  • summary changed from whirl2f SEGV to mfef90/whirl2f SEGV

The SEGV in whirl2f likely stems from invalid whirl but in the shortened version already mfef90 fails which likely gives a better handle on the root cause.
The shortened version has been added as
Open64/osprey1.0/tests/TestSources/powOpParserTest.f
with  http://www.hpc.svn.rice.edu/revision.php?repname=open64&path=%2Ftags%2Fversion-openad%2F&rev=876

Changed 5 years ago by utke

  • summary changed from mfef90/whirl2f SEGV to mfef90/whirl2f SEGV with INT conversion within exponent expression for power intrinsic
Note: See TracTickets for help on using tickets.