LLNL / conduit

Simplified Data Exchange for HPC Simulations
https://software.llnl.gov/conduit/
Other
212 stars 65 forks source link

flatten test occasional testing failure culprit #1303

Closed cyrush closed 3 months ago

cyrush commented 3 months ago

asan detection + more info below.

center gen is accessing beyond the end of the vertex array. (attempt at index 36, where the size of the coordset is 36)

-- Testing basic_polyhedra --

coordsets: 
  coords: 
    type: "explicit"
    values: 
      x: [-10.0, -3.33333333333333, 3.33333333333333, 10.0, -10.0, -3.33333333333333, 3.33333333333333, 10.0, -10.0, -3.33333333333333, 3.33333333333333, 10.0, -10.0, -3.33333333333333, 3.33333333333333, 10.0, -10.0, -3.33333333333333, 3.33333333333333, 10.0, -10.0, -3.33333333333333, 3.33333333333333, 10.0, -10.0, -3.33333333333333, 3.33333333333333, 10.0, -10.0, -3.33333333333333, 3.33333333333333, 10.0, -10.0, -3.33333333333333, 3.33333333333333, 10.0]
      y: [-10.0, -10.0, -10.0, -10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 10.0, 10.0, 10.0, -10.0, -10.0, -10.0, -10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 10.0, 10.0, 10.0, -10.0, -10.0, -10.0, -10.0, 0.0, 0.0, 0.0, 0.0, 10.0, 10.0, 10.0, 10.0]
      z: [-10.0, -10.0, -10.0, -10.0, -10.0, -10.0, -10.0, -10.0, -10.0, -10.0, -10.0, -10.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0]
topologies: 
  mesh: 
    type: "unstructured"
    coordset: "coords"
    elements: 
      shape: "polyhedral"
      connectivity: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 10, 11, 12, 13, 14, 8, 15, 16, 3, 17, 18, 19, 20, 21, 9, 22, 23, 17, 24, 25, 14, 26, 27, 22, 28, 5, 29, 30, 31, 32, 33, 10, 34, 35, 36, 30, 37, 15, 38, 39, 40, 35, 41, 20, 31, 42, 43, 44, 45, 24, 36, 46, 47, 42, 48, 28, 40, 49, 50, 46, 51]
      sizes: [6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6]
      offsets: [0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66]
    subelements: 
      connectivity: [0, 4, 5, 1, 0, 1, 13, 12, 1, 5, 17, 13, 5, 4, 16, 17, 4, 0, 12, 16, 12, 13, 17, 16, 1, 5, 6, 2, 1, 2, 14, 13, 2, 6, 18, 14, 6, 5, 17, 18, 13, 14, 18, 17, 2, 6, 7, 3, 2, 3, 15, 14, 3, 7, 19, 15, 7, 6, 18, 19, 14, 15, 19, 18, 4, 8, 9, 5, 5, 9, 21, 17, 9, 8, 20, 21, 8, 4, 16, 20, 16, 17, 21, 20, 5, 9, 10, 6, 6, 10, 22, 18, 10, 9, 21, 22, 17, 18, 22, 21, 6, 10, 11, 7, 7, 11, 23, 19, 11, 10, 22, 23, 18, 19, 23, 22, 12, 13, 25, 24, 13, 17, 29, 25, 17, 16, 28, 29, 16, 12, 24, 28, 24, 25, 29, 28, 13, 14, 26, 25, 14, 18, 30, 26, 18, 17, 29, 30, 25, 26, 30, 29, 14, 15, 27, 26, 15, 19, 31, 27, 19, 18, 30, 31, 26, 27, 31, 30, 17, 21, 33, 29, 21, 20, 32, 33, 20, 16, 28, 32, 28, 29, 33, 32, 18, 22, 34, 30, 22, 21, 33, 34, 29, 30, 34, 33, 19, 23, 35, 31, 23, 22, 34, 35, 30, 31, 35, 34]
      sizes: [4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]
      shape: "polygonal"
      offsets: [0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204]
fields: 
  field: 
    association: "element"
    topology: "mesh"
    volume_dependent: "false"
    values: [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0]

idx 36
vs array size 36
=================================================================
==24565==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xffff84212460 at pc 0xffff8a5170c4 bp 0xffffe49d15c0 sp 0xffffe49d15b8
READ of size 8 at 0xffff84212460 thread T0
    #0 0xffff8a5170c0 in void conduit::blueprint::mesh::utils::generate_element_centers_impl<double, float>(conduit::Node const&, long, conduit::DataArray<double> const*, conduit::DataArray<float>*, long)::'lambda'(conduit::blueprint::mesh::utils::topology::entity const&)::operator()(conduit::blueprint::mesh::utils::topology::entity const&) const //conduit-v0.9.1/src/libs/blueprint/conduit_blueprint_mesh_flatten.cpp:309:48
    #1 0xffff8a5130e8 in void conduit::blueprint::mesh::utils::topology::impl::traverse_polyhedral_elements<void conduit::blueprint::mesh::utils::generate_element_centers_impl<double, float>(conduit::Node const&, long, conduit::DataArray<double> const*, conduit::DataArray<float>*, long)::'lambda'(conduit::blueprint::mesh::utils::topology::entity const&)&>(double&&, conduit::Node const&, conduit::Node const&, long&) //conduit-v0.9.1/src/libs/blueprint/conduit_blueprint_mesh_utils_iterate_elements.hpp:379:9
    #2 0xffff8a5111a4 in void conduit::blueprint::mesh::utils::topology::iterate_elements<void conduit::blueprint::mesh::utils::generate_element_centers_impl<double, float>(conduit::Node const&, long, conduit::DataArray<double> const*, conduit::DataArray<float>*, long)::'lambda'(conduit::blueprint::mesh::utils::topology::entity const&)>(conduit::Node const&, double&&) //conduit-v0.9.1/src/libs/blueprint/conduit_blueprint_mesh_utils_iterate_elements.hpp:599:13
    #3 0xffff8a4ac360 in void conduit::blueprint::mesh::utils::generate_element_centers_impl<double, float>(conduit::Node const&, long, conduit::DataArray<double> const*, conduit::DataArray<float>*, long) //conduit-v0.9.1/src/libs/blueprint/conduit_blueprint_mesh_flatten.cpp:295:5
    #4 0xffff8a4a5be8 in conduit::blueprint::mesh::MeshFlattener::generate_element_centers(conduit::Node const&, conduit::Node const&, conduit::Node&, long) const //conduit-v0.9.1/src/libs/blueprint/conduit_blueprint_mesh_flatten.cpp:979:13
    #5 0xffff8a4afeb0 in conduit::blueprint::mesh::MeshFlattener::flatten_single_domain(conduit::Node const&, conduit::Node&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, long, long, long) const //conduit-v0.9.1/src/libs/blueprint/conduit_blueprint_mesh_flatten.cpp:1102:9
    #6 0xffff8a4b72cc in conduit::blueprint::mesh::MeshFlattener::flatten_many_domains(conduit::Node const&, conduit::Node&) const //conduit-v0.9.1/src/libs/blueprint/conduit_blueprint_mesh_flatten.cpp:1272:9
    #7 0xffff8a49a0a0 in conduit::blueprint::mesh::MeshFlattener::execute(conduit::Node const&, conduit::Node&) const //conduit-v0.9.1/src/libs/blueprint/conduit_blueprint_mesh_flatten.cpp:506:9
    #8 0xffff89e236e4 in conduit::blueprint::mesh::flatten(conduit::Node const&, conduit::Node const&, conduit::Node&) //conduit-v0.9.1/src/libs/blueprint/conduit_blueprint_mesh.cpp:7641:16
    #9 0xaaaadaf96350 in test_mesh_single_domain(conduit::Node const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) //conduit-v0.9.1/src/tests/blueprint/t_blueprint_mesh_flatten.cpp:73:5
    #10 0xaaaadaf94c54 in blueprint_mesh_flatten_basic_Test::TestBody() //conduit-v0.9.1/src/tests/blueprint/t_blueprint_mesh_flatten.cpp:271:13
    #11 0xffff8a8d8770 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:2621:10
    #12 0xffff8a884594 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:2657:14
    #13 0xffff8a82e6bc in testing::Test::Run() //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:2696:5
    #14 0xffff8a8303cc in testing::TestInfo::Run() //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:2845:11
    #15 0xffff8a831bb4 in testing::TestSuite::Run() //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:3023:30
    #16 0xffff8a8535ac in testing::internal::UnitTestImpl::RunAllTests() //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:5926:44
    #17 0xffff8a8eb2a8 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:2621:10
    #18 0xffff8a88b4e4 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:2657:14
    #19 0xffff8a8529bc in testing::UnitTest::Run() //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:5492:10
    #20 0xffff8a961020 in RUN_ALL_TESTS() //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/include/gtest/gtest.h:2314:73
    #21 0xffff8a960f9c in main //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest_main.cc:63:10
    #22 0xffff883f73f8  (/lib/aarch64-linux-gnu/libc.so.6+0x273f8) (BuildId: aa6e122fa39ae02d412afb49d75e33281fcd2805)
    #23 0xffff883f74c8 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x274c8) (BuildId: aa6e122fa39ae02d412afb49d75e33281fcd2805)
    #24 0xaaaadaee0aac in _start (/build/conduit-v0.9.1/tests/blueprint/t_blueprint_mesh_flatten+0x40aac) (BuildId: efc367b19da9ddd07e4b8f240cc4a479182cc64c)

0xffff84212460 is located 0 bytes to the right of 288-byte region [0xffff84212340,0xffff84212460)
allocated by thread T0 here:
    #0 0xaaaadaf57e3c in __interceptor_calloc (/build/conduit-v0.9.1/tests/blueprint/t_blueprint_mesh_flatten+0xb7e3c) (BuildId: efc367b19da9ddd07e4b8f240cc4a479182cc64c)
    #1 0xffff897a1e34 in conduit::utils::default_alloc_handler(unsigned long, unsigned long) //conduit-v0.9.1/src/libs/conduit/conduit_utils.cpp:84:10
    #2 0xffff897aee40 in conduit::utils::detail::AllocManager::allocate(unsigned long, unsigned long, long) //conduit-v0.9.1/src/libs/conduit/conduit_utils.cpp:198:22
    #3 0xffff897a1f6c in conduit::utils::conduit_allocate(unsigned long, unsigned long, long) //conduit-v0.9.1/src/libs/conduit/conduit_utils.cpp:252:45
    #4 0xffff896b4cbc in conduit::Node::allocate(long) //conduit-v0.9.1/src/libs/conduit/conduit_node.cpp:17283:14
    #5 0xffff8974c714 in conduit::Node::allocate(conduit::DataType const&) //conduit-v0.9.1/src/libs/conduit/conduit_node.cpp:17276:5
    #6 0xffff896b95cc in conduit::Node::init(conduit::DataType const&) //conduit-v0.9.1/src/libs/conduit/conduit_node.cpp:17265:9
    #7 0xffff896b989c in conduit::Node::set_dtype(conduit::DataType const&) //conduit-v0.9.1/src/libs/conduit/conduit_node.cpp:529:5
    #8 0xffff896b39f8 in conduit::Node::set(conduit::DataType const&) //conduit-v0.9.1/src/libs/conduit/conduit_node.cpp:536:5
    #9 0xffff8a350348 in conduit::blueprint::mesh::examples::braid_init_explicit_coordset(long, long, long, conduit::Node&) //conduit-v0.9.1/src/libs/blueprint/conduit_blueprint_mesh_examples.cpp:860:21
    #10 0xffff8a36b830 in conduit::blueprint::mesh::examples::braid_hexs(long, long, long, conduit::Node&) //conduit-v0.9.1/src/libs/blueprint/conduit_blueprint_mesh_examples.cpp:2366:5
    #11 0xffff8a3810cc in conduit::blueprint::mesh::examples::braid(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, long, long, conduit::Node&) //conduit-v0.9.1/src/libs/blueprint/conduit_blueprint_mesh_examples.cpp:3684:9
    #12 0xffff8a37f888 in conduit::blueprint::mesh::examples::basic(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long, long, long, conduit::Node&) //conduit-v0.9.1/src/libs/blueprint/conduit_blueprint_mesh_examples.cpp:3250:5
    #13 0xaaaadaf94a88 in blueprint_mesh_flatten_basic_Test::TestBody() //conduit-v0.9.1/src/tests/blueprint/t_blueprint_mesh_flatten.cpp:269:13
    #14 0xffff8a8d8770 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:2621:10
    #15 0xffff8a884594 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:2657:14
    #16 0xffff8a82e6bc in testing::Test::Run() //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:2696:5
    #17 0xffff8a8303cc in testing::TestInfo::Run() //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:2845:11
    #18 0xffff8a831bb4 in testing::TestSuite::Run() //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:3023:30
    #19 0xffff8a8535ac in testing::internal::UnitTestImpl::RunAllTests() //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:5926:44
    #20 0xffff8a8eb2a8 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:2621:10
    #21 0xffff8a88b4e4 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:2657:14
    #22 0xffff8a8529bc in testing::UnitTest::Run() //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest.cc:5492:10
    #23 0xffff8a961020 in RUN_ALL_TESTS() //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/include/gtest/gtest.h:2314:73
    #24 0xffff8a960f9c in main //conduit-v0.9.1/src/blt/thirdparty_builtin/googletest/googletest/src/gtest_main.cc:63:10
    #25 0xffff883f73f8  (/lib/aarch64-linux-gnu/libc.so.6+0x273f8) (BuildId: aa6e122fa39ae02d412afb49d75e33281fcd2805)
    #26 0xffff883f74c8 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x274c8) (BuildId: aa6e122fa39ae02d412afb49d75e33281fcd2805)
    #27 0xaaaadaee0aac in _start (/build/conduit-v0.9.1/tests/blueprint/t_blueprint_mesh_flatten+0x40aac) (BuildId: efc367b19da9ddd07e4b8f240cc4a479182cc64c)

SUMMARY: AddressSanitizer: heap-buffer-overflow //conduit-v0.9.1/src/libs/blueprint/conduit_blueprint_mesh_flatten.cpp:309:48 in void conduit::blueprint::mesh::utils::generate_element_centers_impl<double, float>(conduit::Node const&, long, conduit::DataArray<double> const*, conduit::DataArray<float>*, long)::'lambda'(conduit::blueprint::mesh::utils::topology::entity const&)::operator()(conduit::blueprint::mesh::utils::topology::entity const&) const
Shadow bytes around the buggy address:
  0x200ff0842430: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x200ff0842440: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x200ff0842450: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa
  0x200ff0842460: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x200ff0842470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x200ff0842480: 00 00 00 00 00 00 00 00 00 00 00 00[fa]fa fa fa
  0x200ff0842490: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x200ff08424a0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x200ff08424b0: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa
  0x200ff08424c0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x200ff08424d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==24565==ABORTING
cyrush commented 3 months ago

brad already fixed for for 0.9.2 - I was testing 0.9.1