Skip to content

pip install --no-cache numpy on RAMv7 i get libs for ARMv8 arch #23304

Open
@magicse

Description

@magicse

Describe the issue:

Arch armv7l Alpine Docker
pip install --no-cache numpy on RAMv7 i get libs for ARMv8 arch

bash-5.1# pip install --no-cache numpy
Collecting numpy
  Downloading numpy-1.24.2.tar.gz (10.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.9/10.9 MB 1.0 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: numpy
  Building wheel for numpy (pyproject.toml) ... done
  Created wheel for numpy: filename=numpy-1.24.2-cp310-cp310-linux_armv7l.whl size=6850133 sha256=fb8de3244e8c7987ae7a895e8f4dc64370848ceaf868363d110c3c1a94392620
  Stored in directory: /tmp/pip-ephem-wheel-cache-i62n9ysv/wheels/31/42/8e/88540c3411ed4734c7fd06056942e82136135724593ecec35a
Successfully built numpy
Installing collected packages: numpy
Successfully installed numpy-1.24.2
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
readelf -A /usr/local/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-arm-linux-gnueabihf.so

Attribute Section: aeabi
File Attributes with cpu 8-A and arch v8

  Tag_CPU_name: "8-A"
  Tag_CPU_arch: v8
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-2
  Tag_FP_arch: FP for ARMv8
  Tag_Advanced_SIMD_arch: NEON for ARMv8
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_enum_size: int
  Tag_ABI_VFP_args: VFP registers
  Tag_CPU_unaligned_access: v6
  Tag_ABI_FP_16bit_format: IEEE 754
  Tag_MPextension_use: Allowed
  Tag_Virtualization_use: TrustZone and Virtualization Extensions

For example Python give normal attributes for armv7
readelf -A /usr/local/bin/python3

Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "7-A"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-2
  Tag_FP_arch: VFPv3-D16
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_rounding: Needed
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_enum_size: int
  Tag_ABI_VFP_args: VFP registers
  Tag_ABI_optimization_goals: Aggressive Size
  Tag_CPU_unaligned_access: v6
  Tag_CPU_name: "8-A"
/usr/local/lib/python3.10/site-packages/numpy/core/_simd.cpython-310-arm-linux-gnueabihf.so
  Tag_CPU_name: "7-A"
/usr/local/lib/python3.10/site-packages/numpy/core/_rational_tests.cpython-310-arm-linux-gnueabihf.so
  Tag_CPU_name: "8-A"
/usr/local/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-arm-linux-gnueabihf.so
  Tag_CPU_name: "7-A"
/usr/local/lib/python3.10/site-packages/numpy/core/_operand_flag_tests.cpython-310-arm-linux-gnueabihf.so
  Tag_CPU_name: "7-A"
/usr/local/lib/python3.10/site-packages/numpy/core/_struct_ufunc_tests.cpython-310-arm-linux-gnueabihf.so
  Tag_CPU_name: "7-A"
/usr/local/lib/python3.10/site-packages/numpy/core/_multiarray_tests.cpython-310-arm-linux-gnueabihf.so
  Tag_CPU_name: "8.2-A"
/usr/local/lib/python3.10/site-packages/numpy/core/_umath_tests.cpython-310-arm-linux-gnueabihf.so

Reproduce the code example:

bash-5.1# python3 
Python 3.10.7 (main, Nov 24 2022, 13:02:43) [GCC 11.2.1 20220219] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Segmentation fault
bash-5.1#

Error message:

Segmentation fault 

Runtime information:

Also debug of import numpy I see problem with lib _multiarrary

Starting program: /usr/local/bin/python 
Python 3.10.7 (main, Nov 24 2022, 13:02:43) [GCC 11.2.1 20220219] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy

Program received signal SIGSEGV, Segmentation fault.
sysv_lookup (s=s@entry=0x75fe97f7 "__libc_start_main", h=h@entry=24641422, dso=dso@entry=0x7dffbdc8) at ldso/dynlink.c:249
249             char *strings = dso->strings;
(gdb) bt
#0  sysv_lookup (s=s@entry=0x75fe97f7 "__libc_start_main", h=h@entry=24641422, dso=dso@entry=0x7dffbdc8) at ldso/dynlink.c:249
#1  0x75fb87e4 in find_sym2 (use_deps=0, need_def=1, s=0x75fe97f7 "__libc_start_main", dso=0x7dffbdc8) at ldso/dynlink.c:313
#2  find_sym (dso=dso@entry=0x7dffbdc8, s=0x75fe97f7 "__libc_start_main", need_def=need_def@entry=1) at ldso/dynlink.c:334
#3  0x75fa6f7c in load_library (name=name@entry=0x759348a0 "/usr/local/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-arm-linux-gnueabihf.so", 
    needed_by=<optimized out>) at ldso/dynlink.c:1128
#4  0x75fa7f34 in dlopen (file=0x759348a0 "/usr/local/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-arm-linux-gnueabihf.so", mode=2)
    at ldso/dynlink.c:2089
#5  0x75e07c54 in ?? () from /usr/local/lib/libpython3.10.so.1.0
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Context for the issue:

Here fragment of log file of strace before SIGFAULT for future check.
bash-5.1# strace python -c "import numpy"

open("/usr/local/lib/python3.10/site-packages/numpy/core/__pycache__/multiarray.cpython-310.pyc", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_BASIC_STATS, 0x7dfed658) = -1 ENOSYS (Function not implemented)
fstat64(3, {st_mode=S_IFREG|0644, st_size=53810, ...}) = 0
ioctl(3, TIOCGWINSZ, 0x7dfed8c0)        = -1 ENOTTY (Not a tty)
_llseek(3, 0, [0], SEEK_CUR)            = 0
_llseek(3, 0, [0], SEEK_CUR)            = 0
statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_BASIC_STATS, 0x7dfed828) = -1 ENOSYS (Function not implemented)
fstat64(3, {st_mode=S_IFREG|0644, st_size=53810, ...}) = 0
mmap2(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x75698000
read(3, "o\r\r\n\0\0\0\0\306L\355c\212\330\0\0\343\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 53811) = 53810
read(3, "", 1)                          = 0
close(3)                                = 0
mmap2(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x75778000
mmap2(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x75690000
munmap(0x75698000, 65536)               = 0
statx(AT_FDCWD, "/usr/local/lib/python3.10/site-packages/numpy/core", AT_STATX_SYNC_AS_STAT, STATX_BASIC_STATS, 0x7dfecae8) = -1 ENOSYS (Function not implemented)
stat64("/usr/local/lib/python3.10/site-packages/numpy/core", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
statx(AT_FDCWD, "/usr/local/lib/python3.10/site-packages/numpy/core/overrides.py", AT_STATX_SYNC_AS_STAT, STATX_BASIC_STATS, 0x7dfec8c8) = -1 ENOSYS (Function not implemented)
stat64("/usr/local/lib/python3.10/site-packages/numpy/core/overrides.py", {st_mode=S_IFREG|0644, st_size=7297, ...}) = 0
statx(AT_FDCWD, "/usr/local/lib/python3.10/site-packages/numpy/core/overrides.py", AT_STATX_SYNC_AS_STAT, STATX_BASIC_STATS, 0x7dfecb78) = -1 ENOSYS (Function not implemented)
stat64("/usr/local/lib/python3.10/site-packages/numpy/core/overrides.py", {st_mode=S_IFREG|0644, st_size=7297, ...}) = 0
open("/usr/local/lib/python3.10/site-packages/numpy/core/__pycache__/overrides.cpython-310.pyc", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_BASIC_STATS, 0x7dfeca88) = -1 ENOSYS (Function not implemented)
fstat64(3, {st_mode=S_IFREG|0644, st_size=6716, ...}) = 0
ioctl(3, TIOCGWINSZ, 0x7dfeccf0)        = -1 ENOTTY (Not a tty)
_llseek(3, 0, [0], SEEK_CUR)            = 0
_llseek(3, 0, [0], SEEK_CUR)            = 0
statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_BASIC_STATS, 0x7dfecc58) = -1 ENOSYS (Function not implemented)
fstat64(3, {st_mode=S_IFREG|0644, st_size=6716, ...}) = 0
mmap2(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x756a0000
read(3, "o\r\r\n\0\0\0\0\306L\355c\201\34\0\0\343\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 6717) = 6716
read(3, "", 1)                          = 0
close(3)                                = 0
munmap(0x756a0000, 32768)               = 0
statx(AT_FDCWD, "/usr/local/lib/python3.10/site-packages/numpy/core", AT_STATX_SYNC_AS_STAT, STATX_BASIC_STATS, 0x7dfec2d0) = -1 ENOSYS (Function not implemented)
stat64("/usr/local/lib/python3.10/site-packages/numpy/core", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
statx(AT_FDCWD, "/usr/local/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-arm-linux-gnueabihf.so", AT_STATX_SYNC_AS_STAT, STATX_BASIC_STATS, 0x7dfec0b0) = -1 ENOSYS (Function not implemented)
stat64("/usr/local/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-arm-linux-gnueabihf.so", {st_mode=S_IFREG|0755, st_size=2374876, ...}) = 0
open("/usr/local/lib/python3.10/site-packages/numpy/core/_multiarray_umath.cpython-310-arm-linux-gnueabihf.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_BASIC_STATS, 0x7dfebc50) = -1 ENOSYS (Function not implemented)
fstat64(3, {st_mode=S_IFREG|0755, st_size=2374876, ...}) = 0
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\0\0\0\0004\0\0\0"..., 936) = 936
mmap2(NULL, 2555904, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x75420000
mmap2(0x75650000, 229376, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x220000) = 0x75650000
mmap2(0x75670000, 98304, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x75670000
mmap2(0x75680000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x238000) = 0x75680000
mmap2(0x75680000, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x240000) = 0x75680000
close(3)                                = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---
+++ killed by SIGSEGV +++
Segmentation fault

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions