<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.code, li.code, div.code
        {mso-style-name:code;
        mso-style-link:"code Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:Consolas;
        color:black;}
span.codeChar
        {mso-style-name:"code Char";
        mso-style-link:code;
        font-family:Consolas;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Why do you think that message is relevant to your problem?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">You haven't told us anything useful about the problem you're experiencing, like what version of OpenSSL you're using. If you want good answers, ask good questions.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">What we can see below:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">- Obviously the parameter being passed to CRYPTO_add_lock is bogus. The problem isn't with locks; it's with attempting to operate on garbage data. The most
 likely causes are heap or stack corruption, or use-after-free.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">- The value being passed to X509_free isn't a valid pointer either.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">My guess is that your application frees something when it shouldn't. Maybe you're calling SSL_free twice. It appears that the CERT* passed to ssl_cert_clear_certs
 contains bogus data, and a use-after-free is a likely cause.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Since you're running on Linux (which I only know because of the gdb module list - again, you haven't provided even the most basic information with your question),
 I'd suggest running the application under Valgrind.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Courier New";color:black">Michael Wojcik</span><span style="font-size:9.0pt;color:#1F497D">
<br>
</span><span style="font-size:9.0pt;font-family:"Courier New";color:black">Technology Specialist</span><span style="font-size:9.0pt;font-family:"Courier New";color:black">, Micro Focus</span><span style="font-size:9.0pt;color:#1F497D">
</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> openssl-users [mailto:openssl-users-bounces@openssl.org]
<b>On Behalf Of </b>Vikas TM<br>
<b>Sent:</b> Tuesday, April 12, 2016 10:12<br>
<b>To:</b> openssl-users@openssl.org<br>
<b>Subject:</b> Re: [openssl-users] Received signal SIGSEGV in CRYPTO_add_lock()<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hi,<o:p></o:p></p>
<p>I am not very clear with solution provided in the following link,<br>
<a href="http://lists.globus.org/pipermail/gt-user/2007-December/005317.html">http://lists.globus.org/pipermail/gt-user/2007-December/005317.html</a><o:p></o:p></p>
<p>Appreciated if you help me in resolving this issue.<o:p></o:p></p>
<p>Thanks & Regards,<br>
Vikas<o:p></o:p></p>
<div>
<p class="MsoNormal">On 11 Apr 2016 8:20 pm, "Vikas TM" <<a href="mailto:vikas.tm@gmail.com" target="_blank">vikas.tm@gmail.com</a>> wrote:<o:p></o:p></p>
<p>Hi,<o:p></o:p></p>
<p>It looks like there is issue in handling crypto locks. I encountered segmentation fault in CRYPTO_add_lock() function referencing NULL pointer. Please find GDB output below,<o:p></o:p></p>
<p>(gdb) run <a href="ftp://x.x.x.x:sample.txt">ftp://x.x.x.x:sample.txt</a><o:p></o:p></p>
<p>Starting program: /App/vikftp <a href="ftp://x.x.x.x:sample.txt">ftp://x.x.x.x:sample.txt</a><o:p></o:p></p>
<p>Missing separate debuginfo for /lib/ld-linux.so.2<o:p></o:p></p>
<p>Missing separate debuginfo for /lib/libdl.so.2<o:p></o:p></p>
<p>Missing separate debuginfo for /lib/libpam.so.0<o:p></o:p></p>
<p>Missing separate debuginfo for /lib/libm.so.6<o:p></o:p></p>
<p>Missing separate debuginfo for /lib/libc.so.6<o:p></o:p></p>
<p>Missing separate debuginfo for /lib/libaudit.so.0<o:p></o:p></p>
<p>process 22287 is executing new program: /App/vikftp<o:p></o:p></p>
<p>Missing separate debuginfo for /lib/ld-linux.so.2<o:p></o:p></p>
<p>Missing separate debuginfo for /lib/libdl.so.2<o:p></o:p></p>
<p>Missing separate debuginfo for /lib/libpam.so.0<o:p></o:p></p>
<p>Missing separate debuginfo for /lib/libm.so.6<o:p></o:p></p>
<p>Missing separate debuginfo for /lib/libc.so.6<o:p></o:p></p>
<p>Missing separate debuginfo for /lib/libaudit.so.0<o:p></o:p></p>
<p> <o:p></o:p></p>
<p>Program received signal SIGSEGV, Segmentation fault.<o:p></o:p></p>
<p>0x08205766 in CRYPTO_add_lock (pointer=0x1011, amount=-1, type=3, file=0x85d0030 "/102d/s/tasn_utl.c", line=118)<o:p></o:p></p>
<p>    at /102d/s/cryptlib.c:624<o:p></o:p></p>
<p>624             ret = *pointer + amount;<o:p></o:p></p>
<p>(gdb) bt<o:p></o:p></p>
<p>#0  0x08205766 in CRYPTO_add_lock (pointer=0x1011, amount=-1, type=3, file=0x85d0030 "/102d/s/tasn_utl.c", line=118)<o:p></o:p></p>
<p>    at /102d/s/cryptlib.c:624<o:p></o:p></p>
<p>#1  0x08249d2a in asn1_do_lock (pval=0xff8eee90, op=-1, it=0x862cb1c) at /102d/s/tasn_utl.c:118<o:p></o:p></p>
<p>#2  0x08246ed5 in asn1_item_combine_free (pval=0xff8eee90, it=0x862cb1c, combine=0) at /102d/s/tasn_fre.c:146<o:p></o:p></p>
<p>#3  0x08246c40 in ASN1_item_free (val=0x1001, it=0x862cb1c) at /102d/s/tasn_fre.c:72<o:p></o:p></p>
<p>#4  0x0825eeea in X509_free (a=0x1001) at /102d/s/x_x509.c:143<o:p></o:p></p>
<p>#5  0x082ee677 in ssl_cert_clear_certs (c=0x872e4e0) at /102d/s/ssl_cert.c:431<o:p></o:p></p>
<p>#6  0x082ee7ed in ssl_cert_free (c=0x872e4e0) at /102d/s/ssl_cert.c:489<o:p></o:p></p>
<p>#7  0x0822f926 in SSL_free (s=0x872e340) at /102d/s/ssl_lib.c:627<o:p></o:p></p>
<p>#8  0x0816566c in closeConnection (pcx=0x86d8310, rsn=0x0, graceful=1 '\001') at /App/vikftp.c:10098<o:p></o:p></p>
<p>Please let me know if you have any solution.<o:p></o:p></p>
<p>Thanks & Regards,<br>
Vikas<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="background:white"><o:p> </o:p></span></p>
<p align="center" style="text-align:center"><span style="background:white">Click <a href="https://www.mailcontrol.com/sr/+Cj70KMYCabGX2PQPOmvUgItITKVa7z0gs7YiNqVkgRsY23LiAnRcH9UaLfxQWXam!Wtb8ydoXseRLY+cWrx9g==">
here</a> to report this email as spam.<o:p></o:p></span></p>
</div>
</div>
</body>
</html>