tf.data.Dataset.from_generator crashes with abortion
Tensorflow Version
2.13.0-dev20230208
python 3.8 version
OS : WSL
CUDA/cuDNN version
12.0/8.8.1.3
Nvidia RTX 2060 (6GB)
import tensorflow as tf
import numpy as np
ds = tf.data.Dataset.from_tensors([1]).repeat(-1)
def gen():
  for _ in ds:
    yield _
ds = tf.data.Dataset.from_generator(
    gen, output_types=tf.int32)
list(ds.take(2).as_numpy_iterator())
Relevant log output
Your kernel may have been built without NUMA support.
2023-03-31 22:33:41.003743: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1635] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 3854 MB memory:  -> device: 0, name: NVIDIA GeForce RTX 2060, pci bus id: 0000:01:00.0, compute capability: 7.5  

There is no error with your code. 

import tensorflow as tf

print("TensorFlow Nightly version:", tf.__version__)

TensorFlow Nightly version: 2.13.0-dev20230331
 @trickiwoo 
 As per  [documentation](https://www.tensorflow.org/api_docs/python/tf/data/Dataset#repeat) of tf.data.Dataset.repeat "`The default behavior (if count is None or -1) is for the dataset to be repeated indefinitely`". I was able to execute the given code with a positive value. please find the gist [here](https://colab.research.google.com/gist/tiruk007/05bf29c3170397a6afdfd2ab373eb3f3/untitled178.ipynb) for reference.

Thank you!
 @tiruk007 Thanks for the reference. This bug does only exists with `repeat(-1)`. In my understanding, crashes like this seem to be a vulnerability according to https://github.com/tensorflow/tensorflow/issues/60121#issuecomment-1485230826, so I have also reported this bug to the Google OSS VRP program. @Adesoji1 I tried and can still reproduce this bug in `2.13.0-dev20230402` locally and on Colab, can you try again on Colab? @trickiwoo I ran the previous code on a jupyter kernel in a window subsystem for Linux. I would try colab  @trickiwoo ,

Our team is looking into it Google OSS VRP program and will get back to you. Thanks for reporting.
<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

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

Yes

### Source

source

### Tensorflow Version

2.13.0-dev20230208

### Custom Code

Yes

### OS Platform and Distribution

_No response_

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

```shell
tf.data.Dataset.from_generator crashes with abortion
```


### Standalone code to reproduce the issue

```shell
import tensorflow as tf
import numpy as np
ds = tf.data.Dataset.from_tensors([1]).repeat(-1)
def gen():
  for _ in ds:
    yield _
ds = tf.data.Dataset.from_generator(
    gen, output_types=tf.int32)
list(ds.take(2).as_numpy_iterator())
```


### Relevant log output

```shell
2023-03-28 12:06:28.440209: F tensorflow/tsl/platform/default/env.cc:74] Check failed: ret == 0 (11 vs. 0)Thread tf_data_private_threadpool creation via pthread_create() failed.
Aborted (core dumped)
```
</details>