Openssl_malloc returns NULL. - Openssl

This is a discussion on Openssl_malloc returns NULL. - Openssl ; Hi , I am using openssl-0.9.8e in my codebase. I am using SHA1 in my code base to authenticate my data. The code seems to work fine for 5-10 mins. But after sometime it crashes as openssl_malloc returns null in ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Openssl_malloc returns NULL.

  1. Openssl_malloc returns NULL.

    Hi ,
    I am using openssl-0.9.8e in my codebase.
    I am using SHA1 in my code base to authenticate my data. The code seems to work fine for 5-10 mins. But after sometime it crashes as openssl_malloc returns null in function EVP_DigestInit_ex . This is defiantly not the problem of memory exhaustion as, the crash dumps shows 700 KB of largest free memory block available and the ctx size is of 100 bytes.
    This seems to be the case of stack corruption. While surfing though the net, I found exactly similar problem on this link
    http://www.mail-archive.com/openssl-.../msg51093.html .

    I would like to know , if this problem is due to my code , or some bug in openssl. My code snippet is shown below…


    Calculate_Hash(….)
    {

    HMAC_CTX hmacCtx;
    HMAC_Init( &hmacCtx , (const void *)authKey , keyLength , EVP_sha1());
    HMAC_Update( &hmacCtx , authStart , authLength );
    HMAC_Final( &hmacCtx , tagOffset , &len );
    HMAC_CTX_cleanup(&hmacCtx);
    }

    Regards,
    Vikas




    __________________________________________________ ________
    Not happy with your email address?.
    Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html
    __________________________________________________ ____________________
    OpenSSL Project http://www.openssl.org
    User Support Mailing List openssl-users@openssl.org
    Automated List Manager majordomo@openssl.org


  2. Re: Openssl_malloc returns NULL.

    On Jul 14, 12:40*pm, vikas191...@yahoo.com (vikas khanna) wrote:
    > Hi ,
    > I am using openssl-0.9.8e in my codebase.
    > I am using SHA1 in my code base to authenticate my data. The code seems to work fine for 5-10 mins. But after sometime it crashes as openssl_malloc returns null in function EVP_DigestInit_ex . This is defiantly not the problem of memory exhaustion as, the crash dumps shows 700 KB of largest free memory block available and the ctx size is of 100 bytes.
    > This seems to be the case of stack corruption. While surfing though the net , I found exactly similar problem on this link
    > http://www.mail-archive.com/openssl-.../msg51093.html .
    >
    > I would like to know *, if this problem is due to my code , or some bugin openssl. My code snippet is shown below
    >
    > Calculate_Hash(.)
    > {
    >
    > * * HMAC_CTX hmacCtx;
    > * * HMAC_Init( &hmacCtx , (const void *)authKey , keyLength , EVP_sha1());
    > * * HMAC_Update( &hmacCtx , authStart , authLength );
    > * * HMAC_Final( &hmacCtx , tagOffset , &len );
    > * * HMAC_CTX_cleanup(&hmacCtx);
    >
    > }
    >
    > Regards,
    > Vikas
    >
    > * * * __________________________________________________ ________
    > Not happy with your email address?.
    > Get the one you really want - millions of new email addresses available now at Yahoo!http://uk.docs.yahoo.com/ymail/new.html
    > __________________________________________________ ____________________
    > OpenSSL Project * * * * * * * * * * * * * * * *http://www.openssl.org
    > User Support Mailing List * * * * * * * * * *openssl-us...@openssl.org
    > Automated List Manager * * * * * * * * * * * * * majord...@openssl.org


    Can you please tell me for how many calls to the "Calculate_Hash(.)"
    function
    causes the problem instead of 5-10 mins ?

    It may be because of memory fragmentation problem.

+ Reply to Thread