idaholab / moose

Multiphysics Object Oriented Simulation Environment
https://www.mooseframework.org
GNU Lesser General Public License v2.1
1.71k stars 1.04k forks source link

malloc() error while running EBSDMeshGenerator #28349

Open GiudGiud opened 1 month ago

GiudGiud commented 1 month ago

Bug description

A seg fault is hit in the input attached below

How to reproduce

Use input attached

Impact

Cannot finish simulation

Discussed in https://github.com/idaholab/moose/discussions/28302

Originally posted by **ashishdhole** August 3, 2024 Hello, I am trying to run a grain growth simulation using EBSD file that I generated from DREAM3D. I am getting the following error ``` mpirun -np 4 pfubc-opt -i ebsd.i *** Warning, This code is deprecated and will be removed in future versions: Please update your main.C to adapt new main function in MOOSE framework, see'test/src/main.C in MOOSE as an example of moose::main()'. malloc(): invalid size (unsorted) malloc(): invalid size (unsorted) =================================================================================== = BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES = PID 182467 RUNNING AT ashish-Inspiron-14-5430 = EXIT CODE: 134 = CLEANING UP REMAINING PROCESSES = YOU CAN IGNORE THE BELOW CLEANUP MESSAGES =================================================================================== YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Aborted (signal 6) This typically refers to a problem with your application. Please see the FAQ page for debugging suggestions ``` Following are the files for the reference. [output_data.txt](https://github.com/user-attachments/files/16482520/output_data.txt) [valgrind.txt](https://github.com/user-attachments/files/16482706/valgrind.txt) my input file is ``` [Mesh] [file] type = EBSDMeshGenerator filename = output_data.txt #pre_refine = 2 [] [] [GlobalParams] op_num = 15 var_name_base = gr [] [UserObjects] [ebsd_reader] type = EBSDReader [] [ebsd] type = PolycrystalEBSD coloring_algorithm = jp ebsd_reader = ebsd_reader enable_var_coloring = true [] [grain_tracker] type = GrainTracker flood_entity_type = ELEMENTAL compute_halo_maps = true # For displaying HALO fields polycrystal_ic_uo = ebsd compute_var_to_feature_map = true [] [] [ICs] [PolycrystalICs] [PolycrystalColoringIC] polycrystal_ic_uo = ebsd [] [] [] [Variables] [PolycrystalVariables] [] [] [AuxVariables] [bnds] [] [unique_grains_ic] order = CONSTANT family = MONOMIAL [] [unique_grains] order = CONSTANT family = MONOMIAL [] [ghost_elements] order = CONSTANT family = MONOMIAL [] [halos] order = CONSTANT family = MONOMIAL [] [var_indices_ic] order = CONSTANT family = MONOMIAL [] [var_indices] order = CONSTANT family = MONOMIAL [] [ebsd_grains] family = MONOMIAL order = CONSTANT [] [] [Kernels] [PolycrystalKernel] [] [] [AuxKernels] [BndsCalc] type = BndsCalcAux variable = bnds execute_on = 'initial timestep_end' [] [ghost_elements] type = FeatureFloodCountAux variable = ghost_elements field_display = GHOSTED_ENTITIES execute_on = 'initial timestep_end' flood_counter = grain_tracker [] [halos] type = FeatureFloodCountAux variable = halos field_display = HALOS execute_on = 'initial timestep_end' flood_counter = grain_tracker [] [var_indices_ic] type = FeatureFloodCountAux variable = var_indices_ic execute_on = 'initial' flood_counter = ebsd field_display = VARIABLE_COLORING [] [unique_grains_ic] type = FeatureFloodCountAux variable = unique_grains_ic execute_on = 'initial' flood_counter = ebsd field_display = UNIQUE_REGION [] [var_indices] type = FeatureFloodCountAux variable = var_indices execute_on = 'initial timestep_end' flood_counter = grain_tracker field_display = VARIABLE_COLORING [] [unique_grains] type = FeatureFloodCountAux variable = unique_grains execute_on = 'initial timestep_end' flood_counter = grain_tracker field_display = UNIQUE_REGION [] [grain_aux] type = EBSDReaderPointDataAux variable = ebsd_grains ebsd_reader = ebsd_reader data_name = 'feature_id' execute_on = 'initial timestep_end' [] [] [Modules] [PhaseField] [EulerAngles2RGB] crystal_structure = cubic euler_angle_provider = ebsd_reader grain_tracker = grain_tracker [] [] [] [Materials] [Copper] # T = 500 # K type = GBEvolution T = 500 wGB = 0.6 # um GBmob0 = 2.5e-6 # m^4/(Js) from Schoenfelder 1997 Q = 0.23 # Migration energy in eV GBenergy = 0.708 # GB energy in J/m^2 molar_volume = 7.11e-6 # Molar volume in m^3/mol length_scale = 1.0e-6 time_scale = 1.0e-6 #ebsd_reader = ebsd_reader #grain_tracker = grain_tracker [] [GB_type] # The new developed Miso Bnds Aux Kernel type = ComputeGBMisorientationAngle ebsd_reader = ebsd_reader grain_tracker = grain_tracker output_properties = 'gb_type' outputs = exodus [] [] [Postprocessors] [dt] type = TimestepSize [] [n_elements] type = NumElements execute_on = 'initial timestep_end' [] [n_nodes] type = NumNodes execute_on = 'initial timestep_end' [] [DOFs] type = NumDOFs [] [] [Executioner] type = Transient scheme = bdf2 solve_type = PJFNK #Preconditioned JFNK (default) petsc_options_iname = '-pc_type' petsc_options_value = 'lu' #petsc_options_iname = '-pc_type -pc_hypre_type -snes_type' #petsc_options_value = 'hypre boomeramg vinewtonrsls' steady_state_detection = true steady_state_start_time = 0 steady_state_tolerance = 1e-8 l_abs_tol = 1.0e-3 nl_abs_tol = 1.0e-3 l_tol = 1.0e-3 l_max_its = 5 nl_max_its = 5 nl_rel_tol = 1.0e-3 start_time = 0.0 #num_steps = 200 end_time = 149.973 dtmin = 1e-20 #dt = 1 [TimeStepper] type = SolutionTimeAdaptiveDT dt = 1 [] #[Adaptivity] # initial_adaptivity = 2 # refine_fraction = 0.7 # coarsen_fraction = 0.1 # max_h_level = 2 #[] [] [Outputs] file_base = 'poly_out/fp_0p0_no_ani' exodus = true checkpoint = truee website perf_graph = true [] ``` can you tell me what is going on and why it is failing. when I use the example ebsd file (IN100_120x120.txt)on the moose website the simulation works perfectly fine. Thank you
GiudGiud commented 1 month ago

OP reported back and the numbering from 1 of the grain ids in the file is the problem. We should catch that problem to resolve this