Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Fix wrong d_u32align probe, esp. for intel 64bit #116

Closed
rurban opened this issue Mar 27, 2016 · 0 comments
Closed

Fix wrong d_u32align probe, esp. for intel 64bit #116

rurban opened this issue Mar 27, 2016 · 0 comments
Assignees

Comments

@rurban
Copy link
Member

rurban commented Mar 27, 2016

Intel CPU do allow unaligned access to word pointers, which allows more cache sensitive code, but is 2x slower on out of cache memory access.

perl5 core took over the wrong Digest-MD5 probe in 2001 with 4e0554e which produced the wrong strict result on intel 64bit, and it was never checked.

My fix adds a SIGBUS on intel (with gnu c compatible compilers: gcc, clang, icc) when accessing unaligned word pointers. To help finding regressions on strict machines, which are rarely tested, and to help performance on intel with U32_ALIGNMENT_REQUIRED, which is not yet used, but needed e.g. for hash or assembly functions.

See also

@rurban rurban self-assigned this Mar 27, 2016
rurban pushed a commit that referenced this issue Mar 27, 2016
perl5 core took over the wrong Digest-MD5 probe in 2001
with 4e0554e
which produced the wrong strict result on intel 64bit, and it was
never checked.

This fix also adds a SIGBUS on intel (with gnu c compatible compilers:
gcc, clang, icc) when accessing unaligned word pointers, d_u32align is
enforced. To help finding regressions on strict machines, which are
rarely tested, and to help performance on intel with
U32_ALIGNMENT_REQUIRED, which is not yet used, but needed e.g. for hash
or assembly functions.

Re-order the two Configure alignment probes.

Fixes GH #116
rurban pushed a commit that referenced this issue Mar 27, 2016
Fix wrong strict alignment probe for intel 64bit.
Adds a SIGBUS on intel for -DU32_ALIGNMENT_REQUIRED.
Adds now coverage for the previously never tested branch
for -UU32_ALIGNMENT_REQUIRED.

See GH #116.
@rurban rurban closed this as completed Mar 27, 2016
rurban added a commit that referenced this issue Aug 27, 2018
4.06 2018-08-22 (rurban)
        - Fix overloaded eq/ne comparisons (GH #116 by demerphq, GH #117 by Graham Knopp):
          detect strings, protect from endless recursion. false is now ne "True".
          clarify eq/ne rules in the docs.

4.05 2018-08-19 (rurban)
        - Set decoded type (PR #115 by Pali)
        - Add json_type_weaken (PR #114 by Pali)
        - Fix tests for 5.6 (rurban, pali)

4.04 2018-06-22 (rurban)
        - Fix bignum NaN/inf handling (#78 reported by Slaven Rezic)
        - Move author tests to xt/ as suggested in #106, added a make xtest target.
          Fixes a test fail with ASAN.

4.03 2018-06-21 (rurban)
        - Add sereal cpanel_json_xs type (#110 James Rouzier)
        - Fix bencode/bdecode methods in cpanel_json_xs (#111 Fulvio Scapin)
        - Overload ne operator for JSON::PP::Boolean (#107 tevfik1903)
        - Add a missing semicolon to a documentation example (#104 E. Choroba)

4.02 2018-02-27 (rurban)
        - Add encoder indent_length method (#103 rouzier), previously
          hard-coded to 3.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant