You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Vitaly Buka (Jira)" <ji...@apache.org> on 2021/11/06 07:10:00 UTC

[jira] [Commented] (ARROW-14622) ASAN reports initialization-order-fiasco

    [ https://issues.apache.org/jira/browse/ARROW-14622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17439613#comment-17439613 ] 

Vitaly Buka commented on ARROW-14622:
-------------------------------------


clang --version
clang version 14.0.0 (https://github.com/llvm/llvm-project.git 3c7960cba19ed926b8e86b4c619e81c0f7da4d15)

cmake -DCMAKE_C_COMPILER=<CLANG_BUILD_DIR>/bin/clang -DCMAKE_CXX_COMPILER=<CLANG_BUILD_DIR>/bin/clang++ -DARROW_COMPUTE=ON -DCMAKE_BUILD_TYPE=Debug -DARROW_BUILD_TESTS=ON -DARROW_USE_ASAN=ON -GNinja ..

ASAN_OPTIONS=check_initialization_order=1:strict_init_order=1 ninja unittest

38/38 Test  #5: arrow-public-api-test ...............***Failed    0.41 sec
Running arrow-public-api-test, redirecting output into arrow/cpp/debug/build/test-logs/arrow-public-api-test.txt (attempt 1/1)
=================================================================
==4121244==ERROR: AddressSanitizer: initialization-order-fiasco on address 0x7f2b4da96de0 at pc 0x7f2b4a0aa803 bp 0x7ffcd9bcc450 sp 0x7ffcd9bcc448
READ of size 8 at 0x7f2b4da96de0 thread T0
    #0 0x7f2b4a0aa802 in arrow::compute::JoinOptions::JoinOptions(arrow::compute::JoinOptions::NullHandlingBehavior, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) arrow/cpp/src/arrow/compute/api_scalar.cc:295:23
    #1 0x7f2b4b80a347 in arrow::compute::JoinOptions::Defaults() arrow/cpp/src/arrow/compute/api_scalar.h:126:42
    #2 0x7f2b4906653f in __cxx_global_var_init.140 arrow/cpp/src/arrow/compute/kernels/scalar_string.cc:4620:34
    #3 0x7f2b4907030f in _GLOBAL__sub_I_scalar_string.cc arrow/cpp/src/arrow/compute/kernels/scalar_string.cc
    #4 0x7f2b4e24a10d in call_init elf/dl-init.c:74:3
    #5 0x7f2b4e24a1ef in call_init elf/dl-init.c:37:6
    #6 0x7f2b4e24a1ef in _dl_init elf/dl-init.c:121:5
addr2line: DWARF error: section .debug_info is larger than its filesize! (0x6f5fb vs 0x63220)
    #0 0x7f2b4e23b089 in ?? ??:0

0x7f2b4da96de0 is located 32 bytes to the left of global variable 'arrow::compute::internal::(anonymous namespace)::kMatchSubstringOptionsType' defined in 'arrow/cpp/src/arrow/compute/api_scalar.cc:202:13' (0x7f2b4da96e00) of size 8
  registered at:
    #0 0x43aa96 in __asan_register_globals /usr/local/google/home/vitalybuka/src/llvm.git/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:360:3
    #1 0x7f2b4a19560e in asan.module_ctor api_scalar.cc
    #2 0x7f2b4e24a10d in call_init elf/dl-init.c:74:3

0x7f2b4da96de0 is located 0 bytes inside of global variable 'arrow::compute::internal::(anonymous namespace)::kJoinOptionsType' defined in 'arrow/cpp/src/arrow/compute/api_scalar.cc:199:13' (0x7f2b4da96de0) of size 8
  registered at:
    #0 0x43aa96 in __asan_register_globals /usr/local/google/home/vitalybuka/src/llvm.git/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:360:3
    #1 0x7f2b4a19560e in asan.module_ctor api_scalar.cc
    #2 0x7f2b4e24a10d in call_init elf/dl-init.c:74:3

SUMMARY: AddressSanitizer: initialization-order-fiasco arrow/cpp/src/arrow/compute/api_scalar.cc:295:23 in arrow::compute::JoinOptions::JoinOptions(arrow::compute::JoinOptions::NullHandlingBehavior, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
Shadow bytes around the buggy address:
  0x0fe5e9b4ad60: 00 f9 f9 f9 00 00 00 00 f9 f9 f9 f9 00 f9 f9 f9
  0x0fe5e9b4ad70: 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9 00 f9 f9 f9
  0x0fe5e9b4ad80: 00 f9 f9 f9 00 f9 f9 f9 f6 f6 f6 f6 f6 f6 f6 f6
  0x0fe5e9b4ad90: f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6
  0x0fe5e9b4ada0: f6 f6 f6 f6 00 00 00 00 00 00 00 00 f6 f6 f6 f6
=>0x0fe5e9b4adb0: f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6[f6]f6 f6 f6
  0x0fe5e9b4adc0: f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6
  0x0fe5e9b4add0: f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6
  0x0fe5e9b4ade0: f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6
  0x0fe5e9b4adf0: f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6 f6
  0x0fe5e9b4ae00: f6 f6 f6 f6 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
==4121244==ABORTING


0% tests passed, 38 tests failed out of 38

Label Time Summary:
arrow-tests      =  11.47 sec*proc (27 tests)
arrow_compute    =   4.73 sec*proc (11 tests)
unittest         =  16.21 sec*proc (38 tests)

Total Test time (real) =   4.27 sec

The following tests FAILED:
	  1 - arrow-array-test (Failed)
	  2 - arrow-buffer-test (Failed)
	  3 - arrow-extension-type-test (Failed)
	  4 - arrow-misc-test (Failed)
	  5 - arrow-public-api-test (Failed)
	  6 - arrow-scalar-test (Failed)
	  7 - arrow-type-test (Failed)
	  8 - arrow-table-test (Failed)
	  9 - arrow-tensor-test (Failed)
	 10 - arrow-sparse-tensor-test (Failed)
	 11 - arrow-stl-test (Failed)
	 12 - arrow-random-test (Failed)
	 13 - arrow-json-integration-test (Failed)
	 14 - arrow-concatenate-test (Failed)
	 15 - arrow-diff-test (Failed)
	 16 - arrow-c-bridge-test (Failed)
	 17 - arrow-io-buffered-test (Failed)
	 18 - arrow-io-compressed-test (Failed)
	 19 - arrow-io-file-test (Failed)
	 20 - arrow-io-memory-test (Failed)
	 21 - arrow-utility-test (Failed)
	 22 - arrow-threading-utility-test (Failed)
	 23 - arrow-compute-internals-test (Failed)
	 24 - arrow-compute-scalar-test (Failed)
	 25 - arrow-compute-vector-test (Failed)
	 26 - arrow-compute-aggregate-test (Failed)
	 27 - arrow-compute-kernel-utility-test (Failed)
	 28 - arrow-compute-expression-test (Failed)
	 29 - arrow-compute-plan-test (Failed)
	 30 - arrow-compute-hash-join-node-test (Failed)
	 31 - arrow-compute-union-node-test (Failed)
	 32 - arrow-compute-util-test (Failed)
	 33 - arrow-compute-ir-test (Failed)
	 34 - arrow-feather-test (Failed)
	 35 - arrow-ipc-json-simple-test (Failed)
	 36 - arrow-ipc-read-write-test (Failed)
	 37 - arrow-ipc-tensor-test (Failed)
	 38 - arrow-json-test (Failed)
Errors while running CTest


> ASAN reports initialization-order-fiasco
> ----------------------------------------
>
>                 Key: ARROW-14622
>                 URL: https://issues.apache.org/jira/browse/ARROW-14622
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>            Reporter: Vitaly Buka
>            Priority: Minor
>
> in arrow::compute::SortOptions::SortOptions(std::__u::vector<arrow::compute::SortKey, std::__u::allocator<arrow::compute::SortKey> >) arrow/compute/api_vector.cc:136:23
> in arrow::compute::SortOptions::Defaults() arrow/compute/api_vector.h:117:42
> in __cxx_global_var_init arrow/compute/kernels/vector_sort.cc:1622:34
> in _GLOBAL__sub_I_vector_sort.cc arrow/compute/kernels/vector_sort.cc



--
This message was sent by Atlassian Jira
(v8.3.4#803005)