From nobody@FreeBSD.org  Sat Aug 22 05:27:57 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 288DD106568B
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 22 Aug 2009 05:27:57 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 183308FC19
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 22 Aug 2009 05:27:57 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n7M5RunV038841
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 22 Aug 2009 05:27:56 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n7M5Ru33038840;
	Sat, 22 Aug 2009 05:27:56 GMT
	(envelope-from nobody)
Message-Id: <200908220527.n7M5Ru33038840@www.freebsd.org>
Date: Sat, 22 Aug 2009 05:27:56 GMT
From: Michael Baker <michael.baker@diversit.com.au>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Core dump in host utility
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         138061
>Category:       bin
>Synopsis:       Core dump in host(1)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 22 05:30:01 UTC 2009
>Closed-Date:    Mon Dec 14 21:53:45 UTC 2009
>Last-Modified:  Mon Dec 14 22:00:10 UTC 2009
>Originator:     Michael Baker
>Release:        7.2-RELEASE
>Organization:
DiversIT
>Environment:
FreeBSD athena.diversit.com.au 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May  8 23:55:21 WST 2009     root@athena.diversit.com.au:/usr/obj/usr/src/sys/DIVERSIT  i386
>Description:
When doing a AXFR query from a specified DNS server host utility dies with a core dump I have included example command and output this was also tested on 6.4

[diversit@athena ~]$ host -l test.com 203.170.85.42
socket.c:2486: REQUIRE((((sock) != ((void *)0)) && (((const isc__magic_t *)(sock))->magic == ((('I') << 24 | ('O') << 16 | ('i') << 8 | ('o')))))) failed.
Abort trap: 6 (core dumped)
[diversit@athena ~]$

>How-To-Repeat:
[diversit@athena ~]$ host -l test.com 203.170.85.42
socket.c:2486: REQUIRE((((sock) != ((void *)0)) && (((const isc__magic_t *)(sock))->magic == ((('I') << 24 | ('O') << 16 | ('i') << 8 | ('o')))))) failed.
Abort trap: 6 (core dumped)
[diversit@athena ~]$

>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: dougb 
State-Changed-When: Sun Oct 11 18:49:51 UTC 2009 
State-Changed-Why:  

A patch was supplied by a user, I will forward it to the bind-users 
list to see what they think. 


Responsible-Changed-From-To: freebsd-bugs->dougb 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Sun Oct 11 18:49:51 UTC 2009 
Responsible-Changed-Why:  

BIND is my area. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138061 
State-Changed-From-To: analyzed->patched 
State-Changed-By: dougb 
State-Changed-When: Sat Nov 7 18:57:01 UTC 2009 
State-Changed-Why:  

This has been fixed in HEAD. I'll MFC it soon. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138061 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/138061: commit references a PR
Date: Sat,  7 Nov 2009 18:55:54 +0000 (UTC)

 Author: dougb
 Date: Sat Nov  7 18:55:39 2009
 New Revision: 199019
 URL: http://svn.freebsd.org/changeset/base/199019
 
 Log:
   Wrap some socket handling code in a !NULL bow
   
   This patch or something similar will likely be included in a future
   BIND release.
   
   PR:		bin/138061
   Submitted by:	Michael Baker <michael.baker@diversit.com.au>
   Original patch submitted by:	Volker <volker@vwsoft.com>
   Patch reviewed and tweaked by:	ISC
 
 Modified:
   head/contrib/bind9/bin/dig/dighost.c
 
 Modified: head/contrib/bind9/bin/dig/dighost.c
 ==============================================================================
 --- head/contrib/bind9/bin/dig/dighost.c	Sat Nov  7 18:42:53 2009	(r199018)
 +++ head/contrib/bind9/bin/dig/dighost.c	Sat Nov  7 18:55:39 2009	(r199019)
 @@ -2604,10 +2604,12 @@ connect_done(isc_task_t *task, isc_event
  
  	if (sevent->result == ISC_R_CANCELED) {
  		debug("in cancel handler");
 -		isc_socket_detach(&query->sock);
 -		sockcount--;
 -		INSIST(sockcount >= 0);
 -		debug("sockcount=%d", sockcount);
 +		if (query->sock != NULL) {
 +			isc_socket_detach(&query->sock);
 +			sockcount--;
 +			INSIST(sockcount >= 0);
 +			debug("sockcount=%d", sockcount);
 +		}
  		query->waiting_connect = ISC_FALSE;
  		isc_event_free(&event);
  		l = query->lookup;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/138061: commit references a PR
Date: Sat,  7 Nov 2009 19:23:38 +0000 (UTC)

 dougb       2009-11-07 19:23:18 UTC
 
   FreeBSD ports repository
 
   Modified files:
     dns/bind94           Makefile 
     dns/bind95           Makefile 
     dns/bind96           Makefile 
   Added files:
     dns/bind94/files     patch-bin_dig_dighost.c 
     dns/bind95/files     patch-bin_dig_dighost.c 
     dns/bind96/files     patch-bin_dig_dighost.c 
   Log:
   Wrap some query socket handling in dig with a socket != NULL bow
   
   This patch or something similar will likely be included in a future
   BIND release.
   
   PR:             bin/138061
   Submitted by:   Michael Baker <michael.baker@diversit.com.au>
   Original patch submitted by:    Volker <volker@vwsoft.com>
   Patch reviewed and tweaked by:  ISC
   
   Revision  Changes    Path
   1.100     +1 -0      ports/dns/bind94/Makefile
   1.1       +19 -0     ports/dns/bind94/files/patch-bin_dig_dighost.c (new)
   1.104     +1 -0      ports/dns/bind95/Makefile
   1.1       +19 -0     ports/dns/bind95/files/patch-bin_dig_dighost.c (new)
   1.104     +1 -0      ports/dns/bind96/Makefile
   1.1       +19 -0     ports/dns/bind96/files/patch-bin_dig_dighost.c (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: dougb 
State-Changed-When: Mon Dec 14 21:53:20 UTC 2009 
State-Changed-Why:  

The patch has now been MFC'ed to RELENG[78]. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138061 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/138061: commit references a PR
Date: Mon, 14 Dec 2009 21:50:49 +0000 (UTC)

 Author: dougb
 Date: Mon Dec 14 21:50:34 2009
 New Revision: 200546
 URL: http://svn.freebsd.org/changeset/base/200546
 
 Log:
   Wrap some socket handling code in a !NULL bow
   
   This patch or something similar will likely be included in a future
   BIND release.
   
   PR:		bin/138061
   Submitted by:	Michael Baker <michael.baker@diversit.com.au>
   Original patch submitted by:	Volker <volker@vwsoft.com>
   Patch reviewed and tweaked by:	ISC
 
 Modified:
   stable/8/contrib/bind9/bin/dig/dighost.c
 Directory Properties:
   stable/8/contrib/bind9/   (props changed)
 
 Modified: stable/8/contrib/bind9/bin/dig/dighost.c
 ==============================================================================
 --- stable/8/contrib/bind9/bin/dig/dighost.c	Mon Dec 14 21:16:02 2009	(r200545)
 +++ stable/8/contrib/bind9/bin/dig/dighost.c	Mon Dec 14 21:50:34 2009	(r200546)
 @@ -2604,10 +2604,12 @@ connect_done(isc_task_t *task, isc_event
  
  	if (sevent->result == ISC_R_CANCELED) {
  		debug("in cancel handler");
 -		isc_socket_detach(&query->sock);
 -		sockcount--;
 -		INSIST(sockcount >= 0);
 -		debug("sockcount=%d", sockcount);
 +		if (query->sock != NULL) {
 +			isc_socket_detach(&query->sock);
 +			sockcount--;
 +			INSIST(sockcount >= 0);
 +			debug("sockcount=%d", sockcount);
 +		}
  		query->waiting_connect = ISC_FALSE;
  		isc_event_free(&event);
  		l = query->lookup;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/138061: commit references a PR
Date: Mon, 14 Dec 2009 21:51:46 +0000 (UTC)

 Author: dougb
 Date: Mon Dec 14 21:51:36 2009
 New Revision: 200547
 URL: http://svn.freebsd.org/changeset/base/200547
 
 Log:
   Wrap some socket handling code in a !NULL bow
   
   This patch or something similar will likely be included in a future
   BIND release.
   
   PR:		bin/138061
   Submitted by:	Michael Baker <michael.baker@diversit.com.au>
   Original patch submitted by:	Volker <volker@vwsoft.com>
   Patch reviewed and tweaked by:	ISC
 
 Modified:
   stable/7/contrib/bind9/bin/dig/dighost.c
 Directory Properties:
   stable/7/contrib/bind9/   (props changed)
 
 Modified: stable/7/contrib/bind9/bin/dig/dighost.c
 ==============================================================================
 --- stable/7/contrib/bind9/bin/dig/dighost.c	Mon Dec 14 21:50:34 2009	(r200546)
 +++ stable/7/contrib/bind9/bin/dig/dighost.c	Mon Dec 14 21:51:36 2009	(r200547)
 @@ -2539,10 +2539,12 @@ connect_done(isc_task_t *task, isc_event
  
  	if (sevent->result == ISC_R_CANCELED) {
  		debug("in cancel handler");
 -		isc_socket_detach(&query->sock);
 -		sockcount--;
 -		INSIST(sockcount >= 0);
 -		debug("sockcount=%d", sockcount);
 +		if (query->sock != NULL) {
 +			isc_socket_detach(&query->sock);
 +			sockcount--;
 +			INSIST(sockcount >= 0);
 +			debug("sockcount=%d", sockcount);
 +		}
  		query->waiting_connect = ISC_FALSE;
  		isc_event_free(&event);
  		l = query->lookup;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
