Skip to content
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

test_dtype misaligned address #2325

Open
schwehr opened this issue Oct 11, 2023 · 0 comments
Open

test_dtype misaligned address #2325

schwehr opened this issue Oct 11, 2023 · 0 comments

Comments

@schwehr
Copy link

schwehr commented Oct 11, 2023

To assist reproducing bugs, please include the following:

  • Operating System (e.g. Windows 10, MacOS 10.11, Ubuntu 20.04.2 LTS, CentOS 7)

Linux derived from Debian Testing

  • Python version (e.g. 3.10)

3.10 (and I saw this in 3.8 and 3.9)

  • Where Python was acquired (e.g. system Python on MacOS or Linux, Anaconda on
    Windows)

Custom

  • h5py version (e.g. 3.9)
    • 389eb5f
    • closest_version: "3.8.0-aarch64-wheels"

Cython version:

  • version: 5cef4fa97285b32d1e7d78c57398c464106d14ab
  • closest_version: "0.29.35"

with a custom build using bazel / llvm with options:

--config=asan --copt=-fno-sanitize=all --copt=-fsanitize=alignment --copt=-fno-sanitize-trap=alignment

  • HDF5 version (e.g. 1.12.2)

    • version: f676115295975bf3abbfdee63fb9d7955b8e1fd7
    • closest_version: "hdf5-1.12.1-rc1"
  • The full traceback/stack trace shown (if it appears)

k8-asan-fastbuild/genfiles/third_party/py/h5py/_conv.pyx_cython_generated.cc:8696:27: runtime error: load of misaligned address 0x60700097bcfb for type 'PyObject *' (aka '_object *'), which requires 8 byte alignment
0x60700097bcfb: note: pointer points here
 60  00 00 01 20 0a 43 00 80  60 00 00 00 ab ab ab ab  ab ab ab ab ab ab ab ab  ab ab ab ab ab ab ab
              ^ 
    #0 0x7f05f88dd0c8 in __pyx_f_4h5py_5_conv_ndarray2vlen(long, long, H5T_cdata_t*, unsigned long, unsigned long, unsigned long, void*, void*, long) blaze-out/k8-asan-fastbuild/genfiles/third_party/py/h5py/_conv.pyx_cython_generated.cc:8696:27
    #1 0x561d4c1c45c1 in H5T_convert third_party/hdf5/src/H5T.c:5395:13
    #2 0x561d4c1d1a78 in H5T__conv_struct third_party/hdf5/src/H5Tconv.c:2340:29
    #3 0x561d4c1c4665 in H5T_convert third_party/hdf5/src/H5T.c:5399:14
    #4 0x561d4c1c447b in H5Tconvert third_party/hdf5/src/H5T.c:3021:9
    #5 0x7f05f91746f0 in __pyx_f_4h5py_4defs_H5Tconvert(long, long, unsigned long, void*, void*, long) blaze-out/k8-asan-fastbuild/genfiles/third_party/py/h5py/defs.pyx_cython_generated.cc:44777:21
    #6 0x7f05f52e4c23 in __pyx_f_4h5py_6_proxy_dset_rw(long, long, long, long, long, void*, int) blaze-out/k8-asan-fastbuild/genfiles/third_party/py/h5py/_proxy.pyx_cython_generated.cc:3075:21
    #7 0x7f05f4ec120e in __pyx_pf_4h5py_3h5d_9DatasetID_2write blaze-out/k8-asan-fastbuild/genfiles/third_party/py/h5py/h5d.pyx_cython_generated.cc:4887:15
    #8 0x7f05f4ec120e in __pyx_pw_4h5py_3h5d_9DatasetID_3write(_object*, _object*, _object*) blaze-out/k8-asan-fastbuild/genfiles/third_party/py/h5py/h5d.pyx_cython_generated.cc:4734:13

A note from the engineer who found this:

Lots of unaligned access code (e.g. packed attribute, using an unaligned slice of char array as an uint32_t) should be avoided in the first place. Some deliberate ones can be fixed by using memcpy (the compiler is smart enough to optimize out the function call)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant