opened
DNXie
username_0
<em>Please make sure that this is a bug. As per our
[GitHub Policy](https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md),
we only address code/doc bugs, performance issues, feature requests and
build/installation issues on GitHub. tag:bug_template</em>

**System information**
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 18.04
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A
- TensorFlow installed from (source or binary): binary
- TensorFlow version (use command below):2.1.0
- Python version:3.7.6
- Bazel version (if compiling from source):N/A
- GCC/Compiler version (if compiling from source):N/A
- CUDA/cuDNN version:N/A
- GPU model and memory:N/A


You can collect some of this information using our environment capture
[script](https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh)
You can also obtain the TensorFlow version with:
1. TF 1.0: `python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"`
2. TF 2.0: `python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"`


**Describe the current behavior**

`tf.signal.inverse_stft` segfault when `frame_length` is a large value.

**Describe the expected behavior**
expect no crashes

**Standalone code to reproduce the issue**
Provide a reproducible test case that is the bare minimum necessary to generate
the problem. If possible, please share a link to Colab/Jupyter/any notebook.
~~~python
import tensorflow as tf
stfts = tf.ones((1,1), dtype=tf.complex64)
tf.signal.inverse_stft(stfts=stfts, frame_length=2700000000, frame_step=1)
~~~


**Other info / logs** Include any logs or source code that would be helpful to
diagnose the problem. If including tracebacks, please include the full
traceback. Large logs and files should be attached.
~~~python
Segmentation fault (core dumped)
~~~
tf.signal.inverse_stft segfault when frame_length is a large value
issue
created
ravikyram
username_1
@username_0 

If we change frame_length=27000 i am not seeing any issue.Please, find the gist [here](https://colab.research.google.com/gist/username_1/a31bfaa703ddd34548862e7860baf762/untitled242.ipynb).Thanks!
comment
created
DNXie
username_0
@username_1 I agree. But the function shouldn't crash with invalid input.
comment
created
dthkao
username_2
How much memory does the host running the snippet have? I suspect [this pad](https://github.com/tensorflow/tensorflow/blob/9ea2adeb41131b2af704d8ceee96b7c771d220ad/tensorflow/python/ops/signal/spectral_ops.py#L264-L266) may just be running out of memory.

Separate from the seg fault, the frame_length of 2700000000 is just large enough to require a tf.int64 dtype, but windows are assumed to have lengths [representable by tf.int32](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/signal/window_ops.py).
comment
created
DNXie
username_0
@username_2 A memory check instead of crash would be better! :)
comment
created
sushreebarsa
username_3
Was able to replicate the issue in TF 2.6.0-dev20210528,please find the gist[ here ](https://colab.research.google.com/gist/username_3/fe623ab6a29572e7ccb9bb2ce208b2ca/untitled70.ipynb#scrollTo=aKxtUiBRx_Ic)..Thanks !
comment
created
jvishnuvardhan
username_4
@username_0 When i ran with recent `tf-nightly`,  the code is not crashing. It is throwing an error as expected. Please check the [gist here](https://colab.research.google.com/gist/username_4/5723b47e5c66e33bc4c82df8d3e68fb9/untitled242.ipynb). Thanks!

The following is an error trace.
```
---------------------------------------------------------------------------
InvalidArgumentError                      Traceback (most recent call last)
<ipython-input-3-495cfd7046bc> in <module>()
      1 import tensorflow as tf
      2 stfts = tf.ones((1,1), dtype=tf.complex64)
----> 3 tf.signal.inverse_stft(stfts=stfts, frame_length=2700000000, frame_step=1)

5 frames
/usr/local/lib/python3.7/dist-packages/six.py in raise_from(value, from_value)

InvalidArgumentError: Obtained a FFT shape of 0 elements: [1,0] [Op:IRFFT]
```
comment