GPGME callback function problem

alan_b gtbui at yahoo.com
Fri Aug 31 17:04:27 CEST 2007


I am having this problem with the GPGME library.

I ran the t-decrypt.c test program that comes with the test suite for GPGME.
When GPGME invoked the callback function passphrase_cb function in the
t_support.h file, I got this error:
---------------------------
Debug Assertion Failed!
File: write.c
Line 71
Expression: (fh >= 0 && (unsigned)fd < (unsigned)_nhandle)
----------------------------

The code that gave the error is in this callback function:

passphrase_cb(void* opaque, ...., int fd)
{
    _write(fd, "abc\n", 4);
}

I found out that the assertion error happened because the file descriptor
was too large.  
When I ran the test  program in Visual Studio 2005, the file descriptor
value was something like 1916 (non debug mode) or 6012 (debug mode).  The
max file descriptor for Windows is 512 by default.  I tried to use
_setmaxstdio to increase the max fd to 2048, but still got the same error.

Now the question is why GPGME created a file descriptor with large value
like this?  How do I get around the problem?

My environment:   Windows XP Professional with Visual Studio 2005.  I used
GPG4Win 1.1.2 to install GPG 1.4.7, GPGME 1.1.5.  
For the test program, I use the libgpgme_11.dll binary which comes with this
installation.  All the front-end applications like GPA, GPGee, WinPT worked
fine.

Any help/suggestions would be greatly appreciated.

Alan

-- 
View this message in context: http://www.nabble.com/GPGME-callback-function-problem-tf4360675.html#a12428139
Sent from the GnuPG - Dev mailing list archive at Nabble.com.




More information about the Gnupg-devel mailing list