GPGME-Error rungpg.c:487: command_handler: Assertion `gpg->cmd.code' failed.

Christian Kamps Christian.Kamps at gmx.de
Tue Jul 24 09:42:16 CEST 2007


Hello,

I have developed a c/c++ program for automatic email verification and
decryption, which reads the email via STDIN and returns the resulting
email via STDOUT.
According to some tests the program works fine - but there's still one
single error that's buggering me. The program should in _any case
something goes wrong_ give the original email back via STDOUT.
It does so with all my original testmails (with and without attachments,
PGP/inline, PGP/MIME - doesn't matter) - but it should also work with
manipulated emails. So i manipulated all of my testmails and saved them
to different names and tried the program again.
Goal is clear - the program should give an error that a decryption or
verification was not possible an return the original email.


All fine - but when I run a bash-script which calls my program and one
email after another only one single manipulated mail gives this error
(In the following I shortened the stdout to out.txt and stderr to
err.txt - all of the program-calls have different output-files):

8345 Aborted (core dumped) ./check <svm-mime-i.txt >out.txt 2>err.txt

last few lines of STDERR (err.txt) are:
  - gpgme-context created
  - gpgme-data-objekt msg created (MIME)
  - gpgme-data-object sig created (MIME)
check: rungpg.c:487: command_handler: Assertion `gpg->cmd.code' failed.

out.txt is empty.

Now comes the weird part:
If I only run the single command "./check <svm-mime-i.txt >out.txt
2>err.txt" from commandline all works perfectly fine, err.txt says
"could not decrypt" and out.txt contains the original email.

And even weirder - when I run the bash-script mentioned above on two
other machines it works perfectly fine on one of them.
I tried on all of these machines with
- GPG 1.4.6, gpgme-1.1.4, libgpg-error-1.4
- GPG 1.4.6, gpgme-1.1.5, libgpg-error-1.5

Athlon 3000+ 512MB RAM Ubuntu 7.04 Bash-Script failes
Pentium3 1Ghz 512MB RAM Debian 4.0 Bash-Script failes
Duron 900Mhz 384MB RAM Debian 4.0 Bash-Script works

Confused and hoping for some thoughts
Christian




More information about the Gnupg-devel mailing list