New issue
Advanced search Search tips

Issue 669593 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug

Blocking:
issue 644385



Sign in to add a comment

WSAGetLastError must be called immediately after failing function

Project Member Reported by siggi@chromium.org, Nov 29 2016

Issue description

Per https://msdn.microsoft.com/en-us/library/windows/desktop/ms741580(v=vs.85).aspx:

If a function call's return value indicates that error or other relevant data was returned in the error code, WSAGetLastError should be called immediately. This is necessary because some functions may reset the last extended error code to 0 if they succeed, overwriting the extended error code returned by a previously failed function.

Some of the code in tcp_socket_win.cc is wrapped in instrumentation that may or may not, now or in the future, stomp the per-thread error value.

 

Comment 1 by siggi@chromium.org, Nov 29 2016

Blocking: 644385
This is blocking my heap instrumentation CL https://codereview.chromium.org/2386123003/.
Project Member

Comment 2 by bugdroid1@chromium.org, Nov 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6c48fe45a7573eef954f031a0ce4e42264427761

commit 6c48fe45a7573eef954f031a0ce4e42264427761
Author: siggi <siggi@chromium.org>
Date: Tue Nov 29 21:34:02 2016

Call WSAGetLastError immediately after the potentially failing call.

BUG= 669593 

Review-Url: https://codereview.chromium.org/2539833003
Cr-Commit-Position: refs/heads/master@{#435080}

[modify] https://crrev.com/6c48fe45a7573eef954f031a0ce4e42264427761/net/socket/tcp_socket_win.cc

Comment 3 by siggi@chromium.org, Dec 2 2016

Status: Fixed (was: Started)

Sign in to add a comment