Bug 138061 - Core dump in host(1)
Summary: Core dump in host(1)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 7.2-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Doug Barton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-22 06:30 UTC by Michael Baker
Modified: 2009-12-14 22:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Baker 2009-08-22 06:30:01 UTC
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 ~]$
Comment 1 Doug Barton freebsd_committer freebsd_triage 2009-10-11 19:49:51 UTC
State Changed
From-To: open->analyzed


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


Comment 2 Doug Barton freebsd_committer freebsd_triage 2009-10-11 19:49:51 UTC
Responsible Changed
From-To: freebsd-bugs->dougb


BIND is my area.
Comment 3 dfilter service freebsd_committer freebsd_triage 2009-11-07 18:55:54 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"
Comment 4 Doug Barton freebsd_committer freebsd_triage 2009-11-07 18:57:01 UTC
State Changed
From-To: analyzed->patched


This has been fixed in HEAD. I'll MFC it soon.
Comment 5 dfilter service freebsd_committer freebsd_triage 2009-11-07 19:23:38 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"
Comment 6 dfilter service freebsd_committer freebsd_triage 2009-12-14 21:50:49 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"
Comment 7 dfilter service freebsd_committer freebsd_triage 2009-12-14 21:51:46 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"
Comment 8 Doug Barton freebsd_committer freebsd_triage 2009-12-14 21:53:20 UTC
State Changed
From-To: patched->closed


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