gajim died when connection refused by server
Bug description
gajim silently dies when tcp connection to server refused
Steps to reproduce
create account for some server, which refuses connection. Restart gajim
:~> gajim --profile livejournal.com --verbose
...skipped
19:35:36 (I) gajim.c.connection >>>>>> Connecting to livejournal.com [xmpp.services.livejournal.com:5223], type = ssl
19:35:36 (I) gajim.c.x.plugin Plugging \<common.xmpp.transports_nb.NonBlockingTCP instance at 0x2b64178c> __INTO__ \<common.xmpp.client_nb.NonBlockingClient instance at 0x29fbbe6c>
19:35:36 (I) gajim.c.x.transports_nb NonBlockingTCP Connect :: About to connect to 208.93.0.128:5223
19:35:36 (I) gajim.c.x.transports_nb Plugging fd 13, W:True, R:False
19:35:36 (I) gajim.c.x.idlequeue read timeout set for fd 13 on 30 seconds
19:35:36 (I) gajim.c.x.transports_nb After NB connect() of 727979916. "Operation now in progress" raised => CONNECTING
19:35:36 (I) gajim.c.x.transports_nb pollout called, state == CONNECTING
19:35:36 (I) gajim.c.x.transports_nb 727979916 socket wrapper connected
19:35:36 (I) gajim.c.x.idlequeue read timeout removed for fd 13
19:35:36 (I) gajim.c.x.transports_nb Plugging fd 13, W:False, R:False
19:35:36 (I) gajim.c.x.plugin Plugging \<common.xmpp.tls_nb.NonBlockingTLS instance at 0x2b641acc> __INTO__ \<common.xmpp.transports_nb.NonBlockingTCP instance at 0x2b64178c>
19:35:36 (I) gajim.c.x.tls_nb Starting TLS estabilishing
19:35:36 (D) gajim.c.x.tls_nb _startSSL called
19:35:36 (D) gajim.c.x.tls_nb _startSSL_pyOpenSSL called
19:35:36 (D) gajim.c.x.tls_nb common.xmpp.tls_nb.PyOpenSSLWrapper.__init__ called with \<OpenSSL.SSL.Connection object at 0x29f022bc>
19:35:36 (D) gajim.c.x.tls_nb Initiating handshake...
Broken pipe
:~>
ktrace/kdump show, that SIGPIPE is not handled by gajim:
9183 initial thread CALL connect(0xd,0xbfbfbde8,0x10)
9183 initial thread STRU struct sockaddr { AF_INET, 208.93.0.128:5223 }
9183 initial thread RET connect -1 errno 36 Operation now in progress
...
9183 initial thread CALL fcntl(0xd,F_GETFL,0)
9183 initial thread RET fcntl 6
9183 initial thread CALL fcntl(0xd,F_SETFL,0x2\<O_RDWR>)
9183 initial thread RET fcntl 0
9183 initial thread CALL clock_gettime(0xd,0xbfbfcad8)
9183 initial thread RET clock_gettime 0
9183 initial thread CALL clock_gettime(0xd,0xbfbfcad8)
9183 initial thread RET clock_gettime 0
9183 initial thread CALL getpid
9183 initial thread RET getpid 9183/0x23df
9183 initial thread CALL write(0xd,0x28aec000,0x64)
9183 initial thread RET write -1 errno 32 Broken pipe
9183 initial thread PSIG SIGPIPE SIG_DFL code=0x0
Software versions
OS version: FreeBSD 9.0-CURRENT !#1 (closed) r220286M \ GTK version: gtk-2.22.1_1 (from freebsd ports) \ PyGTK version: py26-gtk-2.22.0_2 (from freebsd ports) \ also installed: py26-openssl-0.11