www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Cryptic bug for DMD v2.087.x

reply Peter Jacobs <peterj mech.uq.edu.au> writes:
We have a flow simulation code 
(http://cfcfd.mechmining.uq.edu.au/eilmer/) that fails to build 
optimized with DMD v2.087.0 or v2.087.1.  The cryptic message at 
the end of the attempt to build is:
   tym = x14
   makefile:414: recipe for target 'e4shared' failed
   make: *** [e4shared] Illegal instruction (core dumped)
and the compiler flags are:
   dmd -w -O -release -inline -boundscheck=off -dip1008 ...

The build is successful if we omit the -O flag.

In contrast, we have successful optimized builds for DMD 2.086.1 
and LDC 1.17.0-beta1.

I can provide more details but I was thinking that the "tym = 
x14" might already mean something to someone familiar with the 
insides of DMD.

Best regards,
Peter J.
Aug 11 2019
next sibling parent reply Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Monday, 12 August 2019 at 01:45:24 UTC, Peter Jacobs wrote:
 We have a flow simulation code 
 (http://cfcfd.mechmining.uq.edu.au/eilmer/) that fails to build 
 optimized with DMD v2.087.0 or v2.087.1.  The cryptic message 
 at the end of the attempt to build is:
   tym = x14
   makefile:414: recipe for target 'e4shared' failed
   make: *** [e4shared] Illegal instruction (core dumped)
 and the compiler flags are:
   dmd -w -O -release -inline -boundscheck=off -dip1008 ...

 The build is successful if we omit the -O flag.

 In contrast, we have successful optimized builds for DMD 
 2.086.1 and LDC 1.17.0-beta1.

 I can provide more details but I was thinking that the "tym = 
 x14" might already mean something to someone familiar with the 
 insides of DMD.

 Best regards,
 Peter J.
That looks like https://github.com/dlang/dmd/blob/eda232a9f72b482c92cefb27a4321afc0aedbb5c/src/dmd/backe d/cgxmm.d#L816-L817 or https://github.com/dlang/dmd/blob/eda232a9f72b482c92cefb27a4321afc0aedbb5c/src/dmd/backe d/cgxmm.d#L716-L717 (or maybe https://github.com/dlang/dmd/blob/8623bbbebe35b9a320ba20e521a6c0ee51a780ac/src/dmd/b ckend/evalu8.d#L905 ) Can you run it in a debugger and provide a stack trace to confirm? tym = 0x14 corresponds to real (== 80 bit fp), which is best avoided if possible as it is very slow. Also, silly question, why would you use DMD, with optimisations, for cfd? surely your productivity is runtime bottlenecked?
Aug 11 2019
next sibling parent reply Peter Jacobs <peterj mech.uq.edu.au> writes:
On Monday, 12 August 2019 at 04:01:28 UTC, Nicholas Wilson wrote:
 On Monday, 12 August 2019 at 01:45:24 UTC, Peter Jacobs wrote:
 We have a flow simulation code 
 (http://cfcfd.mechmining.uq.edu.au/eilmer/) that fails to 
 build optimized with DMD v2.087.0 or v2.087.1.  The cryptic 
 message at the end of the attempt to build is:
   tym = x14
   makefile:414: recipe for target 'e4shared' failed
   make: *** [e4shared] Illegal instruction (core dumped)
 and the compiler flags are:
   dmd -w -O -release -inline -boundscheck=off -dip1008 ...

 The build is successful if we omit the -O flag.

 In contrast, we have successful optimized builds for DMD 
 2.086.1 and LDC 1.17.0-beta1.

 I can provide more details but I was thinking that the "tym = 
 x14" might already mean something to someone familiar with the 
 insides of DMD.

 Best regards,
 Peter J.
That looks like https://github.com/dlang/dmd/blob/eda232a9f72b482c92cefb27a4321afc0aedbb5c/src/dmd/backe d/cgxmm.d#L816-L817 or https://github.com/dlang/dmd/blob/eda232a9f72b482c92cefb27a4321afc0aedbb5c/src/dmd/backe d/cgxmm.d#L716-L717 (or maybe https://github.com/dlang/dmd/blob/8623bbbebe35b9a320ba20e521a6c0ee51a780ac/src/dmd/b ckend/evalu8.d#L905 ) Can you run it in a debugger and provide a stack trace to confirm? tym = 0x14 corresponds to real (== 80 bit fp), which is best avoided if possible as it is very slow. Also, silly question, why would you use DMD, with optimisations, for cfd? surely your productivity is runtime bottlenecked?
Nicholas, thank you for looking. Below is the transcript of compiling from within gdb. peterj helmholtz ~/dgd/src/eilmer $ make FLAVOUR=fast sed -e 's/PUT_REVISION_STRING_HERE/23bdf96ea6d1+ 2522+ default tip/' main.d > \ main_with_rev_string.d gdb --args dmd -w -O -release -inline -boundscheck=off -version=flavour_fast -dip1008 -I.. -I../nm -I../util -I../geom -I../grid_utils -I../extern/gzip -version=multi_species_gas -version=multi_T_gas -version=MHD -version=komega -ofe4shared \ -version=tecplot_unavailable \ main_with_rev_string.d \ simcore.d fileutil.d json_helper.d fvcore.d fvcell.d fvvertex.d fvinterface.d fluxcalc.d onedinterp.d flowgradients.d lsqinterp.d limiters.d conservedquantities.d flowstate.d globalconfig.d globaldata.d fluidblock.d sfluidblock.d ufluidblock.d gas_solid_interface.d flowsolution.d grid_motion.d shock_fitting_moving_grid.d history.d loads.d special_block_init.d mass_diffusion.d tecplot_writer.d luaglobalconfig.d lua_helper.d luaflowsolution.d luaflowstate.d user_defined_source_terms.d postprocess.d \ bc/package.d bc/boundary_condition.d bc/ghost_cell_effect/package.d bc/ghost_cell_effect/ghost_cell.d bc/ghost_cell_effect/internal_copy_then_reflect.d bc/ghost_cell_effect/flow_state_copy.d bc/ghost_cell_effect/flow_state_copy_from_profile.d bc/ghost_cell_effect/extrapolate_copy.d bc/ghost_cell_effect/fixed_p.d bc/ghost_cell_effect/fixed_pt.d bc/ghost_cell_effect/from_stagnation.d bc/ghost_cell_effect/full_face_copy.d bc/ghost_cell_effect/mapped_cell_copy.d bc/user_defined_effects.d bc/boundary_flux_effect.d bc/boundary_cell_effect.d bc/boundary_interface_effect.d solid/solidbc.d solid/solidblock.d solid/solid_boundary_flux_effect.d solid/solid_boundary_interface_effect.d solid/solid_loose_coupling_update.d solid/ssolidblock.d solid/solidfvcell.d solid/solidfvinterface.d solid/solidfvvertex.d solid/solidprops.d solid/solidsolution.d solid/solid_udf_source_terms.d solid/luasolidprops.d ../geom/package.d ../geom/geometry_exception.d ../geom/elements/package.d ../geom/elements/nomenclature.d ../geom/elements/vector3.d ../geom/elements/properties.d ../geom/elements/projection.d ../geom/gpath/package.d ../geom/gpath/path.d ../geom/gpath/line.d ../geom/gpath/arc.d ../geom/gpath/helix.d ../geom/gpath/bezier.d ../geom/gpath/polynomial.d ../geom/gpath/polyline.d ../geom/gpath/svgpath.d ../geom/gpath/modifiedpath.d ../geom/gpath/gpath_utils.d ../geom/surface/package.d ../geom/surface/parametricsurface.d ../geom/surface/coonspatch.d ../geom/surface/aopatch.d ../geom/surface/channelpatch.d ../geom/surface/sweptpathpatch.d ../geom/surface/meshpatch.d ../geom/surface/subrangedsurface.d ../geom/surface/bezierpatch.d ../geom/surface/beziertrianglepatch.d ../geom/volume/package.d ../geom/volume/parametricvolume.d ../geom/volume/tfivolume.d ../geom/volume/slabvolume.d ../geom/volume/wedgevolume.d ../geom/volume/sweptsurfacevolume.d ../geom/volume/twosurfacevolume.d ../geom/volume/meshvolume.d ../geom/volume/subrangedvolume.d ../geom/grid/package.d ../geom/grid/grid.d ../geom/grid/sgrid.d ../geom/grid/usgrid.d ../geom/grid/paver.d ../geom/grid/paver2d.d ../geom/misc/package.d ../geom/misc/univariatefunctions.d ../geom/misc/svg.d ../geom/misc/sketch.d ../geom/luawrap/package.d ../geom/luawrap/luaunifunction.d ../geom/luawrap/luageom.d ../geom/luawrap/luagpath.d ../geom/luawrap/luagpath_utils.d ../geom/luawrap/luasurface.d ../geom/luawrap/luavolume.d ../geom/luawrap/luagrid.d ../geom/luawrap/luasgrid.d ../geom/luawrap/luausgrid.d ../geom/luawrap/luasketch.d ../grid_utils/grid_deform.d \ ../gas/package.d ../gas/co2gas.d ../gas/co2gas_sw.d ../gas/gas_model.d ../gas/gas_state.d ../gas/init_gas_model.d ../gas/ideal_gas.d ../gas/ideal_helium.d ../gas/cubic_gas.d ../gas/cea_gas.d ../gas/physical_constants.d ../gas/sf6virial.d ../gas/therm_perf_gas.d ../gas/very_viscous_air.d ../gas/uniform_lut.d ../gas/uniform_lut_plus_ideal.d ../gas/adaptive_lut_CEA.d ../gas/ideal_air_proxy.d ../gas/powers_aslam_gas.d ../gas/two_temperature_reacting_argon.d ../gas/ideal_dissociating_gas.d ../gas/two_temperature_air.d ../gas/two_temperature_nitrogen.d ../gas/vib_specific_nitrogen.d ../gas/fuel_air_mix.d ../gas/equilibrium_gas.d ../gas/ideal_air_fortran.o ../gas/steam.d ../gas/pseudo_species_gas.d ../gas/pseudo_species.d ../gas/electronically_specific_gas.d ../gas/electronic_species.d ../gas/two_temperature_gasgiant.d ../gas/thermo/cea_thermo_curves.d ../gas/thermo/evt_eos.d ../gas/thermo/perf_gas_mix_eos.d ../gas/thermo/pvt_eos.d ../gas/thermo/therm_perf_gas_mix_eos.d ../gas/diffusion/cea_therm_cond.d ../gas/diffusion/cea_viscosity.d ../gas/diffusion/chemkin_therm_cond.d ../gas/diffusion/chemkin_viscosity.d ../gas/diffusion/sutherland_therm_cond.d ../gas/diffusion/sutherland_viscosity.d ../gas/diffusion/therm_cond.d ../gas/diffusion/viscosity.d ../gas/diffusion/wilke_mixing_therm_cond.d ../gas/diffusion/wilke_mixing_viscosity.d ../gas/diffusion/gasgiant_transport_properties.d ../extern/gzip/gzip.d \ ../util/lua.d ../util/lua_service.d ../util/msg_service.d ../nm/package.d ../nm/number.d ../nm/complex.d ../nm/bbla.d ../nm/bdfLU.d ../nm/bracketing.d ../nm/brent.d ../nm/gaussquad.d ../nm/linesearch.d ../nm/nelmin.d ../nm/newtoncotes.d ../nm/ridder.d ../nm/rungekutta.d ../nm/rsla.d ../nm/smla.d ../nm/tree_patch.d ../nm/univariate_lut.d \ ../kinetics/package.d ../kinetics/thermochemical_reactor.d ../kinetics/init_thermochemical_reactor.d ../kinetics/chemistry_update.d ../kinetics/electronic_update.d ../kinetics/electronically_specific_kinetics.d ../kinetics/ideal_dissociating_gas_kinetics.d ../kinetics/fuel_air_mix_kinetics.d ../kinetics/powers_aslam_kinetics.d ../kinetics/rate_constant.d ../kinetics/reaction.d ../kinetics/reaction_mechanism.d ../kinetics/two_temperature_air_kinetics.d ../kinetics/two_temperature_argon_kinetics.d ../kinetics/two_temperature_nitrogen_kinetics.d ../kinetics/vib_specific_nitrogen_kinetics.d ../kinetics/two_temperature_gasgiant_kinetics.d ../gas/luagas_model.d ../kinetics/luathermochemical_reactor.d ../kinetics/luachemistry_update.d ../kinetics/luaelectronically_specific_kinetics.d ../kinetics/luareaction_mechanism.d ../kinetics/luatwo_temperature_air_kinetics.d ../kinetics/luavib_specific_nitrogen_kinetics.d \ ../gasdyn/gasflowexception.d ../gasdyn/idealgasflow.d ../gasdyn/luaidealgasflow.d ../gasdyn/gasflow.d ../gasdyn/luagasflow.d ../nm/luabbla.d \ -L-L../../extern/lua-5.1.4/lib -L-llua -L-ldl GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from dmd...(no debugging symbols found)...done. (gdb) run Starting program: /usr/bin/dmd -w -O -release -inline -boundscheck=off -version=flavour_fast -dip1008 -I.. -I../nm -I../util -I../geom -I../grid_utils -I../extern/gzip -version=multi_species_gas -version=multi_T_gas -version=MHD -version=komega -ofe4shared -version=tecplot_unavailable main_with_rev_string.d simcore.d fileutil.d json_helper.d fvcore.d fvcell.d fvvertex.d fvinterface.d fluxcalc.d onedinterp.d flowgradients.d lsqinterp.d limiters.d conservedquantities.d flowstate.d globalconfig.d globaldata.d fluidblock.d sfluidblock.d ufluidblock.d gas_solid_interface.d flowsolution.d grid_motion.d shock_fitting_moving_grid.d history.d loads.d special_block_init.d mass_diffusion.d tecplot_writer.d luaglobalconfig.d lua_helper.d luaflowsolution.d luaflowstate.d user_defined_source_terms.d postprocess.d bc/package.d bc/boundary_condition.d bc/ghost_cell_effect/package.d bc/ghost_cell_effect/ghost_cell.d bc/ghost_cell_effect/internal_copy_then_reflect.d bc/ghost_cell_effect/flow_state_copy.d bc/ghost_cell_effect/flow_state_copy_from_profile.d bc/ghost_cell_effect/extrapolate_copy.d bc/ghost_cell_effect/fixed_p.d bc/ghost_cell_effect/fixed_pt.d bc/ghost_cell_effect/from_stagnation.d bc/ghost_cell_effect/full_face_copy.d bc/ghost_cell_effect/mapped_cell_copy.d bc/user_defined_effects.d bc/boundary_flux_effect.d bc/boundary_cell_effect.d bc/boundary_interface_effect.d solid/solidbc.d solid/solidblock.d solid/solid_boundary_flux_effect.d solid/solid_boundary_interface_effect.d solid/solid_loose_coupling_update.d solid/ssolidblock.d solid/solidfvcell.d solid/solidfvinterface.d solid/solidfvvertex.d solid/solidprops.d solid/solidsolution.d solid/solid_udf_source_terms.d solid/luasolidprops.d ../geom/package.d ../geom/geometry_exception.d ../geom/elements/package.d ../geom/elements/nomenclature.d ../geom/elements/vector3.d ../geom/elements/properties.d ../geom/elements/projection.d ../geom/gpath/package.d ../geom/gpath/path.d ../geom/gpath/line.d ../geom/gpath/arc.d ../geom/gpath/helix.d ../geom/gpath/bezier.d ../geom/gpath/polynomial.d ../geom/gpath/polyline.d ../geom/gpath/svgpath.d ../geom/gpath/modifiedpath.d ../geom/gpath/gpath_utils.d ../geom/surface/package.d ../geom/surface/parametricsurface.d ../geom/surface/coonspatch.d ../geom/surface/aopatch.d ../geom/surface/channelpatch.d ../geom/surface/sweptpathpatch.d ../geom/surface/meshpatch.d ../geom/surface/subrangedsurface.d ../geom/surface/bezierpatch.d ../geom/surface/beziertrianglepatch.d ../geom/volume/package.d ../geom/volume/parametricvolume.d ../geom/volume/tfivolume.d ../geom/volume/slabvolume.d ../geom/volume/wedgevolume.d ../geom/volume/sweptsurfacevolume.d ../geom/volume/twosurfacevolume.d ../geom/volume/meshvolume.d ../geom/volume/subrangedvolume.d ../geom/grid/package.d ../geom/grid/grid.d ../geom/grid/sgrid.d ../geom/grid/usgrid.d ../geom/grid/paver.d ../geom/grid/paver2d.d ../geom/misc/package.d ../geom/misc/univariatefunctions.d ../geom/misc/svg.d ../geom/misc/sketch.d ../geom/luawrap/package.d ../geom/luawrap/luaunifunction.d ../geom/luawrap/luageom.d ../geom/luawrap/luagpath.d ../geom/luawrap/luagpath_utils.d ../geom/luawrap/luasurface.d ../geom/luawrap/luavolume.d ../geom/luawrap/luagrid.d ../geom/luawrap/luasgrid.d ../geom/luawrap/luausgrid.d ../geom/luawrap/luasketch.d ../grid_utils/grid_deform.d ../gas/package.d ../gas/co2gas.d ../gas/co2gas_sw.d ../gas/gas_model.d ../gas/gas_state.d ../gas/init_gas_model.d ../gas/ideal_ga---Type <return> to continue, or q <return> to quit--- s.d ../gas/ideal_helium.d ../gas/cubic_gas.d ../gas/cea_gas.d ../gas/physical_constants.d ../gas/sf6virial.d ../gas/therm_perf_gas.d ../gas/very_viscous_air.d ../gas/uniform_lut.d ../gas/uniform_lut_plus_ideal.d ../gas/adaptive_lut_CEA.d ../gas/ideal_air_proxy.d ../gas/powers_aslam_gas.d ../gas/two_temperature_reacting_argon.d ../gas/ideal_dissociating_gas.d ../gas/two_temperature_air.d ../gas/two_temperature_nitrogen.d ../gas/vib_specific_nitrogen.d ../gas/fuel_air_mix.d ../gas/equilibrium_gas.d ../gas/ideal_air_fortran.o ../gas/steam.d ../gas/pseudo_species_gas.d ../gas/pseudo_species.d ../gas/electronically_specific_gas.d ../gas/electronic_species.d ../gas/two_temperature_gasgiant.d ../gas/thermo/cea_thermo_curves.d ../gas/thermo/evt_eos.d ../gas/thermo/perf_gas_mix_eos.d ../gas/thermo/pvt_eos.d ../gas/thermo/therm_perf_gas_mix_eos.d ../gas/diffusion/cea_therm_cond.d ../gas/diffusion/cea_viscosity.d ../gas/diffusion/chemkin_therm_cond.d ../gas/diffusion/chemkin_viscosity.d ../gas/diffusion/sutherland_therm_cond.d ../gas/diffusion/sutherland_viscosity.d ../gas/diffusion/therm_cond.d ../gas/diffusion/viscosity.d ../gas/diffusion/wilke_mixing_therm_cond.d ../gas/diffusion/wilke_mixing_viscosity.d ../gas/diffusion/gasgiant_transport_properties.d ../extern/gzip/gzip.d ../util/lua.d ../util/lua_service.d ../util/msg_service.d ../nm/package.d ../nm/number.d ../nm/complex.d ../nm/bbla.d ../nm/bdfLU.d ../nm/bracketing.d ../nm/brent.d ../nm/gaussquad.d ../nm/linesearch.d ../nm/nelmin.d ../nm/newtoncotes.d ../nm/ridder.d ../nm/rungekutta.d ../nm/rsla.d ../nm/smla.d ../nm/tree_patch.d ../nm/univariate_lut.d ../kinetics/package.d ../kinetics/thermochemical_reactor.d ../kinetics/init_thermochemical_reactor.d ../kinetics/chemistry_update.d ../kinetics/electronic_update.d ../kinetics/electronically_specific_kinetics.d ../kinetics/ideal_dissociating_gas_kinetics.d ../kinetics/fuel_air_mix_kinetics.d ../kinetics/powers_aslam_kinetics.d ../kinetics/rate_constant.d ../kinetics/reaction.d ../kinetics/reaction_mechanism.d ../kinetics/two_temperature_air_kinetics.d ../kinetics/two_temperature_argon_kinetics.d ../kinetics/two_temperature_nitrogen_kinetics.d ../kinetics/vib_specific_nitrogen_kinetics.d ../kinetics/two_temperature_gasgiant_kinetics.d ../gas/luagas_model.d ../kinetics/luathermochemical_reactor.d ../kinetics/luachemistry_update.d ../kinetics/luaelectronically_specific_kinetics.d ../kinetics/luareaction_mechanism.d ../kinetics/luatwo_temperature_air_kinetics.d ../kinetics/luavib_specific_nitrogen_kinetics.d ../gasdyn/gasflowexception.d ../gasdyn/idealgasflow.d ../gasdyn/luaidealgasflow.d ../gasdyn/gasflow.d ../gasdyn/luagasflow.d ../nm/luabbla.d -L-L../../extern/lua-5.1.4/lib -L-llua -L-ldl [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". tym = x14 Program received signal SIGILL, Illegal instruction. 0x000000000081df07 in xmmload(unsigned int, bool) () (gdb) backtrace unsigned int, unsigned int*) () int*) () int*) () int*, unsigned int) () int*) () int*, unsigned int) () int*) () int*, unsigned int) () int*) () int*) () int*, unsigned int) () int*) () int*, unsigned int) () int*) () int*) () int*, unsigned int) () int*, unsigned int, bool) () int, elem*, elem*, unsigned int*) () int*) () int*, unsigned int) () int*) () int*) () ---Type <return> to continue, or q <return> to quit--- int*, unsigned int) () unsigned int, code*) () int&, char const*, Symbol**, unsigned int) () FuncDeclaration_toObjFile(FuncDeclaration*, bool) () toObjFile::ToObjFile::visit(FuncDeclaration*) () _D3dmd4mars7tryMainFmPPxaKSQz7globals5ParamZi () (gdb)
Aug 12 2019
parent reply Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Monday, 12 August 2019 at 11:08:50 UTC, Peter Jacobs wrote:
 Nicholas, thank you for looking.  Below is the transcript of 
 compiling from within gdb.
 [...]
 Program received signal SIGILL, Illegal instruction.
0x000000000081df07 in xmmload(unsigned int, bool) () (gdb) backtrace
Thanks, that corresponds to https://github.com/dlang/dmd/blob/eda232a9f72b482c92cefb27a4321afc0aedbb5c/src/dmd/backend/cgxmm.d#L716-L717. So it would appear that you are trying (apparently successfully with debug DMD (and LDC(?)) to use `real` with xmm somehow??? I can't really help anymore without a reduced test case.
Aug 12 2019
next sibling parent reply Peter Jacobs <peterj mech.uq.edu.au> writes:
On Monday, 12 August 2019 at 11:30:58 UTC, Nicholas Wilson wrote:
 On Monday, 12 August 2019 at 11:08:50 UTC, Peter Jacobs wrote:
 Nicholas, thank you for looking.  Below is the transcript of 
 compiling from within gdb.
 [...]
 Program received signal SIGILL, Illegal instruction.
0x000000000081df07 in xmmload(unsigned int, bool) () (gdb) backtrace
Thanks, that corresponds to https://github.com/dlang/dmd/blob/eda232a9f72b482c92cefb27a4321afc0aedbb5c/src/dmd/backend/cgxmm.d#L716-L717. So it would appear that you are trying (apparently successfully with debug DMD (and LDC(?)) to use `real` with xmm somehow??? I can't really help anymore without a reduced test case.
OK, I will see what I can do about a test case. Also, I will go looking for places where we* might have used real variables or values. I can think of the use of PI from the math module, for example. Cheers, Peter J. * There are a few of us writing various parts of the flow solver code.
Aug 12 2019
parent reply Seb <seb wilzba.ch> writes:
On Monday, 12 August 2019 at 11:47:17 UTC, Peter Jacobs wrote:
 On Monday, 12 August 2019 at 11:30:58 UTC, Nicholas Wilson 
 wrote:
 On Monday, 12 August 2019 at 11:08:50 UTC, Peter Jacobs wrote:
 Nicholas, thank you for looking.  Below is the transcript of 
 compiling from within gdb.
 [...]
 Program received signal SIGILL, Illegal instruction.
0x000000000081df07 in xmmload(unsigned int, bool) () (gdb) backtrace
Thanks, that corresponds to https://github.com/dlang/dmd/blob/eda232a9f72b482c92cefb27a4321afc0aedbb5c/src/dmd/backend/cgxmm.d#L716-L717. So it would appear that you are trying (apparently successfully with debug DMD (and LDC(?)) to use `real` with xmm somehow??? I can't really help anymore without a reduced test case.
OK, I will see what I can do about a test case. Also, I will go looking for places where we* might have used real variables or values. I can think of the use of PI from the math module, for example. Cheers, Peter J. * There are a few of us writing various parts of the flow solver code.
FYI DustMite has been created _exactly_ for this purpose. It's even bundled with the official DMD releases. https://github.com/CyberShadow/DustMite/wiki 1) Copy all project sources in fresh directory 2) Run dustmite with a tester to check whether the bug can still be observed. Here: --- dustmite fresh-dir 'dmd -O (your normal invocation) 2>&1 | grep -qF "tym = 14"' ---
Aug 12 2019
next sibling parent reply FeepingCreature <feepingcreature gmail.com> writes:
On Monday, 12 August 2019 at 12:17:00 UTC, Seb wrote:
 FYI DustMite has been created _exactly_ for this purpose. It's 
 even bundled with the official DMD releases.

 https://github.com/CyberShadow/DustMite/wiki


 1) Copy all project sources in fresh directory
 2) Run dustmite with a tester to check whether the bug can 
 still be observed.
 Here:

 ---
 dustmite fresh-dir 'dmd -O (your normal invocation) 2>&1 | grep 
 -qF "tym = 14"'
 ---
I should do a proper blogpost on the Dustmite methodology I use at some point. Maybe a ten minute dconf talk next year. But basically, you make a source folder, call it, say, fresh-dir-1. Make a repro script, repro-1.sh. Run dustmite to completion. This creates fresh-dir-1.reduced. Then this folder is *immediately* copied to "fresh-dir-2", the script to repro-2.sh, and the process is repeated from start. The reason for this is usually Dustmite doesn't quite manage to finish the reduction on its own and needs some help to get nontrivial reductions like inlining template parameters. Or sometimes you want to reduce the main program first, and only then add in external libraries or Phobos modules. But it's easy, and has happened to me lots of times, to accidentally destroy the reduction that way, especially if it spans multiple files. By copying the reduced folder, we ensure we are working in a clean folder and never have to waste time rerunning the previous reduction.
Aug 12 2019
next sibling parent Mike Parker <aldacron gmail.com> writes:
On Tuesday, 13 August 2019 at 05:50:23 UTC, FeepingCreature wrote:

 I should do a proper blogpost on the Dustmite methodology I use 
 at some point.
A blog post for the D Blog is always welcome :-) You'd get a bounty for it, too.
Aug 12 2019
prev sibling next sibling parent Seb <seb wilzba.ch> writes:
On Tuesday, 13 August 2019 at 05:50:23 UTC, FeepingCreature wrote:
 On Monday, 12 August 2019 at 12:17:00 UTC, Seb wrote:
 [...]
I should do a proper blogpost on the Dustmite methodology I use at some point. Maybe a ten minute dconf talk next year. But basically, you make a source folder, call it, say, fresh-dir-1. Make a repro script, repro-1.sh. Run dustmite to completion. This creates fresh-dir-1.reduced. Then this folder is *immediately* copied to "fresh-dir-2", the script to repro-2.sh, and the process is repeated from start. [...]
... Or a PR to Dustmite to have this as a built-in feature.
Aug 12 2019
prev sibling parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Tuesday, 13 August 2019 at 05:50:23 UTC, FeepingCreature wrote:
 I should do a proper blogpost on the Dustmite methodology I use 
 at some point. Maybe a ten minute dconf talk next year. But 
 basically, you make a source folder, call it, say, fresh-dir-1. 
 Make a repro script, repro-1.sh. Run dustmite to completion. 
 This creates fresh-dir-1.reduced. Then this folder is 
 *immediately* copied to "fresh-dir-2", the script to 
 repro-2.sh, and the process is repeated from start.
Hey, that's exactly what I do! :)
Aug 13 2019
parent Jonathan M Davis <newsgroup.d jmdavisprog.com> writes:
On Tuesday, August 13, 2019 3:07:50 AM MDT Vladimir Panteleev via 
Digitalmars-d wrote:
 On Tuesday, 13 August 2019 at 05:50:23 UTC, FeepingCreature wrote:
 I should do a proper blogpost on the Dustmite methodology I use
 at some point. Maybe a ten minute dconf talk next year. But
 basically, you make a source folder, call it, say, fresh-dir-1.
 Make a repro script, repro-1.sh. Run dustmite to completion.
 This creates fresh-dir-1.reduced. Then this folder is
 *immediately* copied to "fresh-dir-2", the script to
 repro-2.sh, and the process is repeated from start.
Hey, that's exactly what I do! :)
Honestly, it's what I would have expected anyone using dustmite to do, though I can certainly believe that some folks don't do it at first. - Jonathan M Davis
Aug 13 2019
prev sibling next sibling parent reply Peter Jacobs <peterj mech.uq.edu.au> writes:
On Monday, 12 August 2019 at 12:17:00 UTC, Seb wrote:
 FYI DustMite has been created _exactly_ for this purpose. It's 
 even bundled with the official DMD releases.

 https://github.com/CyberShadow/DustMite/wiki
Just a note to report that I get "Video unavailable" for the Youtube link close to the top of the DustMite wiki page. https://www.youtube.com/watch?v=5iXRFlKvEY0
Aug 13 2019
parent matheus <matheus gmail.com> writes:
On Wednesday, 14 August 2019 at 02:53:17 UTC, Peter Jacobs wrote:
 On Monday, 12 August 2019 at 12:17:00 UTC, Seb wrote:
 FYI DustMite has been created _exactly_ for this purpose. It's 
 even bundled with the official DMD releases.

 https://github.com/CyberShadow/DustMite/wiki
Just a note to report that I get "Video unavailable" for the Youtube link close to the top of the DustMite wiki page. https://www.youtube.com/watch?v=5iXRFlKvEY0
And the correct link is this: https://youtu.be/1viQK8w6370 By the way, why such useful talk has so few views? Maybe the wrong link contributed to that? Or maybe is the fact that we need to learn how to spread information like this better, in fact I never used before because of lack of knowledge, and searching for Dustmite on youtube gives nothing on the matter. Matheus.
Aug 13 2019
prev sibling parent reply Peter Jacobs <peterj mech.uq.edu.au> writes:
On Monday, 12 August 2019 at 12:17:00 UTC, Seb wrote:
 FYI DustMite has been created _exactly_ for this purpose. It's 
 even bundled with the official DMD releases.

 https://github.com/CyberShadow/DustMite/wiki


 1) Copy all project sources in fresh directory
 2) Run dustmite with a tester to check whether the bug can 
 still be observed.
 Here:

 ---
 dustmite fresh-dir 'dmd -O (your normal invocation) 2>&1 | grep 
 -qF "tym = 14"'
 ---
Using the suggestion of putting the command into a script, I gave dustmite a go but didn't get far. The script itself seemed to have the correct behaviour when invoked from within the eilmer-clean directory. peterj helmholtz ~/dgd-play/src $ dustmite eilmer-clean ../dustmite-script.sh Loading eilmer-clean/INSTALL Loading eilmer-clean/README Loading eilmer-clean/bc/boundary_cell_effect.d Loading eilmer-clean/bc/boundary_condition.d Loading eilmer-clean/bc/boundary_flux_effect.d Loading eilmer-clean/bc/boundary_interface_effect.d Loading eilmer-clean/bc/ghost_cell_effect/extrapolate_copy.d Loading eilmer-clean/bc/ghost_cell_effect/fixed_p.d Loading eilmer-clean/bc/ghost_cell_effect/fixed_pt.d Loading eilmer-clean/bc/ghost_cell_effect/flow_state_copy.d Loading eilmer-clean/bc/ghost_cell_effect/flow_state_copy_from_profile.d Loading eilmer-clean/bc/ghost_cell_effect/from_stagnation.d Loading eilmer-clean/bc/ghost_cell_effect/full_face_copy.d Loading eilmer-clean/bc/ghost_cell_effect/ghost_cell.d Loading eilmer-clean/bc/ghost_cell_effect/internal_copy_then_reflect.d Loading eilmer-clean/bc/ghost_cell_effect/mapped_cell_copy.d Loading eilmer-clean/bc/ghost_cell_effect/package.d Loading eilmer-clean/bc/package.d Loading eilmer-clean/bc/user_defined_effects.d Loading eilmer-clean/conservedquantities.d Loading eilmer-clean/cuda_gpu_chem.d Loading eilmer-clean/fileutil.d Loading eilmer-clean/flowgradients.d Loading eilmer-clean/flowsolution.d Loading eilmer-clean/flowstate.d Loading eilmer-clean/fluidblock.d Loading eilmer-clean/fluxcalc.d Loading eilmer-clean/fvcell.d Loading eilmer-clean/fvcore.d Loading eilmer-clean/fvinterface.d Loading eilmer-clean/fvvertex.d Loading eilmer-clean/gas_solid_interface.d Loading eilmer-clean/globalconfig.d Loading eilmer-clean/globaldata.d Loading eilmer-clean/grid_motion.d Loading eilmer-clean/history.d Loading eilmer-clean/json_helper.d Loading eilmer-clean/limiters.d Loading eilmer-clean/loadbalance.d Loading eilmer-clean/loads.d Loading eilmer-clean/lsqinterp.d Loading eilmer-clean/lua_helper.d Loading eilmer-clean/luaflowsolution.d Loading eilmer-clean/luaflowstate.d Loading eilmer-clean/luaglobalconfig.d Loading eilmer-clean/main.d Loading eilmer-clean/main_with_rev_string.d Loading eilmer-clean/makefile Loading eilmer-clean/mass_diffusion.d Loading eilmer-clean/onedinterp.d Loading eilmer-clean/opencl_gpu_chem.d Loading eilmer-clean/optdriver.d Loading eilmer-clean/postprocess.d Loading eilmer-clean/sfluidblock.d Loading eilmer-clean/shape_sensitivity_calc.d Loading eilmer-clean/shape_sensitivity_core.d Loading eilmer-clean/shock_fitting_moving_grid.d Loading eilmer-clean/simcore.d Loading eilmer-clean/solid/luasolidprops.d Loading eilmer-clean/solid/solid_boundary_flux_effect.d Loading eilmer-clean/solid/solid_boundary_interface_effect.d Loading eilmer-clean/solid/solid_loose_coupling_update.d Loading eilmer-clean/solid/solid_udf_source_terms.d Loading eilmer-clean/solid/solidbc.d Loading eilmer-clean/solid/solidblock.d Loading eilmer-clean/solid/solidfvcell.d Loading eilmer-clean/solid/solidfvinterface.d Loading eilmer-clean/solid/solidfvvertex.d Loading eilmer-clean/solid/solidprops.d Loading eilmer-clean/solid/solidsolution.d Loading eilmer-clean/solid/ssolidblock.d Loading eilmer-clean/special_block_init.d Loading eilmer-clean/steadystate_core.d Loading eilmer-clean/steadystate_solver.d Loading eilmer-clean/tecio.d Loading eilmer-clean/tecplot_writer.d Loading eilmer-clean/test-area.py Loading eilmer-clean/testrivp.d Loading eilmer-clean/ufluidblock.d Loading eilmer-clean/user_defined_source_terms.d None => No object.Exception DustMite/dustmite.d(271): Initial test fails (try using --no-redirect for details) ---------------- ??:? _Dmain [0x556361] peterj helmholtz ~/dgd-play/src $ dustmite --no-redirect eilmer-clean ../dustmite-script.sh Loading eilmer-clean/INSTALL Loading eilmer-clean/README Loading eilmer-clean/bc/boundary_cell_effect.d Loading eilmer-clean/bc/boundary_condition.d Loading eilmer-clean/bc/boundary_flux_effect.d Loading eilmer-clean/bc/boundary_interface_effect.d Loading eilmer-clean/bc/ghost_cell_effect/extrapolate_copy.d Loading eilmer-clean/bc/ghost_cell_effect/fixed_p.d Loading eilmer-clean/bc/ghost_cell_effect/fixed_pt.d Loading eilmer-clean/bc/ghost_cell_effect/flow_state_copy.d Loading eilmer-clean/bc/ghost_cell_effect/flow_state_copy_from_profile.d Loading eilmer-clean/bc/ghost_cell_effect/from_stagnation.d Loading eilmer-clean/bc/ghost_cell_effect/full_face_copy.d Loading eilmer-clean/bc/ghost_cell_effect/ghost_cell.d Loading eilmer-clean/bc/ghost_cell_effect/internal_copy_then_reflect.d Loading eilmer-clean/bc/ghost_cell_effect/mapped_cell_copy.d Loading eilmer-clean/bc/ghost_cell_effect/package.d Loading eilmer-clean/bc/package.d Loading eilmer-clean/bc/user_defined_effects.d Loading eilmer-clean/conservedquantities.d Loading eilmer-clean/cuda_gpu_chem.d Loading eilmer-clean/fileutil.d Loading eilmer-clean/flowgradients.d Loading eilmer-clean/flowsolution.d Loading eilmer-clean/flowstate.d Loading eilmer-clean/fluidblock.d Loading eilmer-clean/fluxcalc.d Loading eilmer-clean/fvcell.d Loading eilmer-clean/fvcore.d Loading eilmer-clean/fvinterface.d Loading eilmer-clean/fvvertex.d Loading eilmer-clean/gas_solid_interface.d Loading eilmer-clean/globalconfig.d Loading eilmer-clean/globaldata.d Loading eilmer-clean/grid_motion.d Loading eilmer-clean/history.d Loading eilmer-clean/json_helper.d Loading eilmer-clean/limiters.d Loading eilmer-clean/loadbalance.d Loading eilmer-clean/loads.d Loading eilmer-clean/lsqinterp.d Loading eilmer-clean/lua_helper.d Loading eilmer-clean/luaflowsolution.d Loading eilmer-clean/luaflowstate.d Loading eilmer-clean/luaglobalconfig.d Loading eilmer-clean/main.d Loading eilmer-clean/main_with_rev_string.d Loading eilmer-clean/makefile Loading eilmer-clean/mass_diffusion.d Loading eilmer-clean/onedinterp.d Loading eilmer-clean/opencl_gpu_chem.d Loading eilmer-clean/optdriver.d Loading eilmer-clean/postprocess.d Loading eilmer-clean/sfluidblock.d Loading eilmer-clean/shape_sensitivity_calc.d Loading eilmer-clean/shape_sensitivity_core.d Loading eilmer-clean/shock_fitting_moving_grid.d Loading eilmer-clean/simcore.d Loading eilmer-clean/solid/luasolidprops.d Loading eilmer-clean/solid/solid_boundary_flux_effect.d Loading eilmer-clean/solid/solid_boundary_interface_effect.d Loading eilmer-clean/solid/solid_loose_coupling_update.d Loading eilmer-clean/solid/solid_udf_source_terms.d Loading eilmer-clean/solid/solidbc.d Loading eilmer-clean/solid/solidblock.d Loading eilmer-clean/solid/solidfvcell.d Loading eilmer-clean/solid/solidfvinterface.d Loading eilmer-clean/solid/solidfvvertex.d Loading eilmer-clean/solid/solidprops.d Loading eilmer-clean/solid/solidsolution.d Loading eilmer-clean/solid/ssolidblock.d Loading eilmer-clean/special_block_init.d Loading eilmer-clean/steadystate_core.d Loading eilmer-clean/steadystate_solver.d Loading eilmer-clean/tecio.d Loading eilmer-clean/tecplot_writer.d Loading eilmer-clean/test-area.py Loading eilmer-clean/testrivp.d Loading eilmer-clean/ufluidblock.d Loading eilmer-clean/user_defined_source_terms.d None => No object.Exception DustMite/dustmite.d(271): Initial test fails ---------------- ??:? _Dmain [0x556361] peterj helmholtz ~/dgd-play/src $
Aug 13 2019
parent reply Seb <seb wilzba.ch> writes:
On Wednesday, 14 August 2019 at 05:37:34 UTC, Peter Jacobs wrote:
 On Monday, 12 August 2019 at 12:17:00 UTC, Seb wrote:
 [...]
Using the suggestion of putting the command into a script, I gave dustmite a go but didn't get far. The script itself seemed to have the correct behaviour when invoked from within the eilmer-clean directory. [...]
Did you follow the advice the tool gives you?
 try using --no-redirect for details
This means that the tester (DMD + grep) exited with a 0 exit code (i.e. no failure). See also: https://github.com/CyberShadow/DustMite/wiki/Reducing-a-segmentation-fault
Aug 14 2019
parent reply Peter Jacobs <peterj mech.uq.edu.au> writes:
On Wednesday, 14 August 2019 at 07:13:43 UTC, Seb wrote:
 Did you follow the advice the tool gives you?

 try using --no-redirect for details
This means that the tester (DMD + grep) exited with a 0 exit code (i.e. no failure). See also: https://github.com/CyberShadow/DustMite/wiki/Reducing-a-segmentation-fault
Yes, there are the results of two attempts in that previous note. The second with --no-redirect. I also checked, before running dustmite, that the script itself resulted in an exit code of 1. It is likely that I am misunderstanding something, however, it seems to me that dustmite itself is failing.
Aug 14 2019
next sibling parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Wednesday, 14 August 2019 at 08:56:27 UTC, Peter Jacobs wrote:
 Yes, there are the results of two attempts in that previous 
 note. The second with --no-redirect.  I also checked, before 
 running dustmite, that the script itself resulted in an exit 
 code of 1.
Can you post the script? If it's a shell script, enabling `set -x` at the top might give a clue.
 It is likely that I am misunderstanding something, however, it 
 seems to me that dustmite itself is failing.
That's unlikely, but there's still many opportunities to heuristically detect classes of user mistakes and suggest actionable fixes. (E.g. this is done when the script path is specified relatively to $PWD instead of the source directory.)
Aug 14 2019
parent reply Peter Jacobs <peterj mech.uq.edu.au> writes:
On Wednesday, 14 August 2019 at 09:15:00 UTC, Vladimir Panteleev 
wrote:
 On Wednesday, 14 August 2019 at 08:56:27 UTC, Peter Jacobs 
 wrote:
 Yes, there are the results of two attempts in that previous 
 note. The second with --no-redirect.  I also checked, before 
 running dustmite, that the script itself resulted in an exit 
 code of 1.
Can you post the script? If it's a shell script, enabling `set -x` at the top might give a clue.
 It is likely that I am misunderstanding something, however, it 
 seems to me that dustmite itself is failing.
That's unlikely, but there's still many opportunities to heuristically detect classes of user mistakes and suggest actionable fixes. (E.g. this is done when the script path is specified relatively to $PWD instead of the source directory.)
Content of dustmite-script.sh follows. dmd -w -O -release -inline -boundscheck=off -version=flavour_fast -dip1008 -I.. -I../nm -I../util -I../geom -I../grid_utils -I../extern/gzip -version=multi_species_gas -version=multi_T_gas -version=MHD -version=komega -ofe4shared \ -version=tecplot_unavailable \ main_with_rev_string.d \ simcore.d fileutil.d json_helper.d fvcore.d fvcell.d fvvertex.d fvinterface.d fluxcalc.d onedinterp.d flowgradients.d lsqinterp.d limiters.d conservedquantities.d flowstate.d globalconfig.d globaldata.d fluidblock.d sfluidblock.d ufluidblock.d gas_solid_interface.d flowsolution.d grid_motion.d shock_fitting_moving_grid.d history.d loads.d special_block_init.d mass_diffusion.d tecplot_writer.d luaglobalconfig.d lua_helper.d luaflowsolution.d luaflowstate.d user_defined_source_terms.d postprocess.d \ bc/package.d bc/boundary_condition.d bc/ghost_cell_effect/package.d bc/ghost_cell_effect/ghost_cell.d bc/ghost_cell_effect/internal_copy_then_reflect.d bc/ghost_cell_effect/flow_state_copy.d bc/ghost_cell_effect/flow_state_copy_from_profile.d bc/ghost_cell_effect/extrapolate_copy.d bc/ghost_cell_effect/fixed_p.d bc/ghost_cell_effect/fixed_pt.d bc/ghost_cell_effect/from_stagnation.d bc/ghost_cell_effect/full_face_copy.d bc/ghost_cell_effect/mapped_cell_copy.d bc/user_defined_effects.d bc/boundary_flux_effect.d bc/boundary_cell_effect.d bc/boundary_interface_effect.d solid/solidbc.d solid/solidblock.d solid/solid_boundary_flux_effect.d solid/solid_boundary_interface_effect.d solid/solid_loose_coupling_update.d solid/ssolidblock.d solid/solidfvcell.d solid/solidfvinterface.d solid/solidfvvertex.d solid/solidprops.d solid/solidsolution.d solid/solid_udf_source_terms.d solid/luasolidprops.d ../geom/package.d ../geom/geometry_exception.d ../geom/elements/package.d ../geom/elements/nomenclature.d ../geom/elements/vector3.d ../geom/elements/properties.d ../geom/elements/projection.d ../geom/gpath/package.d ../geom/gpath/path.d ../geom/gpath/line.d ../geom/gpath/arc.d ../geom/gpath/helix.d ../geom/gpath/bezier.d ../geom/gpath/polynomial.d ../geom/gpath/polyline.d ../geom/gpath/svgpath.d ../geom/gpath/modifiedpath.d ../geom/gpath/gpath_utils.d ../geom/surface/package.d ../geom/surface/parametricsurface.d ../geom/surface/coonspatch.d ../geom/surface/aopatch.d ../geom/surface/channelpatch.d ../geom/surface/sweptpathpatch.d ../geom/surface/meshpatch.d ../geom/surface/subrangedsurface.d ../geom/surface/bezierpatch.d ../geom/surface/beziertrianglepatch.d ../geom/volume/package.d ../geom/volume/parametricvolume.d ../geom/volume/tfivolume.d ../geom/volume/slabvolume.d ../geom/volume/wedgevolume.d ../geom/volume/sweptsurfacevolume.d ../geom/volume/twosurfacevolume.d ../geom/volume/meshvolume.d ../geom/volume/subrangedvolume.d ../geom/grid/package.d ../geom/grid/grid.d ../geom/grid/sgrid.d ../geom/grid/usgrid.d ../geom/grid/paver.d ../geom/grid/paver2d.d ../geom/misc/package.d ../geom/misc/univariatefunctions.d ../geom/misc/svg.d ../geom/misc/sketch.d ../geom/luawrap/package.d ../geom/luawrap/luaunifunction.d ../geom/luawrap/luageom.d ../geom/luawrap/luagpath.d ../geom/luawrap/luagpath_utils.d ../geom/luawrap/luasurface.d ../geom/luawrap/luavolume.d ../geom/luawrap/luagrid.d ../geom/luawrap/luasgrid.d ../geom/luawrap/luausgrid.d ../geom/luawrap/luasketch.d ../grid_utils/grid_deform.d \ ../gas/package.d ../gas/co2gas.d ../gas/co2gas_sw.d ../gas/gas_model.d ../gas/gas_state.d ../gas/init_gas_model.d ../gas/ideal_gas.d ../gas/ideal_helium.d ../gas/cubic_gas.d ../gas/cea_gas.d ../gas/physical_constants.d ../gas/sf6virial.d ../gas/therm_perf_gas.d ../gas/very_viscous_air.d ../gas/uniform_lut.d ../gas/uniform_lut_plus_ideal.d ../gas/adaptive_lut_CEA.d ../gas/ideal_air_proxy.d ../gas/powers_aslam_gas.d ../gas/two_temperature_reacting_argon.d ../gas/ideal_dissociating_gas.d ../gas/two_temperature_air.d ../gas/two_temperature_nitrogen.d ../gas/vib_specific_nitrogen.d ../gas/fuel_air_mix.d ../gas/equilibrium_gas.d ../gas/ideal_air_fortran.o ../gas/steam.d ../gas/pseudo_species_gas.d ../gas/pseudo_species.d ../gas/electronically_specific_gas.d ../gas/electronic_species.d ../gas/two_temperature_gasgiant.d ../gas/thermo/cea_thermo_curves.d ../gas/thermo/evt_eos.d ../gas/thermo/perf_gas_mix_eos.d ../gas/thermo/pvt_eos.d ../gas/thermo/therm_perf_gas_mix_eos.d ../gas/diffusion/cea_therm_cond.d ../gas/diffusion/cea_viscosity.d ../gas/diffusion/chemkin_therm_cond.d ../gas/diffusion/chemkin_viscosity.d ../gas/diffusion/sutherland_therm_cond.d ../gas/diffusion/sutherland_viscosity.d ../gas/diffusion/therm_cond.d ../gas/diffusion/viscosity.d ../gas/diffusion/wilke_mixing_therm_cond.d ../gas/diffusion/wilke_mixing_viscosity.d ../gas/diffusion/gasgiant_transport_properties.d ../extern/gzip/gzip.d \ ../util/lua.d ../util/lua_service.d ../util/msg_service.d ../nm/package.d ../nm/number.d ../nm/complex.d ../nm/bbla.d ../nm/bdfLU.d ../nm/bracketing.d ../nm/brent.d ../nm/gaussquad.d ../nm/linesearch.d ../nm/nelmin.d ../nm/newtoncotes.d ../nm/ridder.d ../nm/rungekutta.d ../nm/rsla.d ../nm/smla.d ../nm/tree_patch.d ../nm/univariate_lut.d \ ../kinetics/package.d ../kinetics/thermochemical_reactor.d ../kinetics/init_thermochemical_reactor.d ../kinetics/chemistry_update.d ../kinetics/electronic_update.d ../kinetics/electronically_specific_kinetics.d ../kinetics/ideal_dissociating_gas_kinetics.d ../kinetics/fuel_air_mix_kinetics.d ../kinetics/powers_aslam_kinetics.d ../kinetics/rate_constant.d ../kinetics/reaction.d ../kinetics/reaction_mechanism.d ../kinetics/two_temperature_air_kinetics.d ../kinetics/two_temperature_argon_kinetics.d ../kinetics/two_temperature_nitrogen_kinetics.d ../kinetics/vib_specific_nitrogen_kinetics.d ../kinetics/two_temperature_gasgiant_kinetics.d ../gas/luagas_model.d ../kinetics/luathermochemical_reactor.d ../kinetics/luachemistry_update.d ../kinetics/luaelectronically_specific_kinetics.d ../kinetics/luareaction_mechanism.d ../kinetics/luatwo_temperature_air_kinetics.d ../kinetics/luavib_specific_nitrogen_kinetics.d \ ../gasdyn/gasflowexception.d ../gasdyn/idealgasflow.d ../gasdyn/luaidealgasflow.d ../gasdyn/gasflow.d ../gasdyn/luagasflow.d ../nm/luabbla.d \ -L-L../../extern/lua-5.1.4/lib -L-llua -L-ldl 2>&1 | grep -qF "tym = 14"
Aug 14 2019
parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Wednesday, 14 August 2019 at 09:20:58 UTC, Peter Jacobs wrote:
 Content of dustmite-script.sh follows.
Looks fine; make sure you get an exit code of 0 though as per Seb's post. If you don't, remove the grep from the end and check the compiler output, as it probably isn't what you were expecting.
Aug 14 2019
parent reply Peter Jacobs <peterj mech.uq.edu.au> writes:
On Wednesday, 14 August 2019 at 09:26:58 UTC, Vladimir Panteleev 
wrote:
 On Wednesday, 14 August 2019 at 09:20:58 UTC, Peter Jacobs 
 wrote:
 Content of dustmite-script.sh follows.
Looks fine; make sure you get an exit code of 0 though as per Seb's post. If you don't, remove the grep from the end and check the compiler output, as it probably isn't what you were expecting.
I definitely have been thinking incorrectly about the exit code. Now that I reread the dustmite output with that in mind, it makes better sense, although it seems a bit of a "hard stop" to dustmite's execution. I will fix the exit code for the script and try again.
Aug 14 2019
parent reply Peter Jacobs <peterj mech.uq.edu.au> writes:
On Wednesday, 14 August 2019 at 09:48:09 UTC, Peter Jacobs wrote:
 I will fix the exit code for the script and try again.
There were a couple of issues. I could not match the string, even when I corrected its text (to include the 'x'). All of my attempts at redirection of the string seemed to have been unsuccessful, maybe because of the Illegal Instruction associated with the dmd command. Anyway, I changed to detecting exit code 132 for the Illegal Instruction and redirecting stdout and stderr in the bash script before invoking the dmd command. Now dustmite is doing its thing. I will leave it over night to see what gets reduced. Thanks, all, for the tutoring.
Aug 14 2019
parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Wednesday, 14 August 2019 at 11:56:51 UTC, Peter Jacobs wrote:
 On Wednesday, 14 August 2019 at 09:48:09 UTC, Peter Jacobs 
 wrote:
 I will fix the exit code for the script and try again.
There were a couple of issues. I could not match the string, even when I corrected its text (to include the 'x'). All of my attempts at redirection of the string seemed to have been unsuccessful, maybe because of the Illegal Instruction associated with the dmd command.
FYI, the reason why you can't grep for "Illegal Instruction" (or "Segmentation fault" or other such error messages), is because that is printed by the shell running your test shell script, i.e. it happens "above" the grep command. (Specifically it prints this message as a result of the process being killed by SIGILL / SIGSEGV etc.)
Aug 14 2019
parent reply Peter Jacobs <peterj mech.uq.edu.au> writes:
On Wednesday, 14 August 2019 at 12:05:43 UTC, Vladimir Panteleev 
wrote:
 FYI, the reason why you can't grep for "Illegal Instruction" 
 (or "Segmentation fault" or other such error messages), is 
 because that is printed by the shell running your test shell 
 script, i.e. it happens "above" the grep command. (Specifically 
 it prints this message as a result of the process being killed 
 by SIGILL / SIGSEGV etc.)
Not quite the issue. I was trying (unsuccessfully) to grep for "tym = x14", as suggested by Seb. That should have been sent through to grep but it seems not. The compiler should not be trying to execute an illegal instruction, anyway, so that seems to be a good target for dustmite's experiments. While dustmite is currently chipping away, and given the correct link by Matheus, I am watching your 2014 DConf presentation. Excellent work! Cheers, Peter J.
Aug 14 2019
parent Petar Kirov [ZombineDev] <petar.p.kirov gmail.com> writes:
On Wednesday, 14 August 2019 at 12:47:37 UTC, Peter Jacobs wrote:
 [..]
 The compiler should not be trying to execute an illegal 
 instruction, anyway, so that seems to be a good target for 
 dustmite's experiments.
 [..]
What actually happens is that the compiler has reached an assert(0) statement which on x86 is implemented as UD2 or HLT instruction as a efficient way to signal that an unreachable part of the program has been reached (likely as a result of an unhandled case).
Aug 14 2019
prev sibling parent Seb <seb wilzba.ch> writes:
On Wednesday, 14 August 2019 at 08:56:27 UTC, Peter Jacobs wrote:
 On Wednesday, 14 August 2019 at 07:13:43 UTC, Seb wrote:
 Did you follow the advice the tool gives you?

 try using --no-redirect for details
This means that the tester (DMD + grep) exited with a 0 exit code (i.e. no failure). See also: https://github.com/CyberShadow/DustMite/wiki/Reducing-a-segmentation-fault
Yes, there are the results of two attempts in that previous note. The second with --no-redirect.
Ah sorry. I didn't realize this (phone screens are pretty small). Can you post the exact command that you run?
  I also checked, before running dustmite, that the script 
 itself resulted in an exit code of 1.  It is likely that I am 
 misunderstanding something, however, it seems to me that 
 dustmite itself is failing.
BTW in my second post I mixed things up. The tester needs to exit successfully (0) (e.g grep does this iff it finds a match). From Dustmite's documentation:
 Formulate a condition command, which should exit with a status 
 code of 0 when DustMite is on the right track, and anything 
 else otherwise.
Aug 14 2019
prev sibling parent reply Peter Jacobs <peterj mech.uq.edu.au> writes:
On Monday, 12 August 2019 at 11:30:58 UTC, Nicholas Wilson wrote:
[...]
 So it would appear that you are trying (apparently successfully 
 with debug DMD (and LDC(?)) to use `real` with xmm somehow???
 I can't really help anymore without a reduced test case.
Nicholas, That rabbit hole was about 5 days deep :) Here is the test case, now that dustmite has done its work: // test2.d PJ 2019-08-19 import std; double r2_r1_obl(double , double beta, double ) { double M1n = fabs(sin(beta)); return M1n; } double V2_V1_obl(double M1, double beta, double g) { return sin(beta) / r2_r1_obl(M1, beta, g); } my build script: dmd -O -inline test2.d and a log of the result: peterj helmholtz ~/dgd-play/src/test $ ./build-test2.sh tym = x14 ./build-test2.sh: line 2: 3723 Illegal instruction (core dumped) dmd -O -inline test2.d peterj helmholtz ~/dgd-play/src/test $ dmd --version DMD64 D Compiler v2.087.1 Copyright (C) 1999-2019 by The D Language Foundation, All Rights Reserved written by Walter Bright
Aug 19 2019
parent reply ag0aep6g <anonymous example.com> writes:
On 19.08.19 09:30, Peter Jacobs wrote:
 Here is the test case, now that dustmite has done its work:
 
 // test2.d PJ 2019-08-19
 import std;
 double r2_r1_obl(double , double beta, double )
 {
      double M1n = fabs(sin(beta));
      return M1n;
 }
 double V2_V1_obl(double M1, double beta, double g)
 {
      return sin(beta) / r2_r1_obl(M1, beta, g);
 }
 
 my build script:
 

 dmd -O -inline test2.d
 
 and a log of the result:
 
 peterj helmholtz ~/dgd-play/src/test $ ./build-test2.sh
 tym = x14
 ./build-test2.sh: line 2:  3723 Illegal instruction     (core dumped) 
Reduced further: ---- real sin(real x) { return 0; } double V2_V1_obl(double beta) { return sin(beta) / sin(sin(beta)); } ----
Aug 19 2019
next sibling parent Daniel Kozak <kozzi11 gmail.com> writes:
On Mon, Aug 19, 2019 at 12:30 PM ag0aep6g via Digitalmars-d
<digitalmars-d puremagic.com> wrote:
 Reduced further:

 ----
 real sin(real x) { return 0; }
 double V2_V1_obl(double beta)
 {
      return sin(beta) / sin(sin(beta));
 }
 ----
https://run.dlang.io/is/IEmbQ8
Aug 19 2019
prev sibling next sibling parent Daniel Kozak <kozzi11 gmail.com> writes:
On Mon, Aug 19, 2019 at 12:38 PM Daniel Kozak <kozzi11 gmail.com> wrote:
 On Mon, Aug 19, 2019 at 12:30 PM ag0aep6g via Digitalmars-d
 <digitalmars-d puremagic.com> wrote:
 Reduced further:

 ----
 real sin(real x) { return 0; }
 double V2_V1_obl(double beta)
 {
      return sin(beta) / sin(sin(beta));
 }
 ----
https://run.dlang.io/is/IEmbQ8
Up to 2.066.0: Success with output: -nan 2.067.1: Failure with output: Internal error: backend/evalu8.c 1274 2.068.2: Failure with output: Internal error: backend/evalu8.c 1273 2.069.2 to 2.070.2: Failure with output: Internal error: backend/evalu8.c 1271 2.071.2: Failure with output: Internal error: backend/evalu8.c 1260 2.072.2: Failure with output: Internal error: backend/evalu8.c 1261 2.073.2: Failure with output: Internal error: backend/evalu8.c 1296 2.074.1 to 2.075.1: Failure with output: Internal error: ddmd/backend/evalu8.c 1297 2.076.1 to 2.077.1: Failure with output: Internal error: ddmd/backend/evalu8.c 1296 2.078.1: Failure with output: Internal error: dmd/backend/evalu8.c 1296 2.079.1: Failure with output: Internal error: dmd/backend/evalu8.c 1030 2.080.1: Failure with output: Internal error: dmd/backend/evalu8.c 1028 Since 2.081.2: Status -4 and no output
Aug 19 2019
prev sibling parent reply Simen =?UTF-8?B?S2rDpnLDpXM=?= <simen.kjaras gmail.com> writes:
On Monday, 19 August 2019 at 10:26:41 UTC, ag0aep6g wrote:
 Reduced further:

 ----
 real sin(real x) { return 0; }
 double V2_V1_obl(double beta)
 {
     return sin(beta) / sin(sin(beta));
 }
 ----
One more: real fun(real x) { return 0; } double bug() { return 0.0 / fun(7); } -- Simen
Aug 19 2019
parent reply Daniel Kozak <kozzi11 gmail.com> writes:
On Mon, Aug 19, 2019 at 1:00 PM Simen Kjærås via Digitalmars-d
<digitalmars-d puremagic.com> wrote:
 On Monday, 19 August 2019 at 10:26:41 UTC, ag0aep6g wrote:
 Reduced further:

 ----
 real sin(real x) { return 0; }
 double V2_V1_obl(double beta)
 {
     return sin(beta) / sin(sin(beta));
 }
 ----
One more: real fun(real x) { return 0; } double bug() { return 0.0 / fun(7); } -- Simen
you can even change 0.0 to just 0, but more interesting question is: Is it already reported on bugzilla?
Aug 19 2019
parent Simen =?UTF-8?B?S2rDpnLDpXM=?= <simen.kjaras gmail.com> writes:
On Monday, 19 August 2019 at 12:01:33 UTC, Daniel Kozak wrote:
 question is: Is it already reported on bugzilla?
I was unable to find any similar issues, but it's there now: https://issues.dlang.org/show_bug.cgi?id=20143 -- Simen
Aug 19 2019
prev sibling parent reply Peter Jacobs <peterj mech.uq.edu.au> writes:
On Monday, 12 August 2019 at 04:01:28 UTC, Nicholas Wilson wrote:
 On Monday, 12 August 2019 at 01:45:24 UTC, Peter Jacobs wrote:
 We have a flow simulation code 
 (http://cfcfd.mechmining.uq.edu.au/eilmer/) that fails to 
 build optimized with DMD v2.087.0 or v2.087.1.  The cryptic 
 message at the end of the attempt to build is:
   tym = x14
   makefile:414: recipe for target 'e4shared' failed
   make: *** [e4shared] Illegal instruction (core dumped)
 and the compiler flags are:
   dmd -w -O -release -inline -boundscheck=off -dip1008 ...

 The build is successful if we omit the -O flag.

 In contrast, we have successful optimized builds for DMD 
 2.086.1 and LDC 1.17.0-beta1.

 I can provide more details but I was thinking that the "tym = 
 x14" might already mean something to someone familiar with the 
 insides of DMD.

 Best regards,
 Peter J.
That looks like https://github.com/dlang/dmd/blob/eda232a9f72b482c92cefb27a4321afc0aedbb5c/src/dmd/backe d/cgxmm.d#L816-L817 or https://github.com/dlang/dmd/blob/eda232a9f72b482c92cefb27a4321afc0aedbb5c/src/dmd/backe d/cgxmm.d#L716-L717 (or maybe https://github.com/dlang/dmd/blob/8623bbbebe35b9a320ba20e521a6c0ee51a780ac/src/dmd/b ckend/evalu8.d#L905 ) Can you run it in a debugger and provide a stack trace to confirm? tym = 0x14 corresponds to real (== 80 bit fp), which is best avoided if possible as it is very slow. Also, silly question, why would you use DMD, with optimisations, for cfd? surely your productivity is runtime bottlenecked?
Nicholas, Not a silly question. Yes, the run time is dominated by crunching numbers but most of the core of the code is nogc and we find that there is little run-time difference between DMD64 and LDC generated executables. It turns out that, for the complex-numbers plus optimized flavour of the code, we need to use the ldc compiler because of another (longer term) bug. I thought that I would report the recent change in compiler behaviour while it was fresh. For development runs, which is mostly what I do, I generally find the debug build and profiling provided by dmd to be convenient. The other members of our CFD group who do large parallel calculations mainly build with ldmd2. As for the 80-bit FP nature of the problem, I don't deliberately use 80-bit variables. Is there a way to easily identify where I force the use of 80-bit variables upon the compiler? I expect that operations with temporary results that stay within the floating-point registers will probably use 80-bit values but I cannot think of any places where I have wanted to retain 80-bits when storing data in my variables. Peter J.
Aug 12 2019
parent Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Monday, 12 August 2019 at 11:27:13 UTC, Peter Jacobs wrote:
 Nicholas,
 Not a silly question.  Yes, the run time is dominated by 
 crunching numbers but most of the core of the code is  nogc and 
 we find that there is little run-time difference between DMD64 
 and LDC generated executables.
That _is_ odd. usually LDC and GDC will run circles around DMD, especially with LTO/PGO. Doubly so for loop/math heavy stuff like cfd, where the code gets vectorised and unrolled very aggressively.
  It turns out that, for the complex-numbers plus optimized 
 flavour of the code, we need to use the ldc compiler because of 
 another (longer term) bug.  I thought that I would report the 
 recent change in compiler behaviour while it was fresh.  For 
 development runs, which is mostly what I do, I generally find 
 the debug build and profiling provided by dmd to be convenient.
Fair enough.
 The other members of our CFD group who do large parallel 
 calculations mainly build with ldmd2.
makes sense.
 As for the 80-bit FP nature of the problem, I don't 
 deliberately use 80-bit variables.  Is there a way to easily 
 identify where I force the use of 80-bit variables upon the 
 compiler?  I expect that operations with temporary results that 
 stay within the floating-point registers will probably use 
 80-bit values but I cannot think of any places where I have 
 wanted to retain 80-bits when storing data in my variables.

 Peter J.
They crop up in DMD's intrinsics for transcendentals which the standard library uses for non CTFE. I've tried to kill off in the past but without success. LDC defers to LLVM, which does things sensibly. There isn't a `-vreal` switch though its probably not too hard to implement.
Aug 12 2019
prev sibling parent reply Guillaume Piolat <first.last gmail.com> writes:
On Monday, 12 August 2019 at 01:45:24 UTC, Peter Jacobs wrote:
 We have a flow simulation code 
 (http://cfcfd.mechmining.uq.edu.au/eilmer/) that fails to build 
 optimized with DMD v2.087.0 or v2.087.1.  The cryptic message 
 at the end of the attempt to build is:
   tym = x14
   makefile:414: recipe for target 'e4shared' failed
   make: *** [e4shared] Illegal instruction (core dumped)
 and the compiler flags are:
   dmd -w -O -release -inline -boundscheck=off -dip1008 ...

 The build is successful if we omit the -O flag.

 In contrast, we have successful optimized builds for DMD 
 2.086.1 and LDC 1.17.0-beta1.

 I can provide more details but I was thinking that the "tym = 
 x14" might already mean something to someone familiar with the 
 insides of DMD.

 Best regards,
 Peter J.
Hello, This is a DMD backend bug. If you could spend the few hours (much less with habit) needed to reduce it to a small piece of code that still triggers the bug, it would really help the community. What I do is just delete code and get to that small reproducible example with manual dichotomy.
Aug 12 2019
parent Peter Jacobs <peterj mech.uq.edu.au> writes:
On Monday, 12 August 2019 at 10:34:25 UTC, Guillaume Piolat wrote:
 Hello,

 This is a DMD backend bug. If you could spend the few hours 
 (much less with habit) needed to reduce it to a small piece of 
 code that still triggers the bug, it would really help the 
 community.

 What I do is just delete code and get to that small 
 reproducible example with manual dichotomy.
Agreed that this would be a good thing to do, but I have to get up early for class in the morning. I will have to leave it for a week-end activity.
Aug 12 2019