tensorflow new(sz=18446744073709551615) got std::bad_alloc
@haolujun,
We see that you are using tf version 1.14, 1.x is not actively supported, please update to 2.x and let us know if you are facing the same issue.

Also please try to install the tensorflow latest stable version from the official [document](https://www.tensorflow.org/install) and refer to the[migration](https://www.tensorflow.org/guide/migrate) doc to know more on this. Thank you!  This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62225">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62225">No</a>

### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

source

### TensorFlow version

tf 1.14.0

### Custom code

No

### OS platform and distribution

_No response_

### Mobile device

_No response_

### Python version

3.7.2

### Bazel version

unknown

### GCC/compiler version

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609

### CUDA/cuDNN version

no

### GPU model and memory

_No response_

### Current behavior?

throw std::bad_malloc

### Standalone code to reproduce the issue

```shell
no std::bad_malloc, no new(sz=18446744073709551615)
```


### Relevant log output

```shell
#0  __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007f7f6df7be42 in __GI___pthread_mutex_lock (mutex=0x7f7f6eb43970 <_rtld_global+2352>) at ../nptl/pthread_mutex_lock.c:115
#2  0x00007f7f6dceb0df in __GI___dl_iterate_phdr (callback=0x7f7f45dc4df0, data=0x7f7e28ff92a0) at dl-iteratephdr.c:41
#3  0x00007f7f45dc616e in _Unwind_Find_FDE () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#4  0x00007f7f45dc2b63 in ?? () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#5  0x00007f7f45dc3d80 in ?? () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#6  0x00007f7f45dc422e in _Unwind_RaiseException () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#7  0x00007f7f4605833c in __cxxabiv1::__cxa_throw (obj=0x7f7e258670a0, tinfo=0x7f7f4633c770 <typeinfo for std::bad_alloc>, dest=0x7f7f46056550 <std::bad_alloc::~bad_alloc()>)
    at ../../../../libstdc++-v3/libsupc++/eh_throw.cc:82
#8  0x00007f7f4605886c in operator new (sz=18446744073709551615) at ../../../../libstdc++-v3/libsupc++/new_op.cc:54
#9  0x00007f7f5170f2b9 in Eigen::internal::aligned_malloc(unsigned long) () from /usr/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#10 0x00007f7f526fa18e in void* Eigen::internal::TensorContractionBlockMemAllocator<float, float>::allocateSlices<Eigen::ThreadPoolDevice const>(Eigen::ThreadPoolDevice const&, long, long, long, long, long, long, std::vector<float*, std::allocator<float*> >*, std::vector<float*, std::allocator<float*> >*) () from /usr/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#11 0x00007f7f52911ec5 in void* Eigen::internal::TensorContractionKernel<float, float, float, long, Eigen::internal::blas_data_mapper<float, long, 0, 0>, Eigen::internal::TensorContractionInputMapper<float, long, 1, Eigen::TensorEvaluator<Eigen::TensorMap<Eigen::Tensor<float const, 2, 1, long>, 16, Eigen::MakePointer> const, Eigen::ThreadPoolDevice>, Eigen::array<long, 1ul>, Eigen::array<long, 1ul>, 16, true, false, 0, Eigen::MakePointer>, Eigen::internal::TensorContractionInputMapper<float, long, 0, Eigen::TensorEvaluator<Eigen::TensorMap<Eigen::Tensor<float const, 2, 1, long>, 16, Eigen::MakePointer> const, Eigen::ThreadPoolDevice>, Eigen::array<long, 1ul>, Eigen::array<long, 1ul>, 16, true, false, 0, Eigen::MakePointer> >::allocateSlices<Eigen::ThreadPoolDevice const>(Eigen::ThreadPoolDevice const&, int, int, int, std::vector<Eigen::internal::ColMajorBlock<float, long>, std::allocator<Eigen::internal::ColMajorBlock<float, long> > >*, std::vector<Eigen::internal::ColMajorBlock<float, long>, std::allocator<Eigen::internal::ColMajorBlock<float, long> > >*) () from /usr/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#12 0x00007f7f5293cf30 in void Eigen::TensorEvaluator<Eigen::TensorContractionOp<Eigen::array<Eigen::IndexPair<long>, 1ul> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 1, long>, 16, Eigen::MakePointer> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 1, long>, 16, Eigen::MakePointer> const, Eigen::NoOpOutputKernel const> const, Eigen::ThreadPoolDevice>::evalProduct<0>(float*) const ()
   from /usr/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#13 0x00007f7f5293f1cb in Eigen::internal::TensorExecutor<Eigen::TensorAssignOp<Eigen::TensorMap<Eigen::Tensor<float, 2, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorContractionOp<Eigen::array<Eigen::IndexPair<long>, 1ul> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 1, long>, 16, Eigen::MakePointer> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 1, long>, 16, Eigen::MakePointer> const, Eigen::NoOpOutputKernel const> const> const, Eigen::ThreadPoolDevice, true, false>::run(Eigen::TensorAssignOp<Eigen::TensorMap<Eigen::Tensor<float, 2, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorContractionOp<Eigen::array<Eigen::IndexPair<long>, 1ul> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 1, long>, 16, Eigen::MakePointer> const, Eigen::TensorMap<Eigen::Tensor<float const, 2, 1, long>, 16, Eigen::MakePointer> const, Eigen::NoOpOutputKernel const> const> const&, Eigen::ThreadPoolDevice const&) () from /usr/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#14 0x00007f7f529a2c7e in tensorflow::MatMulOp<Eigen::ThreadPoolDevice, float, false>::Compute(tensorflow::OpKernelContext*) ()
   from /usr/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
#15 0x00007f7f4dee0146 in tensorflow::(anonymous namespace)::ExecutorState::Process(tensorflow::(anonymous namespace)::ExecutorState::TaggedNode, long long) ()
   from /usr/lib/python3.7/site-packages/tensorflow/python/../libtensorflow_framework.so.1
#16 0x00007f7f4ded05a5 in std::_Function_handler<void (), std::_Bind<std::_Mem_fn<void (tensorflow::(anonymous namespace)::ExecutorState::*)(tensorflow::(anonymous namespace)::ExecutorState::TaggedNode, long long)> (tensorflow::(anonymous namespace)::ExecutorState*, tensorflow::(anonymous namespace)::ExecutorState::TaggedNode, long long)> >::_M_invoke(std::_Any_data const&) ()
   from /usr/lib/python3.7/site-packages/tensorflow/python/../libtensorflow_framework.so.1
#17 0x00007f7f4df76cfe in Eigen::ThreadPoolTempl<tensorflow::thread::EigenEnvironment>::WorkerLoop(int) () from /usr/lib/python3.7/site-packages/tensorflow/python/../libtensorflow_framework.so.1
#18 0x00007f7f4df73b98 in std::_Function_handler<void (), tensorflow::thread::EigenEnvironment::CreateThread(std::function<void ()>)::{lambda()#1}>::_M_invoke(std::_Any_data const&) ()
   from /usr/lib/python3.7/site-packages/tensorflow/python/../libtensorflow_framework.so.1
#19 0x00007f7f460828b3 in std::execute_native_thread_routine_compat (__p=<optimized out>) at ../../../../../libstdc++-v3/src/c++11/thread.cc:110
#20 0x00007f7f6df796ba in start_thread (arg=0x7f7e28ffb700) at pthread_create.c:333
#21 0x00007f7f6dcaf4dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
```
