question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: implementation of npy_get_floatstatus_barrier incomplete for musl libc

See original GitHub issue

I’ve ran into issue with linalg.solve on different systems: in RHEL and Ubuntu it will raise an LinAlgError exception, but on Alpine it will return nan.

Ubuntu:

$ docker run -it --rm ubuntu:18.04 /bin/sh
$ apt-get install python3-numpy
# python3
Python 3.6.6 (default, Sep 12 2018, 18:26:19)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.linalg.solve(numpy.array([[0]]), numpy.array([[0]]))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/numpy/linalg/linalg.py", line 375, in solve
    r = gufunc(a, b, signature=signature, extobj=extobj)
  File "/usr/lib/python3/dist-packages/numpy/linalg/linalg.py", line 90, in _raise_linalgerror_singular
    raise LinAlgError("Singular matrix")
numpy.linalg.linalg.LinAlgError: Singular matrix

Alpine:

$ docker run -it --rm alpine:3.8 /bin/sh
# apk --update add python3 py3-numpy
/ # python3
Python 3.6.6 (default, Aug 24 2018, 05:04:18)
[GCC 6.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.linalg.solve(numpy.array([[0]]), numpy.array([[0]]))
array([[nan]])

I would expect to receive same exception on Alpine as well. Is this known issue?

I’ve tried to use either lapack or openblas on alpine, compile numpy from source — it’s still would return nan.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mattipcommented, Oct 9, 2018

ok, thanks. @sashkab see this comment for why that happens.

0reactions
sashkabcommented, Oct 9, 2018

@sashkab Thanks. What was the unused function error when you had '-Werror=unused-function' defined?

They were:

In file included from numpy/core/src/umath/loops.c.src:47:0:
numpy/core/src/umath/simd.inc.src:1020:1: error: 'sse2_minimum_DOUBLE' defined but not used [-Werror=unused-function]
 sse2_@kind@_@TYPE@(@type@ * ip, @type@ * op, const npy_intp n)
 ^~~~~~~~~~~~~~~~~~~
In file included from numpy/core/src/umath/loops.c.src:47:0:
numpy/core/src/umath/simd.inc.src:1020:1: error: 'sse2_maximum_DOUBLE' defined but not used [-Werror=unused-function]
 sse2_@kind@_@TYPE@(@type@ * ip, @type@ * op, const npy_intp n)
 ^~~~~~~~~~~~~~~~~~~
In file included from numpy/core/src/umath/loops.c.src:47:0:
numpy/core/src/umath/simd.inc.src:1020:1: error: 'sse2_minimum_FLOAT' defined but not used [-Werror=unused-function]
 sse2_@kind@_@TYPE@(@type@ * ip, @type@ * op, const npy_intp n)
 ^~~~~~~~~~~~~~~~~~
In file included from numpy/core/src/umath/loops.c.src:47:0:
numpy/core/src/umath/simd.inc.src:1020:1: error: 'sse2_maximum_FLOAT' defined but not used [-Werror=unused-function]
 sse2_@kind@_@TYPE@(@type@ * ip, @type@ * op, const npy_intp n)
 ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
In file included from numpy/core/src/umath/loops.c.src:47:0:
numpy/core/src/umath/simd.inc.src:1020:1: error: 'sse2_minimum_DOUBLE' defined but not used [-Werror=unused-function]
 sse2_@kind@_@TYPE@(@type@ * ip, @type@ * op, const npy_intp n)
 ^~~~~~~~~~~~~~~~~~~
In file included from numpy/core/src/umath/loops.c.src:47:0:
numpy/core/src/umath/simd.inc.src:1020:1: error: 'sse2_maximum_DOUBLE' defined but not used [-Werror=unused-function]
 sse2_@kind@_@TYPE@(@type@ * ip, @type@ * op, const npy_intp n)
 ^~~~~~~~~~~~~~~~~~~
In file included from numpy/core/src/umath/loops.c.src:47:0:
numpy/core/src/umath/simd.inc.src:1020:1: error: 'sse2_minimum_FLOAT' defined but not used [-Werror=unused-function]
 sse2_@kind@_@TYPE@(@type@ * ip, @type@ * op, const npy_intp n)
 ^~~~~~~~~~~~~~~~~~
In file included from numpy/core/src/umath/loops.c.src:47:0:
numpy/core/src/umath/simd.inc.src:1020:1: error: 'sse2_maximum_FLOAT' defined but not used [-Werror=unused-function]
 sse2_@kind@_@TYPE@(@type@ * ip, @type@ * op, const npy_intp n)
 ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Read more comments on GitHub >

github_iconTop Results From Across the Web

FAQ - musl libc
It's a bug to assume a certain implementation has particular properties rather than testing. ... sys/queue.h is a full library implemented in a...
Read more >
musl FAQ - musl libc
This is an application bug, and fixing it is as simple as adding the missing #include directives. Using implementation details from the glibc...
Read more >
Bugs found by musl
Bugs found and reported ... search.h implementation bugs in bsd libc and glibc (stack overflow, hsearch crashes on glibc); several libm bugs in...
Read more >
Functional differences from glibc - musl libc
Such code has been a perpetual source of bugs in the glibc implementation. Until version 1.1.17, this difference was visible to applications which...
Read more >
Reporting Bugs - musl libc
Reporting Bugs. Bug reports should be sent to the musl mailing list, musl@lists.openwall.com . You do not need to be subscribed to post...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found