Check fail can be triggered in `tf.raw_ops.EmptyTensorList` due to overflow under jit compile mode.
Hi @Lyutoon ,

Please report check fails and other vulnerabilities [here](https://bughunters.google.com/). For more details, please check https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md and follow the instrcutions.

I have tried to replicate the reported behaviour with tf-nightly(2.14.0-dev20230601) in colab but I have observed that it is raising the exception.I executed the code multiple times and observed only exception but not overflow as reported by you.

Please refer the attached [gist](https://colab.research.google.com/gist/SuryanarayanaY/ba68e77e6c5b41b659acb50071cd24eb/60758.ipynb) and confirm.

Thanks!

 Hi @SuryanarayanaY, please try this new one:
```python
import os 
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
import numpy as np

element_shape=tf.random.uniform([3], dtype=tf.dtypes.int64, minval=0, maxval=1000000000)
max_num_elements=tf.random.uniform([], dtype=tf.dtypes.int32, minval=-100000, maxval=1000000)
element_dtype=tf.dtypes.int32

@tf.function(jit_compile=True)
def fuzz_jit():
    y = tf.raw_ops.EmptyTensorList(element_shape=element_shape, max_num_elements=max_num_elements, element_dtype=element_dtype)
    return y

def fuzz_normal():
    y = tf.raw_ops.EmptyTensorList(element_shape=element_shape, max_num_elements=max_num_elements, element_dtype=element_dtype)
    return y

y1 = fuzz_jit() # trigger the check fail under jit compile mode.
print('[+] JIT ok')
y2 = fuzz_normal() # if you run y2 first, it will through error rather than check fail.
print('[+] Normal ok')
```
I've tested on colab, here is the screenshot.
![image](https://github.com/tensorflow/tensorflow/assets/57178900/5ccc428b-1dd8-45f8-90b9-0d6a540ed9b7)

Thanks! @Lyutoon ,

Thanks for the correction. I can see now the code crashes with Fatal error and raises `InvalidArgument` due to  Overflow.

<img width="1486" alt="Screenshot 2023-06-02 at 4 15 47 PM" src="https://github.com/tensorflow/tensorflow/assets/116063290/92b3b6c1-c072-4691-83b8-591a200a9dfc">



<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

Yes

### Source

source

### Tensorflow Version

2.14.0

### Custom Code

Yes

### OS Platform and Distribution

Ubuntu 20.04

### Mobile device

Ubuntu 20.04

### Python version

3.8.10

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

Check fail can be triggered in `tf.raw_ops.EmptyTensorList` under jit compile mode. While in normal mode, it won't be triggered but through an InvalidArgumentError.

### Standalone code to reproduce the issue

```shell
import os 
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
import numpy as np

element_shape=tf.random.uniform([3], dtype=tf.dtypes.int64, minval=-100000000, maxval=1000000000)
max_num_elements=tf.random.uniform([], dtype=tf.dtypes.int32, minval=-100000, maxval=1000000)
element_dtype=tf.dtypes.int32

@tf.function(jit_compile=True)
def fuzz_jit():
    y = tf.raw_ops.EmptyTensorList(element_shape=element_shape, max_num_elements=max_num_elements, element_dtype=element_dtype)
    return y

def fuzz_normal():
    y = tf.raw_ops.EmptyTensorList(element_shape=element_shape, max_num_elements=max_num_elements, element_dtype=element_dtype)
    return y

y1 = fuzz_jit() # trigger the check fail under jit compile mode.
print('[+] JIT ok')
y2 = fuzz_normal() # if you run y2 first, it will through error rather than check fail.
print('[+] Normal ok')
```


### Relevant log output

```shell
% python test.py
2023-06-02 11:41:06.810728: F tensorflow/core/framework/tensor_shape.cc:201] Non-OK-status: InitDims(dim_sizes) status: INVALID_ARGUMENT: Encountered overflow when multiplying 246417692688323817 with 562326056, result: -1
zsh: abort (core dumped)  python test.py
```
</details>