gpgme_op_keylist_start: error: Invalid crypto engine <GPGME>

Hans-Christoph Steiner hans at
Tue Oct 23 05:39:49 CEST 2012

On 10/22/2012 05:13 AM, Werner Koch wrote:
> Hi,
> looking closer at the logs shows that none of the tools return any
> information for a call with EGNINE --version.
>  <0x0391>  _gpgme_io_spawn: check: path=0x4a2ea798, argv[ 0] = /data/data/info.guardianproject.gpg/app_opt/bin/gpg2
>  <0x0391>  _gpgme_io_spawn: check: path=0x4a2ea798, argv[ 1] = --version
>  <0x0391>  _gpgme_io_spawn: check: path=0x4a2ea798, fd[0] = 0x26 -> 0x1
> Setup everything for an exec.  Register to connect stdout of gpg2 to the
> pipe.
>  <0x0391>  _gpgme_io_spawn: check: path=0x4a2ea798, waiting for child
>  process pid=941
> Wait in the parent for gpg to finish.
>  <0x03ae>    gpgme:max_fds: call: 0=0x0, max fds=1024 (RLIMIT_NOFILE)
> The child is about to close all file descriptors.  Actually this is the
> grandchild because gpgme uses double forking to let init reap the
> children.
>  <0x0391>    _gpgme_io_close: enter: fd=0x26
>  <0x0391>    _gpgme_io_close: leave: result=0
> Close other end of the pipe in the parent.
>  <0x0391>  _gpgme_io_spawn: leave: result=0
> Finished.
>  <0x0391>  _gpgme_io_read: enter: fd=0x25, buffer=0xbeac65e4, count=79
>  <0x0391>  _gpgme_io_read: leave: result=0
> Read end of the pipe was called with a 79 byte buffer but returned
> nothing.  Here is what you should have seen between these two log lines:
>  <0x0391>  _gpgme_io_read: check: 6770672028476e75 50472920312e342e gpg (GnuPG) 1.4
>  [...]
> I assume you already verified that 
>  $ /data/data/info.guardianproject.gpg/app_opt/bin/gpg2 --version 
> return something to stdout.  The next step would be to enable the trace
> calls in  src/posix-io.c:gpgme_io_spawn .  The are all "#if 0"-ed to
> avoid problems with pthread.  Change the all to "#if 1" and check the
> logs again.

Arg, I should have taken this as a hint.  That indeed was the problem.  One
annoying thing about Android is that the only way that executables can find
the dynamic libs they need is via the LD_LIBRARY_PATH env var.  I had already
set this for launching dirmngr and gpg-agent, and also when calling gpg2
directly from Java.  BUT!  gpgme calls gpg2, etc. so I wasn't setting
LD_LIBRARY_PATH for gpgme, so when it calls any of the cmd line utils, they
didn't work since they couldn't find their dynamic libs...

Thanks for your help, I knew it would be something stupid.  Hopefully it'll be
smooth sailing from here :)


More information about the Gnupg-devel mailing list