Repository: pytorch
Issue: `torch.Tensor.fliplr`: Heap-buffer-overflow
Labels: oncall: quantization

### 🐛 Describe the bug

`torch.Tensor.fliplr` causes heap buffer overflow with specific input.

Test code:
```python
import torch

base = torch.randn(1,2)
self = torch.quantize_per_tensor(base, 0.1, 10, torch.quint4x2)
self.fliplr()
```

Error log:
```
==848990==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x609000000141 at pc 0x7f04efec218a bp 0x7ffc8b255650 sp 0x7ffc8b254e18
WRITE of size 1 at 0x609000000141 thread T0
    #0 0x7f04efec2189 in __asan_memcpy /tmp/llvm/utils/release/final/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3
    #1 0x7f04cc13fb2e in void at::native::AVX2::execute_op<at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2), (void*)0>(char* restrict*, long const*, long, long, at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2)&&) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/native/cpu/Loops.h:91:14
    #2 0x7f04cc13f85b in void at::native::AVX2::basic_loop<at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2)>(char* restrict*, long const*, long, long, at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2)&&) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/native/cpu/Loops.h:126:3
    #3 0x7f04cc13f465 in void at::native::AVX2::cpu_kernel<at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2)>(at::TensorIteratorBase&, at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2)&&, long)::'lambda'(char**, long const*, long)::operator()(char**, long const*, long) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/native/cpu/Loops.h:315:7
    #4 0x7f04cc13f266 in auto at::TensorIteratorBase::loop_2d_from_1d<void at::native::AVX2::cpu_kernel<at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2)>(at::TensorIteratorBase&, at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2)&&, long)::'lambda'(char**, long const*, long)>(at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2) const&)::'lambda'(char**, long const*, long, long)::operator()(char**, long const*, long, long) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/TensorIterator.h:407:13
    #5 0x7f04cc13e9ca in void c10::function_ref<void (char**, long const*, long, long)>::callback_fn<auto at::TensorIteratorBase::loop_2d_from_1d<void at::native::AVX2::cpu_kernel<at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2)>(at::TensorIteratorBase&, at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2)&&, long)::'lambda'(char**, long const*, long)>(at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2) const&)::'lambda'(char**, long const*, long, long)>(long, char**, long const*, long, long) /home/yonghyeon/pytorch/pytorch-asan/c10/util/FunctionRef.h:43:12
    #6 0x7f04b3e8c68b in c10::function_ref<void (char**, long const*, long, long)>::operator()(char**, long const*, long, long) const /home/yonghyeon/pytorch/pytorch-asan/c10/util/FunctionRef.h:64:12
    #7 0x7f04b3e83beb in at::internal::serial_for_each(c10::ArrayRef<long>, c10::ArrayRef<long>, char**, unsigned long, c10::function_ref<void (char**, long const*, long, long)>, at::Range) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/TensorIteratorInternal.h:52:7
    #8 0x7f04b3e68d84 in at::TensorIteratorBase::serial_for_each(c10::function_ref<void (char**, long const*, long, long)>, at::Range) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/TensorIterator.cpp:778:3
    #9 0x7f04b3e79113 in at::TensorIteratorBase::for_each(c10::function_ref<void (char**, long const*, long, long)>, long) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/TensorIterator.cpp:750:12
    #10 0x7f04cc13e3ab in void at::TensorIteratorBase::for_each<void at::native::AVX2::cpu_kernel<at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2)>(at::TensorIteratorBase&, at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2)&&, long)::'lambda'(char**, long const*, long), 0>(at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2), long) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/TensorIterator.h:422:5
    #11 0x7f04cc13e07c in void at::native::AVX2::cpu_kernel<at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2)>(at::TensorIteratorBase&, at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const::'lambda'(c10::quint4x2, c10::quint4x2)&&, long) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/native/cpu/Loops.h:312:8
    #12 0x7f04cc135748 in at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const::'lambda2'()::operator()() const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/native/cpu/IndexKernel.cpp:699:5
    #13 0x7f04cc132b2e in at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool)::$_10::operator()() const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/native/cpu/IndexKernel.cpp:699:5
    #14 0x7f04cc1319dd in at::native::(anonymous namespace)::flip_kernel(at::TensorIterator&, bool) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/native/cpu/IndexKernel.cpp:699:5
    #15 0x7f04b5ed44c3 in void at::native::DispatchStub<void (*)(at::TensorIterator&, bool), at::native::flip_stub>::operator()<at::TensorIterator&, bool>(c10::DeviceType, at::TensorIterator&, bool&&) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/native/DispatchStub.h:158:12
    #16 0x7f04b5ece2c1 in at::native::flip(at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/native/TensorTransformations.cpp:97:3
    #17 0x7f04bdb680f7 in at::(anonymous namespace)::(anonymous namespace)::wrapper_QuantizedCPU__flip(at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/RegisterQuantizedCPU.cpp:451:10
    #18 0x7f04bdb68c0a in c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&, c10::ArrayRef<long>), &(at::(anonymous namespace)::(anonymous namespace)::wrapper_QuantizedCPU__flip(at::Tensor const&, c10::ArrayRef<long>))>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, c10::ArrayRef<long> > >::operator()(at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/impl/WrapFunctionIntoFunctor.h:13:16
    #19 0x7f04bdb68c0a in c10::impl::wrap_kernel_functor_unboxed_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&, c10::ArrayRef<long>), &(at::(anonymous namespace)::(anonymous namespace)::wrapper_QuantizedCPU__flip(at::Tensor const&, c10::ArrayRef<long>))>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, c10::ArrayRef<long> > >, at::Tensor (at::Tensor const&, c10::ArrayRef<long>)>::call(c10::OperatorKernel*, c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:468:14
    #20 0x7f04b73e3240 in at::Tensor c10::callUnboxedKernelFunction<at::Tensor, at::Tensor const&, c10::ArrayRef<long> >(void*, c10::OperatorKernel*, c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>&&) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/KernelFunction_impl.h:50:12
    #21 0x7f04b73e2d7c in at::Tensor c10::KernelFunction::call<at::Tensor, at::Tensor const&, c10::ArrayRef<long> >(c10::OperatorHandle const&, c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/KernelFunction_impl.h:102:16
    #22 0x7f04b73e2d7c in at::Tensor c10::Dispatcher::redispatch<at::Tensor, at::Tensor const&, c10::ArrayRef<long> >(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, c10::ArrayRef<long>)> const&, c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/dispatch/Dispatcher.h:712:26
    #23 0x7f04b95e5579 in c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, c10::ArrayRef<long>)>::redispatch(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/dispatch/Dispatcher.h:532:41
    #24 0x7f04b95e5579 in at::_ops::flip::redispatch(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/Operators_3.cpp:5699:15
    #25 0x7f04c38ab81a in at::redispatch::flip(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/RedispatchFunctions.h:7597:16
    #26 0x7f04c35a7c27 in torch::autograd::VariableType::(anonymous namespace)::flip(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>)::$_90::operator()() const /home/yonghyeon/pytorch/pytorch-asan/torch/csrc/autograd/generated/VariableType_3.cpp:9371:12
    #27 0x7f04c35a68d5 in torch::autograd::VariableType::(anonymous namespace)::flip(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/torch/csrc/autograd/generated/VariableType_3.cpp:9369:15
    #28 0x7f04c35a8739 in c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>), &(torch::autograd::VariableType::(anonymous namespace)::flip(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>))>, at::Tensor, c10::guts::typelist::typelist<c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long> > >::operator()(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/impl/WrapFunctionIntoFunctor.h:13:16
    #29 0x7f04c35a8739 in c10::impl::wrap_kernel_functor_unboxed_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>), &(torch::autograd::VariableType::(anonymous namespace)::flip(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>))>, at::Tensor, c10::guts::typelist::typelist<c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long> > >, at::Tensor (c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>)>::call(c10::OperatorKernel*, c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:485:14
    #30 0x7f04b73e3240 in at::Tensor c10::callUnboxedKernelFunction<at::Tensor, at::Tensor const&, c10::ArrayRef<long> >(void*, c10::OperatorKernel*, c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>&&) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/KernelFunction_impl.h:50:12
    #31 0x7f04b92f6a15 in at::Tensor c10::KernelFunction::call<at::Tensor, at::Tensor const&, c10::ArrayRef<long> >(c10::OperatorHandle const&, c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/KernelFunction_impl.h:102:16
    #32 0x7f04b92f6a15 in at::Tensor c10::Dispatcher::call<at::Tensor, at::Tensor const&, c10::ArrayRef<long> >(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, c10::ArrayRef<long>)> const&, at::Tensor const&, c10::ArrayRef<long>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/dispatch/Dispatcher.h:694:28
    #33 0x7f04b92f6a15 in c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, c10::ArrayRef<long>)>::call(at::Tensor const&, c10::ArrayRef<long>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/dispatch/Dispatcher.h:527:41
    #34 0x7f04b92f6a15 in at::_ops::flip::call(at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/Operators_3.cpp:5692:15
    #35 0x7f04b5880ac7 in at::Tensor::flip(c10::ArrayRef<long>) const /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/core/TensorBody.h:3751:12
    #36 0x7f04b5ed266c in at::native::fliplr(at::Tensor const&) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/native/TensorTransformations.cpp:161:15
    #37 0x7f04bc011e32 in at::(anonymous namespace)::(anonymous namespace)::wrapper_CompositeImplicitAutograd__fliplr(at::Tensor const&) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/RegisterCompositeImplicitAutograd.cpp:3656:10
    #38 0x7f04bc012675 in c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&), &(at::(anonymous namespace)::(anonymous namespace)::wrapper_CompositeImplicitAutograd__fliplr(at::Tensor const&))>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&> >::operator()(at::Tensor const&) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/impl/WrapFunctionIntoFunctor.h:13:16
    #39 0x7f04bc012675 in c10::impl::wrap_kernel_functor_unboxed_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&), &(at::(anonymous namespace)::(anonymous namespace)::wrapper_CompositeImplicitAutograd__fliplr(at::Tensor const&))>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&> >, at::Tensor (at::Tensor const&)>::call(c10::OperatorKernel*, c10::DispatchKeySet, at::Tensor const&) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:468:14
    #40 0x7f04b73d8e95 in at::Tensor c10::callUnboxedKernelFunction<at::Tensor, at::Tensor const&>(void*, c10::OperatorKernel*, c10::DispatchKeySet, at::Tensor const&) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/KernelFunction_impl.h:50:12
    #41 0x7f04b7c43144 in at::Tensor c10::KernelFunction::call<at::Tensor, at::Tensor const&>(c10::OperatorHandle const&, c10::DispatchKeySet, at::Tensor const&) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/KernelFunction_impl.h:102:16
    #42 0x7f04b7c43144 in at::Tensor c10::Dispatcher::call<at::Tensor, at::Tensor const&>(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&)> const&, at::Tensor const&) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/dispatch/Dispatcher.h:694:28
    #43 0x7f04b7c43144 in c10::TypedOperatorHandle<at::Tensor (at::Tensor const&)>::call(at::Tensor const&) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/dispatch/Dispatcher.h:527:41
    #44 0x7f04b7c43144 in at::_ops::fliplr::call(at::Tensor const&) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/Operators_1.cpp:5672:15
    #45 0x7f04df2d18e2 in at::Tensor::fliplr() const /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/core/TensorBody.h:3756:12
    #46 0x7f04df22ced8 in torch::autograd::THPVariable_fliplr(_object*, _object*)::$_282::operator()(at::Tensor const&) const /home/yonghyeon/pytorch/pytorch-asan/torch/csrc/autograd/generated/python_variable_methods.cpp:7386:17
    #47 0x7f04df0ee22c in torch::autograd::THPVariable_fliplr(_object*, _object*) /home/yonghyeon/pytorch/pytorch-asan/torch/csrc/autograd/generated/python_variable_methods.cpp:7388:15
    #48 0x55962f in method_vectorcall_NOARGS /usr/local/src/conda/python-3.12.0/Objects/descrobject.c:454:24
    #49 0x543140 in _PyObject_VectorcallTstate /usr/local/src/conda/python-3.12.0/Include/internal/pycore_call.h:92:11
    #50 0x543140 in PyObject_Vectorcall /usr/local/src/conda/python-3.12.0/Objects/call.c:325:12
    #51 0x5295b9 in _PyEval_EvalFrameDefault /croot/python-split_1696267002197/work/build-static/Python/bytecodes.c:2711:19
    #52 0x5f450d in PyEval_EvalCode /usr/local/src/conda/python-3.12.0/Python/ceval.c:570:21
    #53 0x6198b6 in run_eval_code_obj /usr/local/src/conda/python-3.12.0/Python/pythonrun.c:1693
    #54 0x614d36 in run_mod /usr/local/src/conda/python-3.12.0/Python/pythonrun.c:1714
    #55 0x62a931 in pyrun_file /usr/local/src/conda/python-3.12.0/Python/pythonrun.c:1614
    #56 0x62a28f in _PyRun_SimpleFileObject.localalias /usr/local/src/conda/python-3.12.0/Python/pythonrun.c:433
    #57 0x62a082 in _PyRun_AnyFileObject.localalias /usr/local/src/conda/python-3.12.0/Python/pythonrun.c:78
    #58 0x624273 in pymain_run_file_obj /usr/local/src/conda/python-3.12.0/Modules/main.c:360
    #59 0x624273 in pymain_run_file /usr/local/src/conda/python-3.12.0/Modules/main.c:379
    #60 0x624273 in pymain_run_python /usr/local/src/conda/python-3.12.0/Modules/main.c:610
    #61 0x624273 in Py_RunMain.localalias /usr/local/src/conda/python-3.12.0/Modules/main.c:689
    #62 0x5dfbb8 in Py_BytesMain /usr/local/src/conda/python-3.12.0/Modules/main.c:743:12
error: failed to decompress '.debug_aranges', zlib is not available
error: failed to decompress '.debug_info', zlib is not available
error: failed to decompress '.debug_abbrev', zlib is not available
error: failed to decompress '.debug_line', zlib is not available
error: failed to decompress '.debug_str', zlib is not available
error: failed to decompress '.debug_line_str', zlib is not available
error: failed to decompress '.debug_loclists', zlib is not available
error: failed to decompress '.debug_rnglists', zlib is not available
    #63 0x7f04efb1ad8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
    #64 0x7f04efb1ae3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
    #65 0x5df9ed in _start (/home/yonghyeon/anaconda3/envs/torch-asan/bin/python3.12+0x5df9ed)

0x609000000141 is located 0 bytes to the right of 1-byte region [0x609000000140,0x609000000141)
allocated by thread T0 here:
    #0 0x7f04efec3807 in posix_memalign /tmp/llvm/utils/release/final/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:226:3
    #1 0x7f04b0ba8375 in c10::alloc_cpu(unsigned long) /home/yonghyeon/pytorch/pytorch-asan/c10/core/impl/alloc_cpu.cpp:116:13
    #2 0x7f04b0aaf4ea in c10::DefaultCPUAllocator::allocate(unsigned long) const /home/yonghyeon/pytorch/pytorch-asan/c10/core/CPUAllocator.cpp:23:14
    #3 0x7f04bdf6638c in at::new_qtensor(c10::ArrayRef<long>, c10::TensorOptions const&, c10::intrusive_ptr<at::Quantizer, c10::detail::intrusive_target_default_null_type<at::Quantizer> >) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/quantized/Quantizer.cpp:152:18
    #4 0x7f04b67ae99d in at::native::empty_affine_quantized(c10::ArrayRef<long>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/native/quantized/TensorFactories.cpp:35:10
    #5 0x7f04bdb2e5ec in at::(anonymous namespace)::(anonymous namespace)::wrapper_QuantizedCPU___empty_affine_quantized(c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/RegisterQuantizedCPU.cpp:227:10
    #6 0x7f04bdb30570 in c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>), &(at::(anonymous namespace)::(anonymous namespace)::wrapper_QuantizedCPU___empty_affine_quantized(c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>))>, at::Tensor, c10::guts::typelist::typelist<c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat> > >::operator()(c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/impl/WrapFunctionIntoFunctor.h:13:16
    #7 0x7f04bdb30570 in c10::impl::wrap_kernel_functor_unboxed_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>), &(at::(anonymous namespace)::(anonymous namespace)::wrapper_QuantizedCPU___empty_affine_quantized(c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>))>, at::Tensor, c10::guts::typelist::typelist<c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat> > >, at::Tensor (c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>)>::call(c10::OperatorKernel*, c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:468:14
    #8 0x7f04b9713d5b in at::Tensor c10::callUnboxedKernelFunction<at::Tensor, c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat> >(void*, c10::OperatorKernel*, c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>&&, std::optional<c10::ScalarType>&&, std::optional<c10::Layout>&&, std::optional<c10::Device>&&, std::optional<bool>&&, double&&, long&&, std::optional<c10::MemoryFormat>&&) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/KernelFunction_impl.h:50:12
    #9 0x7f04b97120f8 in at::Tensor c10::KernelFunction::call<at::Tensor, c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat> >(c10::OperatorHandle const&, c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/KernelFunction_impl.h:90:16
    #10 0x7f04b97120f8 in at::Tensor c10::Dispatcher::redispatch<at::Tensor, c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat> >(c10::TypedOperatorHandle<at::Tensor (c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>)> const&, c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/dispatch/Dispatcher.h:712:26
    #11 0x7f04b959b9eb in c10::TypedOperatorHandle<at::Tensor (c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>)>::redispatch(c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/dispatch/Dispatcher.h:532:41
    #12 0x7f04b959b9eb in at::_ops::_empty_affine_quantized::redispatch(c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/Operators_3.cpp:2924:15
    #13 0x7f04ba1ec573 in at::(anonymous namespace)::_empty_affine_quantized(c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/RegisterBackendSelect.cpp:199:10
    #14 0x7f04ba1ee510 in c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>), &(at::(anonymous namespace)::_empty_affine_quantized(c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>))>, at::Tensor, c10::guts::typelist::typelist<c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat> > >::operator()(c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/impl/WrapFunctionIntoFunctor.h:13:16
    #15 0x7f04ba1ee510 in c10::impl::wrap_kernel_functor_unboxed_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>), &(at::(anonymous namespace)::_empty_affine_quantized(c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>))>, at::Tensor, c10::guts::typelist::typelist<c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat> > >, at::Tensor (c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>)>::call(c10::OperatorKernel*, c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:468:14
    #16 0x7f04b9713d5b in at::Tensor c10::callUnboxedKernelFunction<at::Tensor, c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat> >(void*, c10::OperatorKernel*, c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>&&, std::optional<c10::ScalarType>&&, std::optional<c10::Layout>&&, std::optional<c10::Device>&&, std::optional<bool>&&, double&&, long&&, std::optional<c10::MemoryFormat>&&) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/KernelFunction_impl.h:50:12
    #17 0x7f04b9246e3e in at::Tensor c10::KernelFunction::call<at::Tensor, c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat> >(c10::OperatorHandle const&, c10::DispatchKeySet, c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/KernelFunction_impl.h:90:16
    #18 0x7f04b9246e3e in at::Tensor c10::Dispatcher::call<at::Tensor, c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat> >(c10::TypedOperatorHandle<at::Tensor (c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>)> const&, c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/dispatch/Dispatcher.h:694:28
    #19 0x7f04b9246e3e in c10::TypedOperatorHandle<at::Tensor (c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>)>::call(c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/dispatch/Dispatcher.h:527:41
    #20 0x7f04b9246e3e in at::_ops::_empty_affine_quantized::call(c10::ArrayRef<c10::SymInt>, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, double, long, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/Operators_3.cpp:2917:15
    #21 0x7f04b51d710d in at::_empty_affine_quantized(c10::ArrayRef<long>, c10::TensorOptions, double, long, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/ops/_empty_affine_quantized.h:27:12
    #22 0x7f04b5d9baf0 in at::native::empty_like_quantized(at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/native/TensorFactories.cpp:487:12
    #23 0x7f04bdb3bdfe in at::(anonymous namespace)::(anonymous namespace)::wrapper_QuantizedCPU__empty_like(at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/RegisterQuantizedCPU.cpp:255:10
    #24 0x7f04bdb3d8de in c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>), &(at::(anonymous namespace)::(anonymous namespace)::wrapper_QuantizedCPU__empty_like(at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>))>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat> > >::operator()(at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/impl/WrapFunctionIntoFunctor.h:13:16
    #25 0x7f04bdb3d8de in c10::impl::wrap_kernel_functor_unboxed_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>), &(at::(anonymous namespace)::(anonymous namespace)::wrapper_QuantizedCPU__empty_like(at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>))>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat> > >, at::Tensor (at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>)>::call(c10::OperatorKernel*, c10::DispatchKeySet, at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:468:14
    #26 0x7f04b8103d1e in at::Tensor c10::callUnboxedKernelFunction<at::Tensor, at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat> >(void*, c10::OperatorKernel*, c10::DispatchKeySet, at::Tensor const&, std::optional<c10::ScalarType>&&, std::optional<c10::Layout>&&, std::optional<c10::Device>&&, std::optional<bool>&&, std::optional<c10::MemoryFormat>&&) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/KernelFunction_impl.h:50:12
    #27 0x7f04b924dd3e in at::Tensor c10::KernelFunction::call<at::Tensor, at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat> >(c10::OperatorHandle const&, c10::DispatchKeySet, at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/KernelFunction_impl.h:102:16
    #28 0x7f04b924dd3e in at::Tensor c10::Dispatcher::call<at::Tensor, at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat> >(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>)> const&, at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/dispatch/Dispatcher.h:694:28
    #29 0x7f04b924dd3e in c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>)>::call(at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/dispatch/Dispatcher.h:527:41
    #30 0x7f04b924dd3e in at::_ops::empty_like::call(at::Tensor const&, std::optional<c10::ScalarType>, std::optional<c10::Layout>, std::optional<c10::Device>, std::optional<bool>, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/Operators_3.cpp:2967:15
    #31 0x7f04b3e81f20 in at::empty_like(at::Tensor const&, c10::TensorOptions, std::optional<c10::MemoryFormat>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/ops/empty_like.h:27:12
    #32 0x7f04b5ecce09 in at::native::flip(at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/native/TensorTransformations.cpp:41:23
    #33 0x7f04bdb680f7 in at::(anonymous namespace)::(anonymous namespace)::wrapper_QuantizedCPU__flip(at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/RegisterQuantizedCPU.cpp:451:10
    #34 0x7f04bdb68c0a in c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&, c10::ArrayRef<long>), &(at::(anonymous namespace)::(anonymous namespace)::wrapper_QuantizedCPU__flip(at::Tensor const&, c10::ArrayRef<long>))>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, c10::ArrayRef<long> > >::operator()(at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/impl/WrapFunctionIntoFunctor.h:13:16
    #35 0x7f04bdb68c0a in c10::impl::wrap_kernel_functor_unboxed_<c10::impl::detail::WrapFunctionIntoFunctor_<c10::CompileTimeFunctionPointer<at::Tensor (at::Tensor const&, c10::ArrayRef<long>), &(at::(anonymous namespace)::(anonymous namespace)::wrapper_QuantizedCPU__flip(at::Tensor const&, c10::ArrayRef<long>))>, at::Tensor, c10::guts::typelist::typelist<at::Tensor const&, c10::ArrayRef<long> > >, at::Tensor (at::Tensor const&, c10::ArrayRef<long>)>::call(c10::OperatorKernel*, c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h:468:14
    #36 0x7f04b73e3240 in at::Tensor c10::callUnboxedKernelFunction<at::Tensor, at::Tensor const&, c10::ArrayRef<long> >(void*, c10::OperatorKernel*, c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>&&) /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/KernelFunction_impl.h:50:12
    #37 0x7f04b73e2d7c in at::Tensor c10::KernelFunction::call<at::Tensor, at::Tensor const&, c10::ArrayRef<long> >(c10::OperatorHandle const&, c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/boxing/KernelFunction_impl.h:102:16
    #38 0x7f04b73e2d7c in at::Tensor c10::Dispatcher::redispatch<at::Tensor, at::Tensor const&, c10::ArrayRef<long> >(c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, c10::ArrayRef<long>)> const&, c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/dispatch/Dispatcher.h:712:26
    #39 0x7f04b95e5579 in c10::TypedOperatorHandle<at::Tensor (at::Tensor const&, c10::ArrayRef<long>)>::redispatch(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) const /home/yonghyeon/pytorch/pytorch-asan/aten/src/ATen/core/dispatch/Dispatcher.h:532:41
    #40 0x7f04b95e5579 in at::_ops::flip::redispatch(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/Operators_3.cpp:5699:15
    #41 0x7f04c38ab81a in at::redispatch::flip(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/build/aten/src/ATen/RedispatchFunctions.h:7597:16
    #42 0x7f04c35a7c27 in torch::autograd::VariableType::(anonymous namespace)::flip(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>)::$_90::operator()() const /home/yonghyeon/pytorch/pytorch-asan/torch/csrc/autograd/generated/VariableType_3.cpp:9371:12
    #43 0x7f04c35a68d5 in torch::autograd::VariableType::(anonymous namespace)::flip(c10::DispatchKeySet, at::Tensor const&, c10::ArrayRef<long>) /home/yonghyeon/pytorch/pytorch-asan/torch/csrc/autograd/generated/VariableType_3.cpp:9369:15

SUMMARY: AddressSanitizer: heap-buffer-overflow /tmp/llvm/utils/release/final/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 in __asan_memcpy
Shadow bytes around the buggy address:
  0x0c127fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c127fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c127fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c127fff8000: fa fa fa fa fa fa fa fa 00 fa fa fa fa fa fa fa
  0x0c127fff8010: fa fa fa fa fa fa fa fa 01 fa fa fa fa fa fa fa
=>0x0c127fff8020: fa fa fa fa fa fa fa fa[01]fa fa fa fa fa fa fa
  0x0c127fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c127fff8040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c127fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c127fff8060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c127fff8070: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
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
==848990==ABORTING
```

### Versions

PyTorch version: 2.3.0a0+git1ee7950
Is debug build: True
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.2 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: 12.0.1
CMake version: version 3.26.4
Libc version: glibc-2.35

Python version: 3.12.0 | packaged by Anaconda, Inc. | (main, Oct  2 2023, 17:29:18) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.0-89-generic-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      46 bits physical, 48 bits virtual
Byte Order:                         Little Endian
CPU(s):                             96
On-line CPU(s) list:                0-95
Vendor ID:                          GenuineIntel
Model name:                         Intel(R) Xeon(R) Gold 6248R CPU @ 3.00GHz
CPU family:                         6
Model:                              85
Thread(s) per core:                 2
Core(s) per socket:                 24
Socket(s):                          2
Stepping:                           7
CPU max MHz:                        4000.0000
CPU min MHz:                        1200.0000
BogoMIPS:                           6000.00
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke avx512_vnni md_clear flush_l1d arch_capabilities
Virtualization:                     VT-x
L1d cache:                          1.5 MiB (48 instances)
L1i cache:                          1.5 MiB (48 instances)
L2 cache:                           48 MiB (48 instances)
L3 cache:                           71.5 MiB (2 instances)
NUMA node(s):                       2
NUMA node0 CPU(s):                  0-23,48-71
NUMA node1 CPU(s):                  24-47,72-95
Vulnerability Gather data sampling: Mitigation; Microcode
Vulnerability Itlb multihit:        KVM: Mitigation: VMX disabled
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed:             Mitigation; Enhanced IBRS
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Mitigation; TSX disabled

Versions of relevant libraries:
[pip3] numpy==1.26.2
[pip3] optree==0.10.0
[pip3] torch==2.3.0a0+git1ee7950
[conda] mkl                       2023.1.0         h213fc3f_46344  
[conda] mkl-include               2023.1.0         h06a4308_46344  
[conda] numpy                     1.26.2                   pypi_0    pypi
[conda] optree                    0.10.0                   pypi_0    pypi
[conda] torch                     2.3.0a0+git1ee7950           dev_0    <develop>

cc @jerryzh168 @jianyuh @raghuramank100 @jamesr66a @vkuzo @jgong5 @Xia-Weiwen @leslie-fang-intel