- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a problem trying to start my pintool built with WinSock library (ws2_32.lib) - it immediately exits with message "Failure to open DLL file WS2_32.dll".
I've prepared a simple pintool to illistrate the problem:
//----------------------------------------------------------
#include "pin.H"
namespace WINDOWS
{
#include <Ws2tcpip.h>
void *p = WSAStartup;
};
int main(int argc, char *argv[])
{
if (PIN_Init(argc, argv)) return 1;
PIN_StartProgram();
return 0;
}
I've placed this file to a subdirectory of source\tools, added to makefile.rules the following line
TOOL_LIBS := ${TOOL_LIBS} ws2_32.lib
built the pintool
make -B TARGET=ia32
then tried to run with the following command:
..\..\..\pin.exe -t obj-ia32\sock_tool.dll -- c:\windows\System32\cmd /c echo ****** started Ok ******
and have got the following message:
E: Failure to open DLL file Z:\pin-2.14-71313\source\tools\sock_tool\obj-ia32\WS2_32.dll
E: System error 2 : The system cannot find the file specified.
E: Failure to initialize DLL Z:\pin-2.14-71313\source\tools\sock_tool\obj-ia32\sock_tool.dll
E: See preceding message to find out the reason
Could you please explain me what I'm doing wrong?
With the previous versions of PIN this pintool works Ok.
When I remove the line "void *p = WSAStartup;" from the source and rebuild the pintool works Ok with pin-2.14-71313 too.
Any help would be greatly appreciated.
Thanks in advance,
Pavel
OS: Windows 7
compiler: Visual Studio 2010
- Tags:
- Intel® Advanced Vector Extensions (Intel® AVX)
- Intel® Streaming SIMD Extensions
- Parallel Computing
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems that you have aproblem with path related to winsock dll location,
Can you create test project which uses Ws2tcpip.h?
I have also seen that call to WSAStartup returns void pointer, but in documentation return type is address of WSADATA structure which is passed as a function parameter. Maybe this is the reason for the failure.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms742213%28v=vs.85%29.aspx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Guys,
Pin support stuff is handled on the pinheads yahoo group:
https://groups.yahoo.com/neo/groups/pinheads/info
It is monitored by the pin developers and many users.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
iliyapolak wrote:
It seems that you have aproblem with path related to winsock dll location,
No problem with path - the same pintool built with the previous version of PIN works Ok
iliyapolak wrote:
Can you create test project which uses Ws2tcpip.h?
I have also seen that call to WSAStartup returns void pointer, but in documentation return type is address of WSADATA structure which is passed as a function parameter. Maybe this is the reason for the failure.
WSAStartup is not called there, I just assigned its address to a void pointer to have a reference to w2_3.dll
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may try to run pintools under windbg with loader snaps enabled. You may get more comprehensive error description.
http://blogs.msdn.com/b/junfeng/archive/2006/11/20/debugging-loadlibrary-failures.aspx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, I'll try. In any case this is a useful link for me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Btw, you can put breakpoint on address assignment to void pointer and observe in windbg if address of WSAStartup was resolved properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mark,
Mark Charney (Intel) wrote:
Pin support stuff is handled on the pinheads yahoo group:
https://groups.yahoo.com/neo/groups/pinheads/info
It is monitored by the pin developers and many users.
I've asked them before but have no answer. Strange, because this looks like a bug in PIN toolkit, as for me.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page