pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/49784: pkgsrc/mail/isync (mbsync) dumps core while calling freeaddrinfo



>Number:         49784
>Category:       pkg
>Synopsis:       mbsync dumps core while calling freeaddrinfo
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 25 23:15:00 +0000 2015
>Originator:     enami tsugutomo
>Release:        NetBSD 6.1_STABLE
>Organization:
>Environment:
System: NetBSD sigtrap.sm.sony.co.jp 6.1_STABLE NetBSD 6.1_STABLE (GENERIC) #60: Mon Jan 5 11:29:11 JST 2015 enami%sigtrap.sm.sony.co.jp@localhost:/home/enami/src/netbsd-6/obj.amd64/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
mbsync command from pkgsrc/mail/isync dump core when it calls freeaddrinfo.
>How-To-Repeat:
Setup mbsync and try to run.

enami@sigtrap% gdb -q mbsync mbsync.core 
Reading symbols from /usr/pkg/bin/mbsync...(no debugging symbols found)...done.
[New process 1]
Core was generated by `mbsync'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f7ff6ab614f in freeaddrinfo () from /usr/lib/libc.so.12
(gdb) bt
#0  0x00007f7ff6ab614f in freeaddrinfo () from /usr/lib/libc.so.12
#1  0x000000000040b48f in ?? ()
#2  0x000000000040c055 in ?? ()
#3  0x0000000000403bed in ?? ()
#4  0x00000000004047bc in ?? ()
#5  0x00000000004033c2 in ?? ()
#6  0x00007f7ff7ffa000 in ?? ()
#7  0x0000000000000003 in ?? ()
#8  0x00007f7ffffffe30 in ?? ()
#9  0x00007f7ffffffe37 in ?? ()
#10 0x00007f7ffffffe3a in ?? ()
#11 0x0000000000000000 in ?? ()
(gdb) 
>Fix:
Following change work for me (isync 1.1.2 also has this problem, btw):

--- src/socket.c.orig	2014-11-08 12:19:59.000000000 +0000
+++ src/socket.c
@@ -477,7 +477,10 @@ static void
 socket_connected( conn_t *conn )
 {
 #ifdef HAVE_IPV6
-	freeaddrinfo( conn->addrs );
+	if ( conn->addrs ) {
+		freeaddrinfo( conn->addrs );
+		conn->addrs = NULL;
+	}
 #endif
 	conf_fd( conn->fd, 0, POLLIN );
 	conn->state = SCK_READY;
@@ -488,7 +491,10 @@ static void
 socket_connect_bail( conn_t *conn )
 {
 #ifdef HAVE_IPV6
-	freeaddrinfo( conn->addrs );
+	if ( conn->addrs ) {
+		freeaddrinfo( conn->addrs );
+		conn->addrs = NULL;
+	}
 #endif
 	free( conn->name );
 	conn->name = 0;



Home | Main Index | Thread Index | Old Index