[gnutls-devel] 3.3.0pre0 - [sparc] Bus error on chainverify test

Andreas Metzler ametzler at bebt.de
Wed Apr 2 19:32:53 CEST 2014


On 2014-04-01 Nikos Mavrogiannopoulos <nmav at gnutls.org> wrote:
> On Sun, Mar 30, 2014 at 7:37 PM, Andreas Metzler <ametzler at bebt.de> wrote:
> > Program received signal SIGBUS, Bus error.
> > asn1_delete_structure2 (structure=0x1bf10, flags=0) at structure.c:315
> > 315           if (p->down)
> > (gdb) bt
> > #0  asn1_delete_structure2 (structure=0x1bf10, flags=0) at structure.c:315
> > #1  0xf7f3f18c in gnutls_x509_crt_import (cert=0x1bf10, data=0xffffd668,
> >     format=GNUTLS_X509_FMT_PEM) at x509.c:207
> > #2  0x00010f40 in doit () at chainverify.c:1279
> > #3  0x00010b30 in main (argc=0, argv=0xffffd7c4) at utils.c:146
[...]
> Andreas, could there be an issue with calloc or the compiler on this
> system? If you follow the code in gnutls_x509_crt_import() it only
> enters the location that receives sigbus  when 'cert->expanded' is
> non zero. As this is the first call after gnutls_x509_crt_init() it
> means that this value should have been zero.

> A way to see if it is a compiler issue, is to change the compiler,
> or try compiling with -O0 (and hoping the issue is in the
> optimizer). You can see if it is an issue in calloc() on that system
> by placing a memset() to zero just after it and seeing whether it
> fixes the issue.

Hello,

what I have tried these things without success:
-O0 -> no change

-------------------
--- /home/ametzler/GIT/gnutls/lib/x509/x509.c   2014-04-01 19:47:18.934610756 +0200
+++ lib/x509/x509.c     2014-04-02 19:26:31.562655272 +0200
@@ -51,6 +51,7 @@ int gnutls_x509_crt_init(gnutls_x509_crt

        tmp =
            gnutls_calloc(1, sizeof(gnutls_x509_crt_int));
+       memset(tmp, '\0', sizeof(gnutls_x509_crt_int));
        int result;

        if (!tmp)
-------------------

cu Andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'



More information about the Gnutls-devel mailing list