镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

SIGABRT on 32bit armhf in [batch]<xsimd::batch<unsigned char>> #1260

Closed

Description

@drew-parsons

Building xsimd 14.0.0 on debian fails on 32-bit armhf:

test 1
    Start 1: test_xsimd

1: Test command: /build/reproducible-path/xsimd-14.0.0/obj-arm-linux-gnueabihf/test/test_xsimd
1: Working Directory: /build/reproducible-path/xsimd-14.0.0/obj-arm-linux-gnueabihf/test
1: Test timeout computed to be: 10000000
1: test_xsimd: ./include/xsimd/types/xsimd_batch.hpp:596: void xsimd::batch<T, A>::store_aligned(U*) const [with U = unsigned char; T = unsigned char; A = xsimd::neon]: Assertion `((reinterpret_cast<uintptr_t>(mem) % A::alignment()) == 0) && "store location is not properly aligned"' failed.
1: [doctest] doctest version is "2.4.12"
1: [doctest] run with "--help" for options
1: ===============================================================================
1: ./test/test_batch.cpp:955:
1: TEST CASE:  [batch]<xsimd::batch<unsigned char>>
1:   horizontal_operations
1: 
1: ./test/test_batch.cpp:955: FATAL ERROR: test case CRASHED: SIGABRT - Abort (abnormal termination) signal
1: 
1: ===============================================================================
1: ./test/test_batch.cpp:955:
1: TEST CASE:  [batch]<xsimd::batch<unsigned char>>
1: 
1: DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE):
1:   horizontal_operations
1: 
1: ===============================================================================
1: [doctest] test cases:  13 |  12 passed | 1 failed | 274 skipped
1: [doctest] assertions: 706 | 706 passed | 0 failed |
1: [doctest] Status: FAILURE!
1/1 Test #1: test_xsimd .......................Subprocess aborted***Exception:   0.01 sec
test_xsimd: ./include/xsimd/types/xsimd_batch.hpp:596: void xsimd::batch<T, A>::store_aligned(U*) const [with U = unsigned char; T = unsigned char; A = xsimd::neon]: Assertion `((reinterpret_cast<uintptr_t>(mem) % A::alignment()) == 0) && "store location is not properly aligned"' failed.

Full log at https://buildd.debian.org/status/fetch.php?pkg=xsimd&arch=armhf&ver=14.0.0-4&stamp=1771339739&raw=0

This is with no specific machine flags provided. Previously we specified -mfloat-abi=hard -mfpu=vfpv3 because of #889 , but that now fails with xsimd 14.0.0, triggering an error unrecognizable insn, see https://buildd.debian.org/status/fetch.php?pkg=xsimd&arch=armhf&ver=14.0.0-2&stamp=1771004640&raw=0

This is with PR #1177 reverted, because of the ARM64 bug #1232 (I'm not sure that that directly affects 32-bit arm)

Activity

  1. drew-parsons commented on Feb 18, 2026

    @drew-parsons
    Author

    Part of the issue could be in

    #if (defined(__ARM_NEON) && __ARM_ARCH >= 7) || XSIMD_WITH_NEON64

    (this line points at main patched by #1254 but the essential logic is the same in 14.0.0)

    With defined(__ARM_NEON) && __ARM_ARCH >= 7 it seems to be assuming that armv7 always supports NEON, but apparently NEON is optional for v7.I'm not exactly sure that this assumption is what's triggering the SIGABRT reported here, but the log does refer to A = xsimd::neon.

    There is some related discussion in a debian bug at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1128257

  2. drew-parsons commented on Feb 18, 2026

    @drew-parsons
    Author

    I have lscpu output from the failing machine, logged at https://buildd.debian.org/status/fetch.php?pkg=xsimd&arch=armhf&ver=14.0.0-4&stamp=1771339739&raw=0

    Architecture:                            armv8l
    Byte Order:                              Little Endian
    CPU(s):                                  8
    On-line CPU(s) list:                     0-7
    Vendor ID:                               0x41
    Model name:                              ARMv8 Processor rev 1 (v8l)
    Model:                                   1
    Thread(s) per core:                      1
    Core(s) per socket:                      8
    Socket(s):                               1
    Stepping:                                0x3
    BogoMIPS:                                50.00
    Flags:                                   half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt lpae evtstrm fphp asimdhp asimddp aes pmull sha1 sha2 crc32 ssbs
    NUMA node(s):                            1
    NUMA node0 CPU(s):                       0-7
    Vulnerability Gather data sampling:      Not affected
    Vulnerability Indirect target selection: Not affected
    Vulnerability Itlb multihit:             Not affected
    Vulnerability L1tf:                      Not affected
    Vulnerability Mds:                       Not affected
    Vulnerability Meltdown:                  Not affected
    Vulnerability Mmio stale data:           Not affected
    Vulnerability Reg file data sampling:    Not affected
    Vulnerability Retbleed:                  Not affected
    Vulnerability Spec rstack overflow:      Not affected
    Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
    Vulnerability Spectre v1:                Mitigation; __user pointer sanitization
    Vulnerability Spectre v2:                Mitigation; CSV2, BHB
    Vulnerability Srbds:                     Not affected
    Vulnerability Tsa:                       Not affected
    Vulnerability Tsx async abort:           Not affected
    Vulnerability Vmscape:                   Not affected
    

    So this machine is actually v8 not v7, and reports that it is "supposed" to support neon. So perhaps this SIGABRT is not directly a NEON issue.

    Following the advice of the debian gcc maintainer (debian Bug#1128257) I'll try testing with -march=armv7-a+fp (the debian baseline for armhf is v7)

  3. drew-parsons commented on Feb 19, 2026

    @drew-parsons
    Author

    armv8l may indicate a 32-bit ARM environment (chroot) on Aarch64, which might be relevant.

    I can get xsimd 14.0.0 to build and test successfully in this armhf environment by forcing armv7 compliance with
    -march=armv7-a+fp

  4. drew-parsons commented on Feb 20, 2026

    @drew-parsons
    Author

    So this machine is actually v8 not v7, and reports that it is "supposed" to support neon. So perhaps this SIGABRT is not directly a NEON issue.

    In the light of the comment above, (successful with -march=armv7-a+fp), I think it might actually be the other way around: the SIGABRT is precisely a NEON issue, on 32-bit ARM.

    If the 32-bit arm system doesn't claim to support neon then this code is not invoked. The fallback generic function is used instead, with no SIGABRT. The problem is only when 32-bit arm does claim to support neon.

  5. drew-parsons commented on May 2, 2026

    @drew-parsons
    Author

    This bug is still present in 14.1.0. This release fixed other problems, but not this 32-bit armhf issue, even after applying the final PR #1241 patch. A gdb backtrace of test_xsimd is

    test_xsimd: ./include/xsimd/types/xsimd_batch.hpp:596: void xsimd::batch<T, A>::store_aligned(U*) const [with U = unsigned char; T = unsigned char; A = xsimd::neon]: Assertion `((reinterpret_cast<uintptr_t>(mem) % A::alignment()) == 0) && "store location is not properly aligned"' failed.
    
    Program received signal SIGABRT, Aborted.
    __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47
    warning: 47	../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S: No such file or directory
    (gdb) bt
    #0  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47
    #1  0xf7c6643e in __pthread_kill_implementation (threadid=4160614432, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:43
    #2  0xf7c664bc in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:89
    #3  0xf7c2eef8 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #4  0xf7c1f2ae in __GI_abort () at abort.c:77
    #5  0xf7c2a140 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0xbcc044 "((reinterpret_cast<uintptr_t>(mem) % A::alignment()) == 0) && \"store location is not properly aligned\"", 
        file=file@entry=0xbc8960 "./include/xsimd/types/xsimd_batch.hpp", line=line@entry=596, function=<optimized out>, 
        function@entry=0xbcbfd4 "void xsimd::batch<T, A>::store_aligned(U*) const [with U = unsigned char; T = unsigned char; A = xsimd::neon]") at assert.c:118
    #6  0xf7c2a262 in __assert_fail (assertion=0xbcc044 "((reinterpret_cast<uintptr_t>(mem) % A::alignment()) == 0) && \"store location is not properly aligned\"", 
        file=0xbc8960 "./include/xsimd/types/xsimd_batch.hpp", line=596, function=0xbcbfd4 "void xsimd::batch<T, A>::store_aligned(U*) const [with U = unsigned char; T = unsigned char; A = xsimd::neon]")
        at assert.c:127
    #7  0x0064f3e4 in xsimd::batch<unsigned char, xsimd::neon>::store_aligned<unsigned char> (this=<optimized out>, mem=<optimized out>) at ./include/xsimd/types/xsimd_batch.hpp:596
    #8  xsimd::kernel::swizzle<xsimd::neon, unsigned char, unsigned char, (unsigned char)8, (unsigned char)9, (unsigned char)10, (unsigned char)11, (unsigned char)12, (unsigned char)13, (unsigned char)14, (unsigned char)15, (unsigned char)8, (unsigned char)9, (unsigned char)10, (unsigned char)11, (unsigned char)12, (unsigned char)13, (unsigned char)14, (unsigned char)15> (self=...)
        at ./include/xsimd/types/../arch/./xsimd_neon.hpp:3150
    #9  xsimd::swizzle<unsigned char, xsimd::neon, unsigned char, (unsigned char)8, (unsigned char)9, (unsigned char)10, (unsigned char)11, (unsigned char)12, (unsigned char)13, (unsigned char)14, (unsigned char)15, (unsigned char)8, (unsigned char)9, (unsigned char)10, (unsigned char)11, (unsigned char)12, (unsigned char)13, (unsigned char)14, (unsigned char)15> (x=..., mask=...)
        at ./include/xsimd/types/xsimd_api.hpp:2640
    #10 xsimd::kernel::detail::reduce<xsimd::kernel::reduce_max<xsimd::neon, unsigned char>(xsimd::batch<unsigned char, xsimd::neon> const&, xsimd::common const&)::{lambda(xsimd::batch<unsigned char, xsimd::neon> const&, xsimd::batch<unsigned char, xsimd::neon> const&)#1}, xsimd::neon, unsigned char, 16u>(xsimd::kernel::reduce_max<xsimd::neon, unsigned char>(xsimd::batch<unsigned char, xsimd::neon> const&, xsimd::common const&)::{lambda(xsimd::batch<unsigned char, xsimd::neon> const&, xsimd::batch<unsigned char, xsimd::neon> const&)#1}, xsimd::batch<unsigned char, xsimd::neon> const&, std::integral_constant<unsigned int, 16u>) (
        op=..., self=...) at ./include/xsimd/types/../arch/././common/xsimd_common_math.hpp:2140
    #11 xsimd::kernel::reduce_max<xsimd::neon, unsigned char> (self=...) at ./include/xsimd/types/../arch/././common/xsimd_common_math.hpp:2149
    #12 xsimd::reduce_max<unsigned char, xsimd::neon> (x=...) at ./include/xsimd/types/xsimd_api.hpp:1960
    #13 batch_test<xsimd::batch<unsigned char, xsimd::neon> >::test_horizontal_operations (this=this@entry=0xfffeef50) at ./test/test_batch.cpp:832
    #14 0x0059ae4c in DOCTEST_ANON_TMP_740<xsimd::batch<unsigned char> > () at ./test/test_batch.cpp:1040
    #15 0x004c27a4 in doctest::Context::run (this=this@entry=0xfffef2e8) at /usr/include/doctest/doctest.h:7035
    #16 0x004a7f38 in main (argc=<optimized out>, argv=<optimized out>) at /usr/include/doctest/doctest.h:7113
    
  6. drew-parsons commented on Jul 8, 2026

    @drew-parsons
    Author

    Looks like some alignment is still missing, applying #1374 to 14.2.0,
    unless there are other alignment patches post-14.2.0 that should be included in the build.

    This is in a default build that doesn't force the compile option -march=armv7-a+fp.

    The error message here refers to U = float, the one I logged in the previous message was U = unsigned char.

    armhf build log at https://buildd.debian.org/status/fetch.php?pkg=xsimd&arch=armhf&ver=14.2.0-3&stamp=1783529142&raw=0

    test 1
        Start 1: test_xsimd
    
    1: Test command: /build/reproducible-path/xsimd-14.2.0/obj-arm-linux-gnueabihf/test/test_xsimd
    1: Working Directory: /build/reproducible-path/xsimd-14.2.0/obj-arm-linux-gnueabihf/test
    1: Test timeout computed to be: 10000000
    1: test_xsimd: ./include/xsimd/types/xsimd_batch.hpp:603: void xsimd::batch<T, A>::store_aligned(U*) const [with U = float; T = float; A = xsimd::neon]: Assertion `((reinterpret_cast<uintptr_t>(mem) % A::alignment()) == 0) && "store location is not properly aligned"' failed.
    1: [doctest] doctest version is "2.4.12"
    1: [doctest] run with "--help" for options
    1: ===============================================================================
    1: ./test/test_complex_power.cpp:211:
    1: TEST CASE:  [complex power]<xsimd::batch<std::complex<float> >>
    1:   pow real complex
    1: 
    1: ./test/test_complex_power.cpp:211: FATAL ERROR: test case CRASHED: SIGABRT - Abort (abnormal termination) signal
    1: 
    1: ===============================================================================
    1: ./test/test_complex_power.cpp:211:
    1: TEST CASE:  [complex power]<xsimd::batch<std::complex<float> >>
    1: 
    1: DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE):
    1:   pow real complex
    1: 
    1: ===============================================================================
    1: [doctest] test cases:   83 |   82 passed | 1 failed | 229 skipped
    1: [doctest] assertions: 3380 | 3380 passed | 0 failed |
    1: [doctest] Status: FAILURE!
    1/1 Test #1: test_xsimd .......................Subprocess aborted***Exception:   0.14 sec
    test_xsimd: ./include/xsimd/types/xsimd_batch.hpp:603: void xsimd::batch<T, A>::store_aligned(U*) const [with U = float; T = float; A = xsimd::neon]: Assertion `((reinterpret_cast<uintptr_t>(mem) % A::alignment()) == 0) && "store location is not properly aligned"' failed.
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions