On Sun, Oct 08, 2006, The Havenard wrote:
> Hi. I use OpenSSL in some of my applications and I noticed that
sometimes
> (I could say less then 2% times I run it) it crashed without apparent
> reason, but lately it happened ALWAYS, without any changes on the
program,
> what's very strange. So I decided to track this bug, and I "almost"
found
> it... My program crashes when it called SSL_connect(), I tought it
were my
> code but tried hard to fix it and was completely unsuccessful. So I
decided
> to start debuging the OpenSSL internals and started placing some hooks...
> I discovered where exactly the crash ocurred:
>
> ssl\s3_pkt.c, ssl3_read_n(), line 215: "s->s3->rbuf.offset = off + n;"
> The crash occurs because s->s3 is NULL.
> It's not NULL when ssl3_read_n() is called. It become NULL when
> ssl3_read_n() calls BIO_read(), at line 198. I don't know exactly how
> OpenSSL works but I guess BIO_read() should not mess with the SSL
> structure, what's very strange too...
> <snip>....
I believe I am experiencing a similar crash as reported by a post
using this same subject (I had initially ignored the e-mail). The
problem is that the crash is very intermittent, and _only_ appears
to occur on Windows. Linux, FreeBSD, Solaris, AIX, etc appear
to be unaffected. The statement in my code has been narrowed down
to the SSL_connect() statement, and there are sanity check around
all other code, especially making sure the socket connection is active,
and passed to SSL_set_fd(ssl, fd), so the SSL pointer passed should be
valid. It's very odd, hundreds of connections can be established,
and then just one bad connection will bring it down.
The particular host we connect to, on other platforms, will occasionally
give SSL negotiation failures but no crash (I'm thinking this
negotiation issue is resulting in a crash on Windows... we actually had
to make some code changes when moving our product from VS 2003 to
VS 2005 [especially since time_t is now 64bit with VS2005 even when
running in 32bit mode], and I wonder if OpenSSL doesn't have a few
similar issues as well...).
Because this happens so infrequently, I have not been able to have it
reproduced reliably enough to debug (and infact have only been able
to see that behavior on one machine). The host I am connecting to is
ssl2.vitalps.net port 5003, which is currently using some sort of
round-robin DNS to resolve to 204.8.249.127 and 208.224.248.192
(this host is not controlled by me, so I have no idea what they
are running).
I was hoping the original poster of this report was able to make headway
into debugging this, or at least able to tell me how to reliably
reproduce it so I can resolve the issue.
This issue so far has only occurred on Windows 2003, compiled with
Visual Studio 2005, running OpenSSL 0.9.7j compiled with FIPS
support, but FIPS mode was not activated.
Thanks!
-Brad
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]