[wp-trac] [WordPress Trac] #47186: At least one function in /wp-includes/sodium_compat/src/Core32 times out on 32 bit servers
WordPress Trac
noreply at wordpress.org
Tue May 14 02:14:59 UTC 2019
#47186: At least one function in /wp-includes/sodium_compat/src/Core32 times out on
32 bit servers
-------------------------------------+-------------------------------------
Reporter: lovingboth | Owner:
| paragoninitiativeenterprises
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 5.2.1
Component: Upgrade/Install | Version: 5.2
Severity: normal | Resolution:
Keywords: needs-testing has-patch | Focuses:
commit |
-------------------------------------+-------------------------------------
Comment (by dd32):
Thanks @paragoninitiativeenterprises!
Running a few tests, I'm seeing
`ParagonIE_Sodium_Compat::runtime_speed_test(100, 10)` not return true,
even on the DigitalOcean VM used above.
100 iterations seems to take ~25ms on the DigitalOcean, and ~150ms on the
pi (Both above the 10ms maxTimeout). I would probably suggest lowering it
to 25 iterations, which comes in at ~5ms on DO and ~35ms on the Pi.
Alternatively, if the function was switched from `mulInt64` to
`mulInt64Fast` (Since that's the function WordPress ends up using) seems
to be a good test in this case, as DO is 1ms @ 100iterations, while the Pi
is 50ms @ 100iterations. Seems like it's testing a different CPU path that
is more constrained at least on this architecture.
To keep the ticket up to date, I've also commented on the PR:
https://github.com/paragonie/sodium_compat/pull/90/files#r283589471
> Although this isn't a problem right now, FYI this might have a problem
in the future with PHP's Dead-Code Elimination optimiser. I've looked at
the optimised opcodes at present and it seems OK for now.
>
> See https://www.youtube.com/watch?v=WJJKZM8bruQ#t=28m10s &
http://talks.php.net/etsy18#/dce for some examples.
That fits into my earlier comment of `I think there's a high chance that
recent PHP's would optimise it out if done wrong`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47186#comment:35>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list