Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 510538 Details for
Bug 636400
dev-lang/python-3.5.4: test failures on sparc (test_ctypes test_datetime test_hash test_plistlib test_strptime test_time)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
hashlib patch for 3.5.4-r1
hash-unaligned-3.5.patch (text/plain), 1.42 KB, created by
Rolf Eike Beer
on 2017-12-17 21:12:03 UTC
(
hide
)
Description:
hashlib patch for 3.5.4-r1
Filename:
MIME Type:
Creator:
Rolf Eike Beer
Created:
2017-12-17 21:12:03 UTC
Size:
1.42 KB
patch
obsolete
>The hash implementation casts the input pointer to uint64_t* and directly reads >from this, which may cause unaligned accesses. Use memcpy() instead so this code >will not crash with SIGBUS on sparc. > >--- a/Python/pyhash.c 2017-11-29 10:21:20.283094068 +0100 >+++ b/Python/pyhash.c 2017-11-29 10:24:26.733087813 +0100 >@@ -372,7 +372,7 @@ siphash24(const void *src, Py_ssize_t sr > PY_UINT64_T k0 = _le64toh(_Py_HashSecret.siphash.k0); > PY_UINT64_T k1 = _le64toh(_Py_HashSecret.siphash.k1); > PY_UINT64_T b = (PY_UINT64_T)src_sz << 56; >- const PY_UINT64_T *in = (PY_UINT64_T*)src; >+ const PY_UINT8_T *in = (PY_UINT8_T*)src; > > PY_UINT64_T v0 = k0 ^ 0x736f6d6570736575ULL; > PY_UINT64_T v1 = k1 ^ 0x646f72616e646f6dULL; >@@ -381,12 +381,14 @@ siphash24(const void *src, Py_ssize_t sr > > PY_UINT64_T t; > PY_UINT8_T *pt; >- PY_UINT8_T *m; >+ const PY_UINT8_T *m; > > while (src_sz >= 8) { >- PY_UINT64_T mi = _le64toh(*in); >- in += 1; >- src_sz -= 8; >+ PY_UINT64_T mi; >+ memcpy(&mi, in, sizeof(mi)); >+ mi = _le64toh(mi); >+ in += sizeof(mi); >+ src_sz -= sizeof(mi); > v3 ^= mi; > DOUBLE_ROUND(v0,v1,v2,v3); > v0 ^= mi; >@@ -394,7 +396,7 @@ siphash24(const void *src, Py_ssize_t sr > > t = 0; > pt = (PY_UINT8_T *)&t; >- m = (PY_UINT8_T *)in; >+ m = in; > switch (src_sz) { > case 7: pt[6] = m[6]; > case 6: pt[5] = m[5];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 636400
:
501990
|
503500
|
503502
|
507212
| 510538