[openssl-dev] Seg fault during make test

John Foley foleyj at cisco.com
Mon May 4 14:19:11 UTC 2015


I think you're wrong about sizeof and pointers.  It'll return 4 or 8
depending if it's a 32 or 64 bit system.  Try the following code:

#include <stdio.h>

typedef struct _s1 {
    int x;
    int y;
    int z;
} S1;

typedef struct _s2 {
    double d1;
    double d2;
    double d3;
    double d4;
    int x1;
    int x2;
} S2;

int main (int argc, char *argv[]) {
    S1 *first;
    S2 *second;

    printf("%d %d\n", sizeof(first), sizeof(second));
}


You're right about the memset, good catch.  So it appears there are two
issues with this commit.



On 05/04/2015 09:35 AM, Stephan Mühlstrasser wrote:
> Am 04.05.15 um 14:51 schrieb John Foley:
>> Is anyone seeing a segmentation fault during the test_verify phase of
>> make test on 32-bit systems?  I haven't done a full triage yet.  But it
>> appears to have been introduced by
>> 5b38d54753acdabbf6b1d5e15d38ee81fb0612a2.  The problem no longer occurs
>> when backing out this commit.  This could be a faulty commit since the
>> sizeof invocations in this commit would return different values for
>> 32/64 bit systems.
>
> The sizeof invocations do not return the pointer sizes, but the size
> of the structures pointed to.
>
> The problem is that there's apparently a copy&paste error:
>
> https://github.com/openssl/openssl/commit/53ba0a9e91ad203de2943edaf1090ab17ec435fa
>
>
> 172 memset(param, 0, sizeof *paramid);
> 173 memset(paramid, 0, sizeof *paramid);
>
> The first memset should be fixed to use "*param" instead of "*paramid":
>
> memset(param, 0, sizeof *param);
>
> Regards
> Stephan
> _______________________________________________
> openssl-dev mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
>



More information about the openssl-dev mailing list