-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: SIGBUS in test_append_frame_column_oriented, test_select_filter_corner on arm #54396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm pretty sure tests passed on arm fairly recently, but if I try e.g. pandas-1.4.0 (Jan 2022), it fails now, so I suspect GCC got better at optimising instead. So, unlike the other bug, I can't give you the commit which caused it. |
It blows up for me at https://github.com/pandas-dev/pandas/blob/main/pandas/_libs/algos_take_helper.pxi.in#L219 with e.g. __pyx_t_8 = __pyx_v_k;
__pyx_t_9 = __pyx_t_8;
for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
__pyx_v_j = __pyx_t_10;
/* "pandas/_libs/algos_take_helper.pxi":1998
* else:
* for j in range(k):
* out[i, j] = values[idx, j] # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_7 = __pyx_v_idx;
__pyx_t_11 = __pyx_v_j;
__pyx_t_12 = __pyx_v_i;
__pyx_t_13 = __pyx_v_j;
*((__pyx_t_5numpy_float64_t *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_out.data + __pyx_t_12 * __pyx_v_out.strides[0]) ) + __pyx_t_13 * __pyx_v_out.strides[1]) )) = (*((__pyx_t_5numpy_float64_t const *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_values.data + __pyx_t_7 * __pyx_v_values.strides[0]) ) + __pyx_t_11 * __pyx_v_values.strides[1]) )));
} I don't know enough about cython or numpy to say why it's generating the load/store like this and what's to blame, though. Advice very much welcome and required at this point, as I'm stuck. |
Unaligned access is UB, even on x86. On arm, I hit SIGBUSes in pandas's test suite via pandas->pytables->c-blosc2 because of unaligned loads and stores. Modern compilers are capable of optimising the "slow" path bitshifts and memcpy into faster alternatives where it is legal. Bug: https://bugs.gentoo.org/911660 Bug: pandas-dev/pandas#54391 Bug: pandas-dev/pandas#54396 Signed-off-by: Sam James <[email protected]>
Unaligned access is UB, even on x86. UBsan will also detect this (-fsanitize=undefined or -fsanitize=alignment). On arm, I hit SIGBUSes in pandas's test suite via pandas->pytables->c-blosc2 because of unaligned loads and stores. Modern compilers are capable of optimising the "slow" path bitshifts and memcpy into faster alternatives where it is legal. Bug: https://bugs.gentoo.org/911660 Bug: pandas-dev/pandas#54391 Bug: pandas-dev/pandas#54396 Signed-off-by: Sam James <[email protected]>
Unaligned access is UB, even on x86. UBsan will also detect this (-fsanitize=undefined or -fsanitize=alignment). On arm, I hit SIGBUSes in pandas's test suite via pandas->pytables->c-blosc2 because of unaligned loads and stores. Modern compilers are capable of optimising the "slow" path bitshifts and memcpy into faster alternatives where it is legal. Bug: https://bugs.gentoo.org/911660 Bug: pandas-dev/pandas#54391 Bug: pandas-dev/pandas#54396 Signed-off-by: Sam James <[email protected]>
Unaligned access is UB, even on x86. UBsan will also detect this (-fsanitize=undefined or -fsanitize=alignment). On arm, I hit SIGBUSes in pandas's test suite via pandas->pytables->c-blosc2 because of unaligned loads and stores. Modern compilers are capable of optimising the "slow" path bitshifts and memcpy into faster alternatives where it is legal. Bug: https://bugs.gentoo.org/911660 Bug: pandas-dev/pandas#54391 Bug: pandas-dev/pandas#54396 Signed-off-by: Sam James <[email protected]>
Unaligned access is UB, even on x86. UBsan will also detect this (-fsanitize=undefined or -fsanitize=alignment). On arm, I hit SIGBUSes in pandas's test suite via pandas->pytables->c-blosc2 because of unaligned loads and stores. Modern compilers are capable of optimising the "slow" path bitshifts and memcpy into faster alternatives where it is legal. Bug: https://bugs.gentoo.org/911660 Bug: pandas-dev/pandas#54391 Bug: pandas-dev/pandas#54396 Signed-off-by: Sam James <[email protected]>
This bug is much older than that - it's been known in Debian since pandas 0.16, but since the response was to disable the tests in question, we don't know whether it's always existed since then. We also don't know whether it's a pandas bug or a pytables bug. I vaguely remember that unaligned access is a crash on only some ARM systems (depending on hardware and/or whether a "silently (but slowly) fix up unaligned access attempts" kernel setting is enabled). |
Fix some issues, warn on use and xfail tests for the remainder Everything that has a run=False xfail in here should also be in the run-and-ignore set in debian/tests/numbatests armhf TestHDF5Store::test*encoding only sometimes crashes (1.1.3+dfsg-1 passed on build but failed autopkgtest) HDF5 and Stata are known to fail on big-endian architectures Stata was previously seen to fail on qemu-ppc64el, but not real ppc64el Author: Andreas Tille <[email protected]>, Graham Inggs <[email protected]>, Yaroslav Halchenko <[email protected]>, Rebecca N. Palmer <[email protected]> Bug-Debian: https://bugs.debian.org/877419 Bug: partly pandas-dev/pandas#54396 Forwarded: no Gbp-Pq: Name xfail_tests_nonintel_io.patch
Fix some issues, warn on use and xfail tests for the remainder Everything that has a run=False xfail in here should also be in the run-and-ignore set in debian/tests/numbatests armhf TestHDF5Store::test*encoding only sometimes crashes (1.1.3+dfsg-1 passed on build but failed autopkgtest) HDF5 and Stata are known to fail on big-endian architectures Stata was previously seen to fail on qemu-ppc64el, but not real ppc64el Author: Andreas Tille <[email protected]>, Graham Inggs <[email protected]>, Yaroslav Halchenko <[email protected]>, Rebecca N. Palmer <[email protected]> Bug-Debian: https://bugs.debian.org/877419 Bug: partly pandas-dev/pandas#54396 Forwarded: no Gbp-Pq: Name xfail_tests_nonintel_io.patch
Fix some issues, warn on use and xfail tests for the remainder Everything that has a run=False xfail in here should also be in the run-and-ignore set in debian/tests/numbatests armhf TestHDF5Store::test*encoding only sometimes crashes (1.1.3+dfsg-1 passed on build but failed autopkgtest) HDF5 and Stata are known to fail on big-endian architectures Stata was previously seen to fail on qemu-ppc64el, but not real ppc64el Author: Andreas Tille <[email protected]>, Graham Inggs <[email protected]>, Yaroslav Halchenko <[email protected]>, Rebecca N. Palmer <[email protected]> Bug-Debian: https://bugs.debian.org/877419 Bug: partly pandas-dev/pandas#54396 Forwarded: no Gbp-Pq: Name xfail_tests_nonintel_io.patch
Fix some issues, warn on use and xfail tests for the remainder Everything that has a run=False xfail in here should also be in the run-and-ignore set in debian/tests/numbatests armhf TestHDF5Store::test*encoding only sometimes crashes (1.1.3+dfsg-1 passed on build but failed autopkgtest) HDF5 and Stata are known to fail on big-endian architectures Stata was previously seen to fail on qemu-ppc64el, but not real ppc64el Author: Andreas Tille <[email protected]>, Graham Inggs <[email protected]>, Yaroslav Halchenko <[email protected]>, Rebecca N. Palmer <[email protected]> Bug-Debian: https://bugs.debian.org/877419 Bug: partly pandas-dev/pandas#54396 Forwarded: no Gbp-Pq: Name xfail_tests_nonintel_io.patch
Fix some issues, warn on use and xfail tests for the remainder Everything that has a run=False xfail in here should also be in the run-and-ignore set in debian/tests/numbatests armhf TestHDF5Store::test*encoding only sometimes crashes (1.1.3+dfsg-1 passed on build but failed autopkgtest) HDF5 and Stata are known to fail on big-endian architectures Stata was previously seen to fail on qemu-ppc64el, but not real ppc64el Author: Andreas Tille <[email protected]>, Graham Inggs <[email protected]>, Yaroslav Halchenko <[email protected]>, Rebecca N. Palmer <[email protected]> Bug-Debian: https://bugs.debian.org/877419 Bug: partly pandas-dev/pandas#54396 Forwarded: no Gbp-Pq: Name xfail_tests_nonintel_io.patch
Fix some issues, warn on use and xfail tests for the remainder Everything that has a run=False xfail in here should also be in the run-and-ignore set in debian/tests/numbatests armhf TestHDF5Store::test*encoding only sometimes crashes (1.1.3+dfsg-1 passed on build but failed autopkgtest) HDF5 and Stata are known to fail on big-endian architectures Stata was previously seen to fail on qemu-ppc64el, but not real ppc64el Author: Andreas Tille <[email protected]>, Graham Inggs <[email protected]>, Yaroslav Halchenko <[email protected]>, Rebecca N. Palmer <[email protected]> Bug-Debian: https://bugs.debian.org/877419 Bug: partly pandas-dev/pandas#54396 Forwarded: no Gbp-Pq: Name xfail_tests_nonintel_io.patch
Fix some issues, warn on use and xfail tests for the remainder Everything that has a run=False xfail in here should also be in the run-and-ignore set in debian/tests/numbatests armhf TestHDF5Store::test*encoding only sometimes crashes (1.1.3+dfsg-1 passed on build but failed autopkgtest) HDF5 and Stata are known to fail on big-endian architectures Stata was previously seen to fail on qemu-ppc64el, but not real ppc64el Author: Andreas Tille <[email protected]>, Graham Inggs <[email protected]>, Yaroslav Halchenko <[email protected]>, Rebecca N. Palmer <[email protected]> Bug-Debian: https://bugs.debian.org/877419 Bug: partly pandas-dev/pandas#54396 Forwarded: no Gbp-Pq: Name xfail_tests_nonintel_io.patch
Fix some issues, warn on use and xfail tests for the remainder Everything that has a run=False xfail in here should also be in the run-and-ignore set in debian/tests/numbatests armhf TestHDF5Store::test*encoding only sometimes crashes (1.1.3+dfsg-1 passed on build but failed autopkgtest) HDF5 and Stata are known to fail on big-endian architectures Stata was previously seen to fail on qemu-ppc64el, but not real ppc64el Author: Andreas Tille <[email protected]>, Graham Inggs <[email protected]>, Yaroslav Halchenko <[email protected]>, Rebecca N. Palmer <[email protected]> Bug-Debian: https://bugs.debian.org/877419 Bug: partly pandas-dev/pandas#54396 Forwarded: no Gbp-Pq: Name xfail_tests_nonintel_io.patch
Fix some issues, warn on use and xfail tests for the remainder Everything that has a run=False xfail in here should also be in the run-and-ignore set in debian/tests/numbatests armhf TestHDF5Store::test*encoding only sometimes crashes (1.1.3+dfsg-1 passed on build but failed autopkgtest) HDF5 and Stata are known to fail on big-endian architectures Stata was previously seen to fail on qemu-ppc64el, but not real ppc64el Author: Andreas Tille <[email protected]>, Graham Inggs <[email protected]>, Yaroslav Halchenko <[email protected]>, Rebecca N. Palmer <[email protected]> Bug-Debian: https://bugs.debian.org/877419 Bug: partly pandas-dev/pandas#54396 Forwarded: no Gbp-Pq: Name xfail_tests_nonintel_io.patch
Fix some issues, warn on use and xfail tests for the remainder Everything that has a run=False xfail in here should also be in the run-and-ignore set in debian/tests/numbatests armhf TestHDF5Store::test*encoding only sometimes crashes (1.1.3+dfsg-1 passed on build but failed autopkgtest) HDF5 and Stata are known to fail on big-endian architectures Stata was previously seen to fail on qemu-ppc64el, but not real ppc64el Author: Andreas Tille <[email protected]>, Graham Inggs <[email protected]>, Yaroslav Halchenko <[email protected]>, Rebecca N. Palmer <[email protected]> Bug-Debian: https://bugs.debian.org/877419 Bug: partly pandas-dev/pandas#54396 Forwarded: no Gbp-Pq: Name xfail_tests_nonintel_io.patch
Fix some issues, warn on use and xfail tests for the remainder Everything that has a run=False xfail in here should also be in the run-and-ignore set in debian/tests/numbatests armhf TestHDF5Store::test*encoding only sometimes crashes (1.1.3+dfsg-1 passed on build but failed autopkgtest) HDF5 and Stata are known to fail on big-endian architectures Stata was previously seen to fail on qemu-ppc64el, but not real ppc64el Author: Andreas Tille <[email protected]>, Graham Inggs <[email protected]>, Yaroslav Halchenko <[email protected]>, Rebecca N. Palmer <[email protected]> Bug-Debian: https://bugs.debian.org/877419 Bug: partly pandas-dev/pandas#54396 Forwarded: no Gbp-Pq: Name xfail_tests_nonintel_io.patch
Fix some issues, warn on use and xfail tests for the remainder Everything that has a run=False xfail in here should also be in the run-and-ignore set in debian/tests/numbatests armhf TestHDF5Store::test*encoding only sometimes crashes (1.1.3+dfsg-1 passed on build but failed autopkgtest) HDF5 and Stata are known to fail on big-endian architectures Stata was previously seen to fail on qemu-ppc64el, but not real ppc64el Author: Andreas Tille <[email protected]>, Graham Inggs <[email protected]>, Yaroslav Halchenko <[email protected]>, Rebecca N. Palmer <[email protected]> Bug-Debian: https://bugs.debian.org/877419 Bug: partly pandas-dev/pandas#54396 Forwarded: no Gbp-Pq: Name xfail_tests_nonintel_io.patch
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
See also #54391.
The
pandas/tests/io/pytables/test_append.py::test_append_frame_column_oriented
andpandas/tests/io/pytables/test_store.py::test_select_filter_corner
tests SIGBUS for me on arm (arm64 host, armv7 chroot).When building with UBSAN (
-fsanitize=undefined
), I get the following forpandas/tests/io/pytables/test_append.py::test_append_frame_column_oriented
:and for
pandas/tests/io/pytables/test_store.py::test_select_filter_corner
:Expected Behavior
All tests pass.
Installed Versions
INSTALLED VERSIONS
commit : 0f43794
python : 3.11.4.final.0
python-bits : 32
OS : Linux
OS-release : 5.15.117-gentoo-dist
Version : #1 SMP Wed Jun 14 13:14:49 -00 2023
machine : armv8l
processor : ARMv8 Processor rev 1 (v8l)
byteorder : little
LC_ALL : None
LANG : C.UTF8
LOCALE : en_US.UTF-8
pandas : 2.0.3
numpy : 1.25.2
pytz : 2023.3
dateutil : 2.8.2
setuptools : 68.0.0
pip : None
Cython : 3.0.0
pytest : 7.4.0
hypothesis : 6.82.0
sphinx : None
blosc : 1.11.1
feather : None
xlsxwriter : 3.1.2
lxml.etree : 4.9.3
html5lib : 1.1
pymysql : 1.4.6
psycopg2 : 2.9.4
jinja2 : 3.1.2
IPython : None
pandas_datareader: None
bs4 : 4.12.2
bottleneck : 1.3.7
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.7.2
numba : None
numexpr : 2.8.4
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.11.1
snappy : None
sqlalchemy : 2.0.19
tables : 3.8.0
tabulate : 0.9.0
xarray : 2023.7.0
xlrd : 2.0.1
zstandard : None
tzdata : None
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: