Bug 14025 – unittests for memoize fail intermittently

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-01-22T08:06:00Z
Last change time
2015-02-18T03:41:27Z
Keywords
pull
Assigned to
nobody
Creator
r.sagitario

Comments

Comment #0 by r.sagitario — 2015-01-22T08:06:12Z
The phobos unittest for memoize fails rather often, lately. core.exception.AssertError@std\functional.d(1092): unittest failure It seems there's some issue with the initialization check in memoize: immutable idx1 = hash % maxSize; if (!bts(initialized.ptr, idx1)) return emplace(&memo[idx1], args, fun(args)).res; else if (memo[idx1].args == args) return memo[idx1].res; If the same hash happens to be used as one up the recursion chain, initialized is already set, but arguments in memo[idx1].args are still garbage from the GC.malloc call. If they happen to be identical to the current arguments, an uninitialized result is returned. It's mostly on Win64, but I've seen it on Win32, too.
Comment #1 by r.sagitario — 2015-01-24T09:07:08Z
Comment #2 by github-bugzilla — 2015-01-24T17:55:07Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/a5b1f5bcaa15ee34c731487f601391a759bf5963 Merge pull request #2901 from rainers/issue14025 fix Issue 14025 - unittests for memoize fail intermittently
Comment #3 by github-bugzilla — 2015-02-18T03:41:27Z