| Titre | pytorch torch 2.6.0 Segmentation fault |
|---|
| Description | # Bug Description
Calling pad_packed_sequence on an empty PackedSequence leads to a segmentation fault.
# Reproduction Steps
Run the following code:
```
import torch
from torch.nn.utils.rnn import pad_packed_sequence, PackedSequence
empty_data = torch.randn(0, 5)
empty_batch_sizes = torch.tensor([], dtype=torch.int64)
empty_packed = PackedSequence(empty_data, empty_batch_sizes, None, None)
# Causes segmentation fault
pad_packed_sequence(empty_packed, batch_first=True)
```
# Observed Behavior
The program crashes with a segmentation fault, indicating an invalid memory access. |
|---|
| La source | ⚠️ https://github.com/pytorch/pytorch/issues/149622 |
|---|
| Utilisateur | Default436352 (UID 81891) |
|---|
| Soumission | 20/03/2025 14:29 (il y a 2 ans) |
|---|
| Modérer | 30/03/2025 19:42 (10 days later) |
|---|
| Statut | Accepté |
|---|
| Entrée VulDB | 302047 [PyTorch 2.6.0 torch.nn.utils.rnn.pad_packed_sequence buffer overflow] |
|---|
| Points | 20 |
|---|