Bug 25437
Summary: | tcmalloc/Windows bug can cause random GetLastError() failures. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Mike Belshe <mbelshe> |
Component: | Platform | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ahmad.saleem792, don.olmstead, fujii.hironori, mrowe |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | Windows XP |
Mike Belshe
The latest release of tcmalloc for windows picks up an easy bug fix which can effect windows builds:
TlsGetValue() will call SetLastError(0). If you have code which looks like:
MakeSomeWindowsCall(foo());
if (GetLastError()) { ... }
if foo() returns something which needs to be destructed, that can call into tcmalloc, which will use thread-local-storage, which will SetLastError(0).
Fix: When calling TlsGetValue, do this:
err = GetLastError()
TlsGetValue()
SetLastError(err)
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
If I search for 'TlsGetValue' in current code on GitHub, it is only in third party code like libwebrtc and ANGLE and not in WebKit / WebCore.
https://searchfox.org/wubkat/search?q=TlsGetValue&path=&case=false®exp=false
@Fuji - just to get your input since it mentions 'Window'. Do we have any such impact or we can close this?