Skip to content

Commit

Permalink
fix issue #72: Hang when vswhere produces no output
Browse files Browse the repository at this point in the history
close write handle before reading from the pipe
  • Loading branch information
rainers committed Mar 27, 2022
1 parent c99df6c commit 80b94fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mspdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ bool tryLoadMsPdbVSWhere(const char* mspdb)
{
CloseHandle(processInformation.hProcess);
CloseHandle(processInformation.hThread);
CloseHandle(write);

DWORD length;
if (ReadFile(read, buffer, sizeof(buffer) - 1, &length, NULL))
Expand All @@ -210,8 +211,9 @@ bool tryLoadMsPdbVSWhere(const char* mspdb)
vsPath += buffer;
}
}
else
CloseHandle(write);
CloseHandle(read);
CloseHandle(write);
rtrim(vsPath);
if (vsPath.empty())
return false;
Expand Down

5 comments on commit 80b94fb

@rainers
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dscho !

Triggering a new pipeline for cv2pdb after this commit causes unrelated failures, see https://github.com/rainers/cv2pdb/runs/5708788385?check_suite_focus=true#step:5:30

gcc -g -O2 -shared -o split-dwarf.dll split.c
C:/git-sdk-64-minimal/mingw64/bin/ld.exe: cannot find -lgcc_s: No such file or directory

I suspect this is related to recent changes to the git-for-windows/setup-git-for-windows-sdk@v1
action. Any idea what's going on? Does this need another action now? Thanks.

@dscho
Copy link
Contributor

@dscho dscho commented on 80b94fb Mar 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh whoops, sorry! I'll work on this right now.

@dscho
Copy link
Contributor

@dscho dscho commented on 80b94fb Mar 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once https://dev.azure.com/Git-for-Windows/git/_build/results?buildId=96838 finishes (these builds typically need between 30-45 minutes), this should be resolved. (If you're curious, this is the fix.)

@rainers
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @dscho. Tests are passing again 👍 .

@dscho
Copy link
Contributor

@dscho dscho commented on 80b94fb Mar 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @dscho. Tests are passing again 👍 .

Excellent! FWIW I added a minimal test to that Pipeline that verifies that we can still build DLLs with the minimal Git for Windows SDK, to prevent similar regressions in the future (see this build).

Please sign in to comment.