tensorflow / tensorflow/tensorflow

Crash in TensorFlow when using API `tf.raw_ops.DeleteMultiDeviceIterator`

Open
#107,121 4 comments 0 reactions 1 assignee View on GitHub

@Venkat6871 is already working on this.

Since Dec 27, 2025.

comp:ops stat:contribution welcome TF 2.19 type:bug
Dominant language
C++
Stars
200k
Forks
76.9k
Avg merge
2d 3h
Merged PRs (30d)
433

Description

Issue type

Bug

Have you reproduced the bug with TensorFlow Nightly?

Yes

Source

source

TensorFlow version

tf-2.19

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 behavior?

I encountered a crash in TensorFlow when I used API tf.raw_ops.DeleteMultiDeviceIterator. The code is as follows:

import tensorflow as tf

handle = tf.raw_ops.MultiDeviceIterator(
    devices=["/device:CPU:0"],
    shared_name="test_iterator",
    container="",
    output_types=[tf.float32],
    output_shapes=[tf.TensorShape([None, 10])]
)

deleter = tf.raw_ops.DeleteMultiDeviceIterator(
    multi_device_iterator=handle,
    iterators=[
        tf.raw_ops.MultiDeviceIteratorGetNextFromShard(
            multi_device_iterator=handle,
            shard_num=0,
            incarnation_id=0,
            output_types=[tf.float32],
            output_shapes=[tf.TensorShape([None, 10])]
        )
    ],
    deleter=tf.raw_ops.DeleteMultiDeviceIterator
)

When running the above code, TensorFlow crashes instead of reporting an invalid argument error.

[1] 3755469 segmentation fault (core dumped)

The above code would crash on TensorFlow nightly builds (2.19). The gist can be found here.

Standalone code to reproduce the issue
import tensorflow as tf

handle = tf.raw_ops.MultiDeviceIterator(
    devices=["/device:CPU:0"],
    shared_name="test_iterator",
    container="",
    output_types=[tf.float32],
    output_shapes=[tf.TensorShape([None, 10])]
)

deleter = tf.raw_ops.DeleteMultiDeviceIterator(
    multi_device_iterator=handle,
    iterators=[
        tf.raw_ops.MultiDeviceIteratorGetNextFromShard(
            multi_device_iterator=handle,
            shard_num=0,
            incarnation_id=0,
            output_types=[tf.float32],
            output_shapes=[tf.TensorShape([None, 10])]
        )
    ],
    deleter=tf.raw_ops.DeleteMultiDeviceIterator
)
Relevant log output
> [1]    3755469 segmentation fault (core dumped)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.