I'm trying to debug a problem reported by our user[1]. If ELF is linked against libgfortran, and libgfortran did not have debugging symbols stripped, exp-sgcheck fails on parsing it: https://paste.xinu.at/ChI/ Stripped libgfortran only hides the error, although output is still rather useless: https://paste.xinu.at/6qg/ Any tips how to proceed with that to produce something more useful to you? Simple "hello world" built with -g and -lgfortran using gcc 7.2.1+20171224 is enough to reproduce the problem. [1] https://bugs.archlinux.org/task/56294
My tip would be to include the error message in this bug report instead of hiding it away on a third party pastebin...
To be honest I think here are probably two entirely separate issues. One is the DWARF parser not handling the subrange tag: parse DIE(readdwarf3.c:3619): confused by: <2><17a1ec>: Abbrev Number: 10 (DW_TAG_subrange_type) DW_AT_type : <17a20a> DW_AT_upper_bound : <17a188> parse_type_DIE: --2028-- WARNING: Serious error when reading debug info --2028-- When reading debug info from /usr/lib/libgfortran.so.4.0.0: --2028-- confused by the above DIE That goes away in the stripped version simply because it no longer has any DWARF information to be parsed! The second is an instrumentation failure in the exp-sgcheck tool: exp-sgcheck: sg_main.c:2332 (sg_instrument_IRStmt): the 'impossible' happened. It's probably best to open a separate bug for that.
The DWARF problem is highly probably caused by an unimplemented functionality in parse_type_DIE(). For DW_tag_subrange, the following is handled: /* Figure out if we have a definite range or not */ if (have_lower && have_upper && (!have_count)) { boundE.Te.Bound.knownL = True; boundE.Te.Bound.knownU = True; boundE.Te.Bound.boundL = lower; boundE.Te.Bound.boundU = upper; } else if (have_lower && (!have_upper) && (!have_count)) { boundE.Te.Bound.knownL = True; boundE.Te.Bound.knownU = False; boundE.Te.Bound.boundL = lower; boundE.Te.Bound.boundU = 0; } else if ((!have_lower) && have_upper && (!have_count)) { boundE.Te.Bound.knownL = False; boundE.Te.Bound.knownU = True; boundE.Te.Bound.boundL = 0; boundE.Te.Bound.boundU = upper; } else if ((!have_lower) && (!have_upper) && (!have_count)) { boundE.Te.Bound.knownL = False; boundE.Te.Bound.knownU = False; boundE.Te.Bound.boundL = 0; boundE.Te.Bound.boundU = 0; } else { /* FIXME: handle more cases */ goto_bad_DIE; } So probably implementing the missing case would overcome the reported DWARF problem.
2nd thoughts, this looks like a debug info issue
exp-sgcheck has been removed.