Tricky gpgme_wait bug.

Igor Belyi gpgme at
Sat Apr 23 19:25:55 CEST 2005

There's a strange gpgme bug hit by gpgme_wait when there's a sleep 
happen between calls and when the asynchronous command is 
'gpgme_op_verify_start' resulting in an error.

I've attached the program reproducing the problem. An input parameter 
should be a file with an attached signature. The problem can be seen 
when you feed to the program a file containing no signature. You can 
also see that problem does not happen if you comment out 'sleep(1)' in 
the while loop.

I've run it in a debugger and found out that segmentation fault happens 
due to the fact that in the following line of the 
wait-global.c/gpgme_wait() function values of the opaque structure are 

item = (struct wait_item_s *) fdt.fds[i].opaque;

I have hard time finding out where this opaque comes from and why would 
it be invalid sometimes, so I thought I will share what I already found.

Hopefully, somebody will have better luck tracking this problem out.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gpgme_wait_bug.c
Type: text/x-csrc
Size: 1923 bytes
Desc: not available
Url : /pipermail/attachments/20050423/e8acd22c/gpgme_wait_bug.c

More information about the Gnupg-devel mailing list