Skip to content

Fatal floating point exception when constructing an aligned dtype with no fields. #19696

@anntzer

Description

@anntzer

Reproducing code example:

import numpy as np
np.dtype({"names": [], "formats": [], "itemsize": 0}, align=True)

Error message:

Fatal Python error: Floating point exception

Current thread 0x00007fe747b69740 (most recent call first):
  File "<string>", line 1 in <module>
[1]    25575 floating point exception (core dumped)

(Admittedly a very edge case, but note that, OTOH np.dtype([], align=True) works fine.)

NumPy/Python version information:

1.21.2 3.9.6 (default, Jun 30 2021, 10:22:16)
[GCC 11.1.0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions