Skip to content

BUG: np.less segfault regression #17198

@larsoner

Description

@larsoner

Reproducing code example:

import numpy as np
data = np.load('bad.zip')
a, b = data['a'], data['b']
np.less(a, b, where=~np.isnan(a),
        out=np.full_like(a, fill_value=False))

Corresponding file here:

bad.zip

Error message:

On eec0aa2 it runs fine, but on 37dc69c (next commit to master, from #17029) this yields (at least sometimes):

double free or corruption (!prev)
Aborted (core dumped)

You can see similar errors on CIs on Windows and Linux with --pre pip installs for example here on Travis Linux.

GDB traceback looks like this (first time running it, sorry if this is not useful):

larsoner@bunk:~/python/numpy$ gdb --args python runtests.py -g --python ~/Desktop/rep.py
GNU gdb (Ubuntu 9.1-0ubuntu1) 9.1
...
Reading symbols from python...
(No debugging symbols found in python)
(gdb) run
Starting program: /home/larsoner/.local/bin/python runtests.py -g --python /home/larsoner/Desktop/rep.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Building, see build.log...
[Detaching after fork from child process 32036]
    ... build in progress
Build OK
Enabling display of all warnings
double free or corruption (!prev)

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.

Numpy/Python version information:

1.20.0.dev0+37dc69c 3.8.2 (default, Jul 16 2020, 14:00:26) 
[GCC 9.3.0]

cc @mattip since I think this was your PR

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions