vasprintf core dump problem on Solaris 2.8

Andrzej Cuper ACuper@edgewater.com
Wed Aug 7 17:46:02 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
I'm running into core dump problems with test programs t-encrypt, =
t-decrypt etc, when runing 'make check' (on Solaris 2.8). The problem =
seems to be with vasprintf (vasprintf.c in gpgme directory) =
implementation and more specifically with the following fragment of =
code. Also enclosed call stack from gdb. Please help!

Also, can somebody explain the use of  DEBUG_BEGIN, DEBUG_ADD1, =
DEBUG_END.  Do I need to set up some environemnt variable to be able to =
see this. Which file does it go to?

Regards,
Andrzej



static int
int_vasprintf (result, format, args)
     char **result;
     const char *format;
     va_list *args;
{
...
  while (*p !=3D '\0')
    {
      if (*p++ =3D=3D '%')
	{
	...
	  switch (*p)
	    {
	    case 'd':
		...
	      break;
	    case 's':
=3D=3D=3D=3D=3D=3D>	      total_width +=3D strlen (va_arg (ap, char *));	=
<=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
	      break;
		...
	    }
	  p++;
	}
    }
	...
    return 0;
}


(gdb) where
#0  0xff2b3084 in strlen () from /usr/lib/libc.so.1
#1  0xff374d08 in int_vasprintf (result=3D0xffbeef18, =
format=3D0xff3768f0 "%s%s",=20
    args=3D0xffbeee94) at vasprintf.c:100
#2  0xff374e50 in vasprintf (result=3D0xffbeef18, format=3D0xff3768f0 =
"%s%s",=20
    args=3D0xffbeef04) at vasprintf.c:130
#3  0xff374e7c in asprintf (buf=3D0xffbeef18, fmt=3D0xff3768f0 "%s%s")
    at vasprintf.c:141
#4  0xff373ef8 in _gpgme_debug_add (line=3D0xffbeefa4, =
format=3D0xff3768f0 "%s%s")
    at debug.c:189
#5  0xff37387c in _gpgme_io_select (fds=3D0x23c28, nfds=3D10, =
nonblock=3D1456)
    at posix-io.c:325
#6  0xff3679a0 in do_select (fdt=3D0x21d90) at wait.c:155
#7  0xff367de0 in _gpgme_wait_on_condition (ctx=3D0x21d08, cond=3D0x0)
    at wait.c:291
#8  0xff367d80 in _gpgme_wait_one (ctx=3D0x21d08) at wait.c:279
#9  0xff36868c in gpgme_op_encrypt (ctx=3D0x21d08, recp=3D0x217d0, =
plain=3D0x21dc0,=20
    cipher=3D0x21df8) at encrypt.c:251
#10 0x11004 in main ()




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAj1RQEIACgkQBbTyHSd8yPx68wCeNQphGxd8Jh5hg9PGK8j9kaaX
L6oAn1Ux86wM4wGDq/X6itGv/ydygYkB
=3Dn1pG
-----END PGP SIGNATURE-----