Re: possible SSL_write bug

2008-02-14 Thread jimmy bahuleyan
Alessandro Pivi - GLOBALcom engineering wrote: You are right, it is just a signal I should ignore. Now it works perfectly. Maybe the fact that the SSL_write might rise a SIGPIPE should be in the documentation, because it happens only in particular situations (2 writes in a row with connection

Re: possible SSL_write bug

2008-02-14 Thread Alessandro Pivi - GLOBALcom engineering
You are right, it is just a signal I should ignore. Now it works perfectly. Maybe the fact that the SSL_write might rise a SIGPIPE should be in the documentation, because it happens only in particular situations (2 writes in a row with connection closed remotely), and it might cause occasional

RE: possible SSL_write bug

2008-02-13 Thread David Schwartz
> Program received signal SIGPIPE, Broken pipe. You need to either catch or ignore SIGPIPE. > There is also the output of the program. I think the focus should > not be on the call the caused the crash, but on the call before, > which returned 7 even if the connection was closed. There's nothin

Re: possible SSL_write bug

2008-02-13 Thread Alessandro Pivi - GLOBALcom engineering
This is what you requested: (gdb) run Starting program: /home/develop/test/bin/sslTest h:127.0.0.1 port:16001 SSL Connection opened start op w: 7 start op w: 7 start op w: 7 start op w: 7 start op w: 7 start op w: 7 start op Program received signal SIGPIPE, Broken pipe. 0x4011f41e in write ()

RE: possible SSL_write bug

2008-02-13 Thread David Schwartz
> Sorry for my bad english, it crashes, it doesn't hang. Then compile with '-g' and run 'gdb' on the core dump. Post the output of the 'where' command. DS __ OpenSSL Project http://www.openssl.o

Re: possible SSL_write bug

2008-02-13 Thread Alessandro Pivi - GLOBALcom engineering
Sorry for my bad english, it crashes, it doesn't hang. It is not true I don't handle errors. The SSL_write always returns a positive value (the number of bytes I'm trying to write), which means there has not been an error. The SSL_get_error called with a positive value always returns SSL_ERROR

RE: possible SSL_write bug

2008-02-12 Thread David Schwartz
> I found out that if I keep calling SSL_write, if the connection > is closed remotely (killing stunnel), my application hangs. I thought your problem was crashing. Now I see that it's hanging. These are two totally different problems. > I made some tests, and saw that the error happens only if

Re: possible SSL_write bug

2008-02-12 Thread Alessandro Pivi - GLOBALcom engineering
Hi, I found out that if I keep calling SSL_write, if the connection is closed remotely (killing stunnel), my application hangs. I made some tests, and saw that the error happens only if I keep calling SSL_write. The first SSL_write after closing the connection returns a positive value, as if t

RE: possible SSL_write bug

2008-02-11 Thread David Schwartz
> If I close stunnel, the next SSL_write will return a positive value, > as if everything is ok, the second causes sudden application termination. Make a build with debugging symbols, get a core dump, and analyze it with 'gdb' or similar. Alternatively, post the smallest complete, compilable exam

Re: possible SSL_write bug

2008-02-11 Thread Alessandro Pivi - GLOBALcom engineering
Hi, I made more tests, I even adapted sample code from samples I got in the web, and I always have the same result. If I close stunnel, the next SSL_write will return a positive value, as if everything is ok, the second causes sudden application termination. Could anybody please verify this

RE: possible SSL_write bug

2008-02-06 Thread David Schwartz
> I made a program that connects to a stunnel server. > I am able to connect to the server, read, write, with no problems. Good. > The problem is that if I close the stunnel, I can handle the error > correctly if I make an SSL_read, but not if I make an SSL_write. > The SSL_write returns a posit