Skip to content

Undocumented error 12058 #1998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: docs
Choose a base branch
from

Conversation

nikita-leontiev
Copy link

Undocumented error 12058 can occur when FtpOpenFile function fails due to a lack of available local ports.
Test case: copying several thousand small files to FTP.
Process Monitor detects access to previously closed TCP connection that is in TIME-WAIT state:

0:17:47,8285716	JustManager.exe	4664	TCP Connect	PC:49413 -> PC:49414	SUCCESS	Length: 0, mss: 1460, sackopt: 1, tsopt: 0, wsopt: 1, rcvwin: 8192, rcvwinscale: 8, sndwinscale: 8, seqnum: 0, connid: 0
0:17:47,8293569	JustManager.exe	4664	TCP Send	PC:49413 -> PC:49414	SUCCESS	Length: 48, startime: 22569, endtime: 22569, seqnum: 0, connid: 0
0:17:47,8296001	JustManager.exe	4664	TCP Disconnect	PC:49413 -> PC:49414	SUCCESS	Length: 0, seqnum: 0, connid: 0
0:18:08,9520409	JustManager.exe	4664	TCP Disconnect	PC:49413 -> PC:49414	SUCCESS	Length: 0, seqnum: 0, connid: 0

Callstack:

0	ntoskrnl.exe	CcMdlWriteAbort + 0x1ef3	0xfffff8000316c833	C:\Windows\system32\ntoskrnl.exe
1	tcpip.sys	tcpip.sys + 0xba330	0xfffff880016bf330	C:\Windows\System32\drivers\tcpip.sys
2	tcpip.sys	tcpip.sys + 0x7ade4	0xfffff8800167fde4	C:\Windows\System32\drivers\tcpip.sys
3	tcpip.sys	tcpip.sys + 0x7707b	0xfffff8800167c07b	C:\Windows\System32\drivers\tcpip.sys
4	tcpip.sys	tcpip.sys + 0x76327	0xfffff8800167b327	C:\Windows\System32\drivers\tcpip.sys
5	tcpip.sys	tcpip.sys + 0x762b4	0xfffff8800167b2b4	C:\Windows\System32\drivers\tcpip.sys
6	tcpip.sys	tcpip.sys + 0x79a5c	0xfffff8800167ea5c	C:\Windows\System32\drivers\tcpip.sys
7	tcpip.sys	tcpip.sys + 0x78e33	0xfffff8800167de33	C:\Windows\System32\drivers\tcpip.sys
8	tcpip.sys	tcpip.sys + 0x7998e	0xfffff8800167e98e	C:\Windows\System32\drivers\tcpip.sys
9	tdx.sys	tdx.sys + 0x545d	0xfffff88003d5345d	C:\Windows\system32\DRIVERS\tdx.sys
10	tdx.sys	tdx.sys + 0x3c3d	0xfffff88003d51c3d	C:\Windows\system32\DRIVERS\tdx.sys
11	AMonTDLH.sys	IAnfdTDSetRemoteIpPortV4V6 + 0x2dc1	0xfffff88003d88871	C:\Windows\system32\Drivers\AMonTDLH.sys
12	AMonTDLH.sys	IAnfdTDSetRemoteIpPortV4V6 + 0x2caf	0xfffff88003d8875f	C:\Windows\system32\Drivers\AMonTDLH.sys
13	AMonTDLH.sys	AMonTDLH.sys + 0x351a	0xfffff88003d8051a	C:\Windows\system32\Drivers\AMonTDLH.sys
14	AMonTDLH.sys	IAnfdTDSetRemoteIpPortV4V6 + 0x684	0xfffff88003d86134	C:\Windows\system32\Drivers\AMonTDLH.sys
15	AMonTDLH.sys	IAnfdTDSetRemoteIpPortV4V6 + 0x807	0xfffff88003d862b7	C:\Windows\system32\Drivers\AMonTDLH.sys
16	AMonTDLH.sys	IAnfdTDSetRemoteIpPortV4V6 + 0xa47	0xfffff88003d864f7	C:\Windows\system32\Drivers\AMonTDLH.sys
17	AMonTDLH.sys	IAnfdTDSetRemoteIpPortV4V6 + 0x5847	0xfffff88003d8b2f7	C:\Windows\system32\Drivers\AMonTDLH.sys
18	AMonTDLH.sys	IAnfdTDSetRemoteIpPortV4V6 + 0x8eb	0xfffff88003d8639b	C:\Windows\system32\Drivers\AMonTDLH.sys
19	afd.sys	afd.sys + 0x582bb	0xfffff88003f202bb	C:\Windows\system32\drivers\afd.sys
20	ntoskrnl.exe	CcCopyRead + 0x4aa	0xfffff800033031fa	C:\Windows\system32\ntoskrnl.exe
21	ntoskrnl.exe	NtQueryVolumeInformationFile + 0x1251	0xfffff800034c08b1	C:\Windows\system32\ntoskrnl.exe
22	ntoskrnl.exe	NtDeviceIoControlFile + 0x56	0xfffff800033513c6	C:\Windows\system32\ntoskrnl.exe
23	ntoskrnl.exe	longjmp + 0x5bf3	0xfffff800030a9f53	C:\Windows\system32\ntoskrnl.exe
24	wow64cpu.dll	TurboDispatchJumpAddressEnd + 0x6c0	0x74b52e09	C:\Windows\SYSTEM32\wow64cpu.dll
25	wow64cpu.dll	TurboDispatchJumpAddressEnd + 0x1fb	0x74b52944	C:\Windows\SYSTEM32\wow64cpu.dll
26	wow64.dll	Wow64SystemServiceEx + 0x1ce	0x74bcd286	C:\Windows\SYSTEM32\wow64.dll
27	wow64.dll	Wow64LdrpInitialize + 0x42a	0x74bcc69e	C:\Windows\SYSTEM32\wow64.dll
28	ntdll.dll	longjmp + 0x2cbe4	0x773d9824	C:\Windows\SYSTEM32\ntdll.dll
29	ntdll.dll	LdrInitializeThunk + 0xe	0x7738373e	C:\Windows\SYSTEM32\ntdll.dll
30	ntdll.dll	ZwDeviceIoControlFile + 0x15	0x7751f921	C:\Windows\SysWOW64\ntdll.dll
31	mswsock.dll	mswsock.dll + 0x6587	0x74986587	C:\Windows\SysWOW64\mswsock.dll
32	mswsock.dll	mswsock.dll + 0x5f90	0x74985f90	C:\Windows\SysWOW64\mswsock.dll
33	mswsock.dll	mswsock.dll + 0x5d88	0x74985d88	C:\Windows\SysWOW64\mswsock.dll
34	WS2_32.dll	connect + 0x52	0x765d6947	C:\Windows\syswow64\WS2_32.dll
35	WININET.dll	RegisterUrlCacheNotification + 0x9e29	0x76010799	C:\Windows\syswow64\WININET.dll
36	WININET.dll	InternetQueryFortezzaStatus + 0x2017	0x75fb2227	C:\Windows\syswow64\WININET.dll
37	WININET.dll	InternetFindNextFileW + 0x5035	0x75fbe575	C:\Windows\syswow64\WININET.dll
38	WININET.dll	InternetFindNextFileW + 0x4b63	0x75fbe0a3	C:\Windows\syswow64\WININET.dll
39	WININET.dll	InternetFindNextFileW + 0x5de4	0x75fbf324	C:\Windows\syswow64\WININET.dll
40	WININET.dll	InternetFindNextFileW + 0xf45	0x75fba485	C:\Windows\syswow64\WININET.dll
41	WININET.dll	FtpSetCurrentDirectoryA + 0x14ef	0x75fb6d6f	C:\Windows\syswow64\WININET.dll
42	WININET.dll	FtpOpenFileA + 0x5b	0x75fb548b	C:\Windows\syswow64\WININET.dll

Quite often this error is accompanied by event 4227 (EVENT_TCPIP_TCP_TIME_WAIT_COLLISION).
Error detected on Windows 7 SP1 x64.

Need to be checked by someone with access to WinINet code. Obviously, this error should be added to Wininet.h and described in wininet-errors article.

Copy link

@nikita-leontiev : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants