Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verify NEON seg faults #22

Closed
syoyo opened this issue Mar 4, 2020 · 2 comments
Closed

verify NEON seg faults #22

syoyo opened this issue Mar 4, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@syoyo
Copy link
Contributor

syoyo commented Mar 4, 2020

brahch: verify-neon https://github.com/lighttransport/embree-aarch64/tree/verify-neon

Running NEON tests(reuses SSE2 tests) fails on aarch64 Linux.

...
                                                            collision_regression_test ... [PASSED]
                                                                cache_regression_test ... [PASSED]
                                                         parallel_for_regression_test ... [PASSED]
                                                      parallel_reduce_regression_test ... [PASSED]
                                                       parallel_prefix_sum_regression ... [PASSED]
                                                     parallel_for_for_regression_test ... [PASSED]
                                          parallel_for_for_prefix_sum_regression_test ... [PASSED]
                                                   parallel_partition_regression_test ... [PASSED]
                                                           RadixSortRegressionTestU32 ... [PASSED]
                                                           RadixSortRegressionTestU64 ... [PASSED]
                                                         parallel_set_regression_test ... [PASSED]
                                                         parallel_map_regression_test ... [PASSED]
                                                           parallel_filter_regression ... [PASSED]
                                                          barrier_sys_regression_test ... [PASSED]
                                                                NEON.multiple_devices ... [PASSED]
                                                                      NEON.types_test ... [PASSED]
                                                                      NEON.get_bounds ...++++++ [PASSED]
                                                               NEON.get_linear_bounds ...++++++ [PASSED]
                                                                   NEON.get_user_data ... [PASSED]
                                                                   NEON.buffer_stride ...++++++++ [PASSED]
                                                                     NEON.empty_scene ...++++++++++ [PASSED]
                                                                  NEON.empty_geometry ...++++++++++ [PASSED]
                                                                           NEON.build ...++++++++++ [PASSED]
                                                          NEON.overlapping_primitives ...++++++++++ [PASSED]
                                                             NEON.new_delete_geometry ................................................................................................................................+++++ [PASSED]
                                                                NEON.user_geometry_id ...+++++ [PASSED]
                                                         NEON.enable_disable_geometry ...+++++ [PASSED]
                                                                          NEON.update ...Segmentation fault (core dumped)

Configuration

CMAKE_BIN=cmake

rm -rf build

$CMAKE_BIN \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DEMBREE_ARM=On \
  -DEMBREE_ADDRESS_SANITIZER=Off \
  -DCMAKE_INSTALL_PREFIX=$HOME/local/embree3 \
  -DCMAKE_C_COMPILER=clang \
  -DCMAKE_CXX_COMPILER=clang++ \
  -DEMBREE_ISPC_SUPPORT=Off \
  -DEMBREE_TASKING_SYSTEM=Internal \
  -DEMBREE_TUTORIALS=Off \
  -DEMBREE_MAX_ISA=SSE2 \
  -DEMBREE_RAY_PACKETS=On \
  -Bbuild -H.
@syoyo syoyo added the bug Something isn't working label Mar 4, 2020
@syoyo
Copy link
Contributor Author

syoyo commented Mar 4, 2020

Report from ASAN + Debug build

==13361==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x007fe01e61b0 at pc 0x007fb380ad10 bp 0x007fe01e4570 sp 0x007fe01e4568
READ of size 16 at 0x007fe01e61b0 thread T0
    #0 0x7fb380ad0c in embree::operator-(embree::vfloat<4> const&, embree::vfloat<4> const&) /home/syoyo/work/embree-aarch64/kernels/bvh/../common/../../common/sys/../math/../simd/vfloat4_sse2.h:375:95
    #1 0x7fb380ad0c in unsigned long embree::sse2::intersectNodeK<4, 4>(embree::BVHN<4>::AlignedNode const*, unsigned long, embree::sse2::TravRayKStream<4, true> const&, embree::sse2::NearFarPrecalculations const&) /home/syoyo/work/embree-aarch64/kernels/bvh/node_intersector_packet_stream.h:186:38
    #2 0x7fb380ad0c in unsigned long embree::sse2::BVHNIntersectorStream<4, 4, 1, true, embree::sse2::Triangle4iIntersectorStreamPluecker<true> >::intersectAlignedNodePacket<4>(unsigned long, embree::sse2::TravRayKStream<4, true> const*, embree::BVHN<4>::AlignedNode const*, unsigned long, embree::sse2::NearFarPrecalculations const&) /home/syoyo/work/embree-aarch64/kernels/bvh/bvh_intersector_stream.h:132:32
    #3 0x7fb380ad0c in void embree::sse2::BVHNIntersectorStream<4, 4, 1, true, embree::sse2::Triangle4iIntersectorStreamPluecker<true> >::intersectCoherent<4>(embree::Accel::Intersectors*, embree::RayHitK<4>**, unsigned long, embree::IntersectContext*) /home/syoyo/work/embree-aarch64/kernels/bvh/bvh_intersector_stream.cpp:138:27
    #4 0x7fb380ad0c in embree::sse2::BVHNIntersectorStream<4, 4, 1, true, embree::sse2::Triangle4iIntersectorStreamPluecker<true> >::intersect(embree::Accel::Intersectors*, embree::RayHitN**, unsigned long, embree::IntersectContext*) /home/syoyo/work/embree-aarch64/kernels/bvh/bvh_intersector_stream.cpp:58:7
    #5 0x7fb2ab8d08 in embree::Accel::Intersectors::intersectN(RTCRayHitN**, unsigned long, embree::IntersectContext*) /home/syoyo/work/embree-aarch64/kernels/common/accel.h:345:9
    #6 0x7fb2ab8d08 in embree::AccelN::intersectN(embree::Accel::Intersectors*, RTCRayHitN**, unsigned long, embree::IntersectContext*) /home/syoyo/work/embree-aarch64/kernels/common/acceln.cpp:94:39
    #7 0x7fb38701e4 in embree::Accel::Intersectors::intersectN(RTCRayHitN**, unsigned long, embree::IntersectContext*) /home/syoyo/work/embree-aarch64/kernels/bvh/../common/accel.h:345:9
    #8 0x7fb38701e4 in void embree::Accel::Intersectors::intersectN<4>(embree::RayHitK<4>**, unsigned long, embree::IntersectContext*) /home/syoyo/work/embree-aarch64/kernels/bvh/../common/accel.h:370:9
    #9 0x7fb38701e4 in void embree::sse2::RayStreamFilter::filterSOP<4, true>(embree::Scene*, void const*, unsigned long, embree::IntersectContext*) /home/syoyo/work/embree-aarch64/kernels/bvh/bvh_intersector_stream_filters.cpp:495:31
    #10 0x7fb386598c in embree::sse2::RayStreamFilter::intersectSOP(embree::Scene*, RTCRayHitNp const*, unsigned long, embree::IntersectContext*) /home/syoyo/work/embree-aarch64/kernels/bvh/bvh_intersector_stream_filters.cpp
    #11 0x7fb2b8ece0 in rtcIntersectNp /home/syoyo/work/embree-aarch64/kernels/common/rtcore.cpp:728:5
    #12 0x4c9934 in embree::IntersectWithNpMode(embree::IntersectVariant, RTCSceneTy*, RTCIntersectContext*, RTCRayHit*, unsigned int) /home/syoyo/work/embree-aarch64/tutorials/verify/rtcore_helpers.h:756:29
    #13 0x4ca490 in embree::IntersectWithModeInternal(embree::IntersectMode, embree::IntersectVariant, RTCSceneTy*, RTCRayHit*, unsigned int, RTCIntersectContext*) /home/syoyo/work/embree-aarch64/tutorials/verify/rtcore_helpers.h:888:4
    #14 0x4cf6d4 in embree::IntersectWithMode(embree::IntersectMode, embree::IntersectVariant, RTCSceneTy*, RTCRayHit*, unsigned int, RTCIntersectContext*) /home/syoyo/work/embree-aarch64/tutorials/verify/rtcore_helpers.h:906:7
    #15 0x566b94 in embree::UpdateTest::run(embree::VerifyApplication*, bool) /home/syoyo/work/embree-aarch64/tutorials/verify/verify.cpp:1787:11
    #16 0x4d3858 in embree::VerifyApplication::Test::execute(embree::VerifyApplication*, bool) /home/syoyo/work/embree-aarch64/tutorials/verify/verify.cpp:433:11
    #17 0x51da04 in embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0::operator()(unsigned long) const /home/syoyo/work/embree-aarch64/tutorials/verify/verify.cpp:686:38
    #18 0x51da04 in void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)::operator()(embree::range<unsigned long> const&) const /home/syoyo/work/embree-aarch64/tutorials/verify/../../common/algorithms/parallel_for.h:40:11
    #19 0x51da04 in void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()::operator()() const /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:327:13
    #20 0x51da04 in embree::TaskScheduler::ClosureTaskFunction<void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()>::execute() /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:60:24
    #21 0x7fb38bfc1c in embree::TaskScheduler::Task::run_internal(embree::TaskScheduler::Thread&) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:66:20
    #22 0x7fb38c009c in embree::TaskScheduler::TaskQueue::execute_local_internal(embree::TaskScheduler::Thread&, embree::TaskScheduler::Task*) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:98:20
    #23 0x7fb38c3b30 in embree::TaskScheduler::wait() /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:342:26
    #24 0x51d908 in void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()::operator()() const /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:332:4
    #25 0x51d908 in embree::TaskScheduler::ClosureTaskFunction<void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()>::execute() /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:60:24
    #26 0x7fb38bfc1c in embree::TaskScheduler::Task::run_internal(embree::TaskScheduler::Thread&) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:66:20
    #27 0x7fb38c009c in embree::TaskScheduler::TaskQueue::execute_local_internal(embree::TaskScheduler::Thread&, embree::TaskScheduler::Task*) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:98:20
    #28 0x7fb38c3b30 in embree::TaskScheduler::wait() /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:342:26
    #29 0x51d908 in void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()::operator()() const /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:332:4
    #30 0x51d908 in embree::TaskScheduler::ClosureTaskFunction<void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()>::execute() /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:60:24
    #31 0x7fb38bfc1c in embree::TaskScheduler::Task::run_internal(embree::TaskScheduler::Thread&) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:66:20
    #32 0x7fb38c009c in embree::TaskScheduler::TaskQueue::execute_local_internal(embree::TaskScheduler::Thread&, embree::TaskScheduler::Task*) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:98:20
    #33 0x7fb38c3b30 in embree::TaskScheduler::wait() /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:342:26
    #34 0x51d908 in void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()::operator()() const /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:332:4
    #35 0x51d908 in embree::TaskScheduler::ClosureTaskFunction<void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()>::execute() /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:60:24
    #36 0x7fb38bfc1c in embree::TaskScheduler::Task::run_internal(embree::TaskScheduler::Thread&) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:66:20
    #37 0x7fb38c009c in embree::TaskScheduler::TaskQueue::execute_local_internal(embree::TaskScheduler::Thread&, embree::TaskScheduler::Task*) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:98:20
    #38 0x7fb38c3b30 in embree::TaskScheduler::wait() /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:342:26
    #39 0x51d908 in void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()::operator()() const /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:332:4
    #40 0x51d908 in embree::TaskScheduler::ClosureTaskFunction<void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()>::execute() /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:60:24
    #41 0x7fb38bfc1c in embree::TaskScheduler::Task::run_internal(embree::TaskScheduler::Thread&) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:66:20
    #42 0x7fb38c009c in embree::TaskScheduler::TaskQueue::execute_local_internal(embree::TaskScheduler::Thread&, embree::TaskScheduler::Task*) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:98:20
    #43 0x7fb38c3b30 in embree::TaskScheduler::wait() /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:342:26
    #44 0x51d908 in void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()::operator()() const /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:332:4
    #45 0x51d908 in embree::TaskScheduler::ClosureTaskFunction<void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()>::execute() /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:60:24
    #46 0x7fb38bfc1c in embree::TaskScheduler::Task::run_internal(embree::TaskScheduler::Thread&) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:66:20
    #47 0x7fb38c009c in embree::TaskScheduler::TaskQueue::execute_local_internal(embree::TaskScheduler::Thread&, embree::TaskScheduler::Task*) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:98:20
    #48 0x7fb38c3b30 in embree::TaskScheduler::wait() /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:342:26
    #49 0x51d908 in void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()::operator()() const /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:332:4
    #50 0x51d908 in embree::TaskScheduler::ClosureTaskFunction<void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()>::execute() /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:60:24
    #51 0x7fb38bfc1c in embree::TaskScheduler::Task::run_internal(embree::TaskScheduler::Thread&) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:66:20
    #52 0x7fb38c009c in embree::TaskScheduler::TaskQueue::execute_local_internal(embree::TaskScheduler::Thread&, embree::TaskScheduler::Task*) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:98:20
    #53 0x7fb38c3b30 in embree::TaskScheduler::wait() /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:342:26
    #54 0x51d908 in void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()::operator()() const /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:332:4
    #55 0x51d908 in embree::TaskScheduler::ClosureTaskFunction<void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()>::execute() /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:60:24
    #56 0x7fb38bfc1c in embree::TaskScheduler::Task::run_internal(embree::TaskScheduler::Thread&) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:66:20
    #57 0x7fb38c009c in embree::TaskScheduler::TaskQueue::execute_local_internal(embree::TaskScheduler::Thread&, embree::TaskScheduler::Task*) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:98:20
    #58 0x7fb38c3b30 in embree::TaskScheduler::wait() /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:342:26
    #59 0x51d908 in void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()::operator()() const /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:332:4
    #60 0x51d908 in embree::TaskScheduler::ClosureTaskFunction<void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()>::execute() /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:60:24
    #61 0x7fb38bfc1c in embree::TaskScheduler::Task::run_internal(embree::TaskScheduler::Thread&) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:66:20
    #62 0x7fb38c009c in embree::TaskScheduler::TaskQueue::execute_local_internal(embree::TaskScheduler::Thread&, embree::TaskScheduler::Task*) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:98:20
    #63 0x7fb38c3b30 in embree::TaskScheduler::wait() /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:342:26
    #64 0x51d908 in void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()::operator()() const /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:332:4
    #65 0x51d908 in embree::TaskScheduler::ClosureTaskFunction<void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()>::execute() /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:60:24
    #66 0x7fb38bfc1c in embree::TaskScheduler::Task::run_internal(embree::TaskScheduler::Thread&) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:66:20
    #67 0x7fb38c009c in embree::TaskScheduler::TaskQueue::execute_local_internal(embree::TaskScheduler::Thread&, embree::TaskScheduler::Task*) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:98:20
    #68 0x7fb38c3b30 in embree::TaskScheduler::wait() /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:342:26
    #69 0x51d908 in void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()::operator()() const /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:332:4
    #70 0x51d908 in embree::TaskScheduler::ClosureTaskFunction<void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()>::execute() /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:60:24
    #71 0x7fb38bfc1c in embree::TaskScheduler::Task::run_internal(embree::TaskScheduler::Thread&) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:66:20
    #72 0x7fb38c009c in embree::TaskScheduler::TaskQueue::execute_local_internal(embree::TaskScheduler::Thread&, embree::TaskScheduler::Task*) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:98:20
    #73 0x7fb38c0fac in embree::TaskScheduler::TaskQueue::execute_local(embree::TaskScheduler::Thread&, embree::TaskScheduler::Task*) /home/syoyo/work/embree-aarch64/common/tasking/taskschedulerinternal.cpp:115:12
    #74 0x51cf1c in void embree::TaskScheduler::spawn_root<void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()>(unsigned long const&, unsigned long, bool) /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:284:27
    #75 0x51cf1c in void embree::TaskScheduler::spawn<void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'()>(unsigned long, unsigned long const&) /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:311:50
    #76 0x51cf1c in void embree::TaskScheduler::spawn<unsigned long, void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&)::'lambda'(embree::range<unsigned long> const&)>(unsigned long, unsigned long, unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&) /home/syoyo/work/embree-aarch64/tutorials/verify/../../kernels/common/../../common/tasking/taskschedulerinternal.h:324:7
    #77 0x4dbf48 in void embree::parallel_for<unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0>(unsigned long, embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool)::$_0 const&) /home/syoyo/work/embree-aarch64/tutorials/verify/../../common/algorithms/parallel_for.h:38:7
    #78 0x4dbf48 in embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool) /home/syoyo/work/embree-aarch64/tutorials/verify/verify.cpp:685:7
    #79 0x4dc014 in embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool) /home/syoyo/work/embree-aarch64/tutorials/verify/verify.cpp:691:32
    #80 0x4dc014 in embree::VerifyApplication::TestGroup::execute(embree::VerifyApplication*, bool) /home/syoyo/work/embree-aarch64/tutorials/verify/verify.cpp:691:32
    #81 0x51b84c in embree::VerifyApplication::main(int, char**) /home/syoyo/work/embree-aarch64/tutorials/verify/verify.cpp:6048:12
    #82 0x51c4b4 in main /home/syoyo/work/embree-aarch64/tutorials/verify/verify.cpp:6072:14
++    #83 0x7fb25b96dc in __libc_start_main /build/glibc-4fr630/glibc-2.27/csu/../csu/libc-start.c:310
    #84 0x42e504 in _start (/mnt/data/work/embree-aarch64/build/verify+0x42e504)

Address 0x007fe01e61b0 is located in stack of thread T0 at offset 7216 in frame
    #0 0x7fb3807a6c in embree::sse2::BVHNIntersectorStream<4, 4, 1, true, embree::sse2::Triangle4iIntersectorStreamPluecker<true> >::intersect(embree::Accel::Intersectors*, embree::RayHitN**, unsigned long, embree::IntersectContext*) /home/syoyo/work/embree-aarch64/kernels/bvh/bvh_intersector_stream.cpp:50

  This frame has 10 object(s):
    [64, 5848) 'stack.i' (line 71)
    [6144, 7168) 'packets.i' (line 74) <== Memory access at offset 7216 overflows this variable
    [7296, 7328) 'maskK.i' (line 118)
    [7360, 7376) 'mask.i.i'
    [7392, 7440) 'args.i.i.i.i.i.i'
    [7472, 7488) 'mask.i.i.i.i.i.i'
    [7504, 7632) 'h.i.i.i.i.i'
    [7664, 7680) 'ref.tmp10.i.i.i'
    [7696, 7712) 'ref.tmp11.i.i.i'
    [7728, 7744) 'dist.i' (line 121)
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow /home/syoyo/work/embree-aarch64/kernels/bvh/../common/../../common/sys/../math/../simd/vfloat4_sse2.h:375:95 in embree::operator-(embree::vfloat<4> const&, embree::vfloat<4> const&)
Shadow bytes around the buggy address:
  0x001ffc03cbe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x001ffc03cbf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x001ffc03cc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x001ffc03cc10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x001ffc03cc20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x001ffc03cc30: f2 f2 f2 f2 f2 f2[f2]f2 f2 f2 f2 f2 f2 f2 f2 f2
  0x001ffc03cc40: f8 f8 f8 f8 f2 f2 f2 f2 f8 f8 f2 f2 f8 f8 f8 f8
  0x001ffc03cc50: f8 f8 f2 f2 f2 f2 f8 f8 f2 f2 f8 f8 f8 f8 f8 f8
  0x001ffc03cc60: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f2 f2 f2 f2 f8 f8
  0x001ffc03cc70: f2 f2 f8 f8 f2 f2 f8 f8 f3 f3 f3 f3 00 00 00 00
  0x001ffc03cc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
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
  Shadow gap:              cc
==13361==ABORTING

@syoyo
Copy link
Contributor Author

syoyo commented Mar 7, 2020

The reason was bsr and bsf returns invalid value(size_t version does not use 64bit version of corresponding __builtin_XXX), resulting out-of-bounds access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant