Key creation problem with 2.1.16

Justus Winter justus at g10code.com
Tue Jan 31 11:38:08 CET 2017


Carola Grunwald <caro at nymph.paranoici.org> writes:

> And there's no reason to run any test suite. Just start the agent and
> wait. In the end there'll be two blocked libnpth-0 dlls.

"Two blocked libnpth-0 dlls"?  Do you mean two threads within the
gpg-agent.exe process?

> Their threads' call stack dumps:
>
> ntoskrnl.exe!SeAccessCheckWithHint+0xb4a
> ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x7d2
> ntoskrnl.exe!KeWaitForMutexObject+0x19f
> ntoskrnl.exe!PsIsSystemProcess+0x94
> ntoskrnl.exe!KeStackAttachProcess+0x11c1
> ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x9dd
> ntoskrnl.exe!KeWaitForMutexObject+0x19f
> ntoskrnl.exe!NtWaitForSingleObject+0xb2
> ntoskrnl.exe!KeSynchronizeExecution+0x3a43
> wow64cpu.dll!TurboDispatchJumpAddressEnd+0x690
> wow64cpu.dll!TurboDispatchJumpAddressEnd+0x484
> wow64.dll!Wow64SystemServiceEx+0x1ce
> wow64.dll!Wow64LdrpInitialize+0x429
> ntdll.dll!LdrGetProcedureAddress+0x24127
> ntdll.dll!LdrInitializeThunk+0xe
> ntdll.dll!NtWaitForSingleObject+0x15
> ntdll.dll!RtlIntegerToUnicodeString+0x20b
> libnpth-0.dll!npth_clock_gettime+0x18f
> libnpth-0.dll!npth_protect+0x1b
> gpg-agent.exe+0x1594
> libassuan-0.dll!assuan_get_assuan_log_prefix+0x169b
> libassuan-0.dll!assuan_socket_connect+0x47e
> gpg-agent.exe+0x1e5c
> ntdll.dll!RtlInitializeExceptionChain+0x63
> ntdll.dll!RtlInitializeExceptionChain+0x36
>
> and
>
> ntoskrnl.exe!SeAccessCheckWithHint+0xb4a
> ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x7d2
> ntoskrnl.exe!KeWaitForMutexObject+0x19f
> ntoskrnl.exe!PsIsSystemProcess+0x94
> ntoskrnl.exe!KeStackAttachProcess+0x11c1
> ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x9dd
> ntoskrnl.exe!KeWaitForMutexObject+0x19f
> ntoskrnl.exe!NtWaitForSingleObject+0xb2
> ntoskrnl.exe!KeSynchronizeExecution+0x3a43
> wow64cpu.dll!TurboDispatchJumpAddressEnd+0x690
> wow64cpu.dll!TurboDispatchJumpAddressEnd+0x484
> wow64.dll!Wow64SystemServiceEx+0x1ce
> wow64.dll!Wow64LdrpInitialize+0x429
> ntdll.dll!LdrGetProcedureAddress+0x24127
> ntdll.dll!LdrInitializeThunk+0xe
> ntdll.dll!NtWaitForSingleObject+0x15
> mswsock.dll+0x678c
> mswsock.dll+0x461c
> libassuan-0.dll!__assuan_read+0x11f
> libassuan-0.dll!assuan_free+0x3a2
> libassuan-0.dll!assuan_get_assuan_log_prefix+0xd4f
> libassuan-0.dll!assuan_get_assuan_log_prefix+0x1dc9
> libassuan-0.dll!assuan_sock_check_nonce+0x21
> gpg-agent.exe+0x2bfc
> ntdll.dll!RtlInitializeExceptionChain+0x63
> ntdll.dll!RtlInitializeExceptionChain+0x36
>
> with gpg-agent.exe:

I am lost here.  What do you mean by "with gpg-agent.exe" here?  Another
thread within the same process?

> ntoskrnl.exe!SeAccessCheckWithHint+0xb4a
> ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x7d2
> ntoskrnl.exe!KeWaitForMutexObject+0x19f
> ntoskrnl.exe!PsIsSystemProcess+0x94
> ntoskrnl.exe!KeStackAttachProcess+0x11c1
> ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x9dd
> ntoskrnl.exe!KeWaitForMutexObject+0x19f
> ntoskrnl.exe!NtWaitForSingleObject+0xb2
> ntoskrnl.exe!KeSynchronizeExecution+0x3a43
> wow64cpu.dll!TurboDispatchJumpAddressEnd+0x690
> wow64cpu.dll!TurboDispatchJumpAddressEnd+0x484
> wow64.dll!Wow64SystemServiceEx+0x1ce
> wow64.dll!Wow64LdrpInitialize+0x429
> ntdll.dll!RtlResetRtlTranslations+0x1b08
> ntdll.dll!RtlResetRtlTranslations+0xc63
> ntdll.dll!LdrInitializeThunk+0xe
> ntdll.dll!NtWaitForSingleObject+0x15
> ntdll.dll!RtlIntegerToUnicodeString+0x20b
> libnpth-0.dll!npth_clock_gettime+0x18f
> libnpth-0.dll!npth_eselect+0x485
> gpg-agent.exe+0x374b
>
> A thread safety problem with the Assuan library?
> Just guessing. ;)

Maybe.  Or in gpg-agent.

So the first thread seems to do an assuan connect, and the second is in
the process of accepting a connection.  This looks like the periodic
check that gpg-agent does.  It tries to connect to its own socket to see
if it has been deleted (to shut down in that case).  This is also what I
observed.

Assuan emulates unix sockets with tcp on Windows, exchanging an magic
number at the beginning that is stored in the file pretending to be a
unix socket.  This makes sure that only clients able to read the file
can connect.

What happens here is that the server waits for the client to send the
token, but that doesn't seem to happen.  Both threads seem to be doing
some kind of synchronization.


Justus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: </pipermail/attachments/20170131/b22a0ae1/attachment.sig>


More information about the Gnupg-devel mailing list