NetBSD Problem Report #55795

From  Sat Nov  7 22:52:17 2020
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id 3E78F1A9246
	for <>; Sat,  7 Nov 2020 22:52:17 +0000 (UTC)
Message-Id: <>
Date: Sat,  7 Nov 2020 22:52:16 +0000 (UTC)
Subject: syslogd dies recursively
X-Send-Pr-Version: 3.95

>Number:         55795
>Category:       bin
>Synopsis:       syslogd dies recursively
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 07 22:55:00 +0000 2020
>Last-Modified:  Sun Nov 08 01:15:01 +0000 2020
>Originator:     David A. Holland
>Release:        NetBSD 9.99.49 (20200310)
System: NetBSD valkyrie 9.99.49 NetBSD 9.99.49 (VALKYRIE) #0: Fri Oct  2 15:00:22 EDT 2020  dholland@valkyrie:/y/objects/usrobj-amd64/sys/arch/amd64/compile/VALKYRIE amd64
Architecture: x86_64
Machine: amd64

syslogd's die() (in syslogd.c) contains a recursive call to itself if
closing a udp socket fails. This is currently (-r1.135) on line 3017.

It looks like most but not all of the cleanup code is idempotent, so
if this path is ever reached it will probably SIGSEGV.


Code reading.


Change the close call to (void)close like the others, I guess. Anyone
have contrary opinions?

From: Valery Ushakov <>
Subject: Re: bin/55795: syslogd dies recursively
Date: Sun, 8 Nov 2020 02:07:28 +0300

 May be leave the check and still log the unlikely close failure, but
 then proceed?  But i have no strong opinion on that.

 Otherwise looks good to me.


From: "David A. Holland" <>
Subject: PR/55795 CVS commit: src/usr.sbin/syslogd
Date: Sun, 8 Nov 2020 01:12:46 +0000

 Module Name:	src
 Committed By:	dholland
 Date:		Sun Nov  8 01:12:46 UTC 2020

 Modified Files:
 	src/usr.sbin/syslogd: syslogd.c

 Log Message:
 syslogd: in die(), don't call die() again recursively.

 Particularly not for something as immaterial as close failing.

 PR 55795

 To generate a diff of this commit:
 cvs rdiff -u -r1.135 -r1.136 src/usr.sbin/syslogd/syslogd.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.