Bug 389919

Summary: Kleopatra crashes on sign / encrypt with redirected %appdata%
Product: [Applications] kleopatra Reporter: mostware
Component: generalAssignee: Andre Heinecke <aheinecke>
Status: RESOLVED UPSTREAM    
Severity: crash CC: kdepim-bugs, marco.gervasi, mutz
Priority: NOR    
Version: 3.0.2   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
URL: https://dev.gnupg.org/T3818
Latest Commit: Version Fixed In: Gpg4win-3.1.0
Attachments: error message when using right click

Description mostware 2018-02-05 15:52:32 UTC
Created attachment 110353 [details]
error message when using right click

When trying to sign and encrypt a file, Kleopatra crashes with message end of file. It both happens with clicking on a file with the right mouse button and by clicking on sign and encrypt and browisng to and selecting a file. 

By testing we managed to figure out that it happens in version 3.02 and domain users with a redirected %appdata% folder. Users with a local %Appdata% folder on the same pc can use Kleopatra without problems.

A pc with version 2.3.3 installed doesn't have the problem, users with redirected %Appdata% can use Kleopatra.
Comment 1 Marco 2018-02-08 11:18:30 UTC
We use GnuPG4Win with kleopatra 3.0.3 and it seems that we have the same problem.

keo-log says:
Got unexpected locking error 161
couldn't lock local file
0x5f20788
Comment 2 Marco 2018-02-08 13:07:04 UTC
Maybe the following is helpful:
FAULTING_IP: 
kleopatra+5216
00405216 8b10            mov     edx,dword ptr [eax]

EXCEPTION_RECORD:  ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 00405216 (kleopatra+0x00005216)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 00000000
   Parameter[1]: 00000000
Attempt to read from address 00000000

CONTEXT:  00000000 -- (.cxr 0x0;r)
eax=00000000 ebx=00000360 ecx=00000000 edx=6aa77760 esi=02e50000 edi=0028c420
eip=77d7d10c esp=0028c3bc ebp=0028c3f8 iopl=0         nv up ei pl nz na po nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000202
ntdll!NtGetContextThread+0xc:
77d7d10c c20800          ret     8

DEFAULT_BUCKET_ID:  NULL_POINTER_READ

PROCESS_NAME:  kleopatra.exe

ERROR_CODE: (NTSTATUS) 0xc0000005 - Die Anweisung in 0x%p verwies auf Arbeitsspeicher bei 0x%p. Der Vorgang %s konnte im Arbeitsspeicher nicht durchgef hrt werden.

EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - Die Anweisung in 0x%p verwies auf Arbeitsspeicher bei 0x%p. Der Vorgang %s konnte im Arbeitsspeicher nicht durchgef hrt werden.

EXCEPTION_PARAMETER1:  00000000

EXCEPTION_PARAMETER2:  00000000

READ_ADDRESS:  00000000 

FOLLOWUP_IP: 
kleopatra+5216
00405216 8b10            mov     edx,dword ptr [eax]

NTGLOBALFLAG:  0

APPLICATION_VERIFIER_FLAGS:  0

APP:  kleopatra.exe

ANALYSIS_VERSION: 6.3.9600.17336 (debuggers(dbg).150226-1500) amd64fre

FAULTING_THREAD:  0000663c

PRIMARY_PROBLEM_CLASS:  NULL_POINTER_READ

BUGCHECK_STR:  APPLICATION_FAULT_NULL_POINTER_READ

LAST_CONTROL_TRANSFER:  from 0053b002 to 00405216

STACK_TEXT:  
WARNING: Stack unwind information not available. Following frames may be wrong.
0028d058 0053b002 006ec806 00000000 003d08fc kleopatra+0x5216
0028d1b8 004f57b3 00000000 00000000 0028d2c8 kleopatra+0x13b002
0028d248 0061c4e2 00000002 00000000 0000004d kleopatra+0xf57b3
0028d2c8 0060bcab 0028d2ec fffffffe 776bb106 kleopatra+0x21c4e2
0028d358 0060d80f 0028d37c 00000000 00000000 kleopatra+0x20bcab
0028d3d8 66b2d78e 00000001 02d6af70 0365e448 kleopatra+0x20d80f
0028d4f8 025482bf 0028d770 0028d770 00000000 Qt5Core!ZN15QSocketNotifier5eventEP6QEvent+0x21e
0028d508 6d0d3014 0000001c 0028d61c 00000009 Qt5Widgets!ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent+0x8f
00000000 00000000 00000000 00000000 00000000 libgcc_s_sjlj_1!Unwind_SjLj_Unregister+0x34


STACK_COMMAND:  ~0s; .ecxr ; kb

SYMBOL_STACK_INDEX:  0

SYMBOL_NAME:  kleopatra+5216

FOLLOWUP_NAME:  MachineOwner

MODULE_NAME: kleopatra

IMAGE_NAME:  kleopatra.exe

DEBUG_FLR_IMAGE_TIMESTAMP:  409

FAILURE_BUCKET_ID:  NULL_POINTER_READ_c0000005_kleopatra.exe!Unknown

BUCKET_ID:  APPLICATION_FAULT_NULL_POINTER_READ_kleopatra+5216

ANALYSIS_SOURCE:  UM

FAILURE_ID_HASH_STRING:  um:null_pointer_read_c0000005_kleopatra.exe!unknown

FAILURE_ID_HASH:  {12cee584-1682-698c-b1f8-5a9efd0fae34}

Followup: MachineOwner
Comment 3 Andre Heinecke 2018-02-21 10:01:42 UTC
I can't reproduce this. What I tried was to connect a Network Drive (from a Samba share of a Linux machine) and then linked both the GnuPG Home directory and kleopatras config directory to that drive.

There was no crash.

What is the target of your redirection and can you tell me more how to set something like this up?

Also where exactly and how is kleopatra crashing when you just launch it. Does it show the self test?
The attached error message does not help much it only shows that our Explorer Plugin can't talk to Kleopatra as Kleo crashed somehwere.

Still setting this to confirmed as there are multiple reports about this.
Comment 4 mostware 2018-02-22 16:47:17 UTC
Thank you very much for the reply. 

The next two weeks I'm not able to do more testing, but the second week of March I will follow up on the problem.

The user Appdata is redirected to \\server\usersettings$\%Username%\Appdata\Roaming through Group policy
Comment 5 Andre Heinecke 2018-03-01 07:41:56 UTC
As I did not have a Windows Server I didn't have the option to redirect through Group Policy. But I was able to reproduce the problems by changing AppData through the registry.

I could reproduce a crash on sign & encrypt. A crash when generating a new Key and "General Error" when creating a new key. And Kleopatra was not able to save configuration (the locking error).

There were two bugs with code that didn't handle UNC Paths (which explains why a symlink did not show the problems). One was in GnuPG itself (gpgconf) and the other was in the Gpg4win patches for Qt.

I fixed both and now I can no longer see any problem when running Kleopatra on a redirected appdata dir.


A new Gpg4win release with the fixes is planned ~mid March, or at least a beta with them.

Please subscribe to the upstream issue https://dev.gnupg.org/T3818 if you want to be informed about a release with the fixes.


Thanks for your reports,
Andre
Comment 6 mostware 2018-03-12 11:07:57 UTC
Thanks very much for the followup, we are looking forward to the new version and will test it when it's released.
Comment 7 mostware 2018-03-12 15:26:57 UTC
We tested with the 3.1.0-beta version and the problem is resolved. We are now able to encrypt and decrypt files without crashes.
Comment 8 Andre Heinecke 2018-03-12 15:28:54 UTC
Thanks for testing! 
Good to hear.

But with the current Beta there might still be issues. E.g. Configuration of the GnuPG-System won't work. These problems are already solved but await a new GnuPG release which will be part of the final release.