niyue commented on PR #39098:
URL: https://github.com/apache/arrow/pull/39098#issuecomment-1855808716

   With my current macOS + Docker + Rosetta setup, I did some more testing 
today. I verified LLVM 16 + Ubuntu 23.10 + current MCJIT implementation (main 
branch) + ASAN/UBSAN, and the unit test will report a similar ASAN error like 
this (but it is for MCJIT instead of LLJIT):
   ```
   AddressSanitizer:DEADLYSIGNAL
   =================================================================
   ==26407==ERROR: AddressSanitizer: SEGV on unknown address 0x20006f564800 (pc 
0x55555597cb3a bp 0x5554ffffe0a0 sp 0x5554ffffd860 T0)
   ==26407==The signal is caused by a READ memory access.
       #0 0x55555597cb3a in memcpy 
(/build/cpp/debug/gandiva-internals-test+0x428b3a) (BuildId: 
ea73c2cf352befee9264bc2edfc408cc2b2f8a6a)
       #1 0x7fffdc795d39 in 
llvm::RuntimeDyldImpl::emitSection(llvm::object::ObjectFile const&, 
llvm::object::SectionRef const&, bool) 
(/usr/lib/llvm-16/lib/libLLVM-16.so.1+0x2aded39) (BuildId: 
08068dfc9a0c80774489feea5c7df0a25abf4ced)
       #2 0x7fffdc794e02 in 
llvm::RuntimeDyldImpl::findOrEmitSection(llvm::object::ObjectFile const&, 
llvm::object::SectionRef const&, bool, std::map<llvm::object::SectionRef, 
unsigned int, std::less<llvm::object::SectionRef>, 
std::allocator<std::pair<llvm::object::SectionRef const, unsigned int>>>&) 
(/usr/lib/llvm-16/lib/libLLVM-16.so.1+0x2adde02) (BuildId: 
08068dfc9a0c80774489feea5c7df0a25abf4ced)
       #3 0x7fffdc793580 in 
llvm::RuntimeDyldImpl::loadObjectImpl(llvm::object::ObjectFile const&) 
(/usr/lib/llvm-16/lib/libLLVM-16.so.1+0x2adc580) (BuildId: 
08068dfc9a0c80774489feea5c7df0a25abf4ced)
       #4 0x7fffdc7a6bb5 in 
llvm::RuntimeDyldELF::loadObject(llvm::object::ObjectFile const&) 
(/usr/lib/llvm-16/lib/libLLVM-16.so.1+0x2aefbb5) (BuildId: 
08068dfc9a0c80774489feea5c7df0a25abf4ced)
       #5 0x7fffdc797f57 in 
llvm::RuntimeDyld::loadObject(llvm::object::ObjectFile const&) 
(/usr/lib/llvm-16/lib/libLLVM-16.so.1+0x2ae0f57) (BuildId: 
08068dfc9a0c80774489feea5c7df0a25abf4ced)
       #6 0x7fffdc6b00ae in llvm::MCJIT::generateCodeForModule(llvm::Module*) 
(/usr/lib/llvm-16/lib/libLLVM-16.so.1+0x29f90ae) (BuildId: 
08068dfc9a0c80774489feea5c7df0a25abf4ced)
       #7 0x7fffdc6b0aec in llvm::MCJIT::finalizeObject() 
(/usr/lib/llvm-16/lib/libLLVM-16.so.1+0x29f9aec) (BuildId: 
08068dfc9a0c80774489feea5c7df0a25abf4ced)
       #8 0x7ffffeb2792e in gandiva::Engine::FinalizeModule() 
/arrow/cpp/src/gandiva/engine.cc:429:22
       #9 0x555555a4e27f in 
gandiva::TestEngine_TestAddUnoptimised_Test::TestBody() 
/arrow/cpp/src/gandiva/engine_llvm_test.cc:113:3
   ```
   
   So this issue is likely an ASAN + LLVM issue (for both MCJIT/LLJIT) under 
this setup (macOS + Docker + Rosetta), and it is not directly related with 
gandiva's codebase, and it is an issue for LLVM <= 16, and it is not an issue 
any more since LLVM 17.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to