From sa@gw2.svzserv.kemerovo.su  Sat Dec  7 19:39:05 2002
Return-Path: <sa@gw2.svzserv.kemerovo.su>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A901F37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  7 Dec 2002 19:39:05 -0800 (PST)
Received: from gw2.svzserv.kemerovo.su (gw2.svzserv.kemerovo.su [213.184.65.69])
	by mx1.FreeBSD.org (Postfix) with ESMTP id CE62843E4A
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  7 Dec 2002 19:39:01 -0800 (PST)
	(envelope-from sa@gw2.svzserv.kemerovo.su)
Received: from gw2.svzserv.kemerovo.su (localhost [127.0.0.1])
	by gw2.svzserv.kemerovo.su (8.12.6/8.12.6) with ESMTP id gB83cqpB089513
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 8 Dec 2002 10:38:52 +0700 (KRAT)
	(envelope-from sa@gw2.svzserv.kemerovo.su)
Received: (from root@localhost)
	by gw2.svzserv.kemerovo.su (8.12.6/8.12.6/Submit) id gB83cl8g089509;
	Sun, 8 Dec 2002 10:38:47 +0700 (KRAT)
Message-Id: <200212080338.gB83cl8g089509@gw2.svzserv.kemerovo.su>
Date: Sun, 8 Dec 2002 10:38:47 +0700 (KRAT)
From: Eugene Grosbein <eugen@grosbein.pp.ru>
Reply-To: System Administrator <sa@gw2.svzserv.kemerovo.su>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: inetd(8) segfault
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         46088
>Category:       bin
>Synopsis:       inetd(8) segfault
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    dwmalone
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 07 19:40:00 PST 2002
>Closed-Date:    Sun Feb 09 12:37:43 PST 2003
>Last-Modified:  Sun Feb 09 12:37:43 PST 2003
>Originator:     Eugene Grosbein
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
Svyaz Service JSC
>Environment:
System: FreeBSD gw2.svzserv.kemerovo.su 4.7-STABLE FreeBSD 4.7-STABLE #6: Thu Nov 21 10:54:09 KRAT 2002 sa@gw2.svzserv.kemerovo.su:/usr/obj/usr/src/sys/GW2 i386
	World was built with CPUTYPE=i586, runs on Pentium-II
	No other optimizations.
	
	inetd_flags="-wWl" in /etc/rc.conf

>Description:
	inetd(8) segfaulted yesterday on my router
	It was not compiled with -g so gdb's ouput is short:

Script started on Sun Dec  8 10:25:52 2002
GNU gdb 4.18 (FreeBSD)
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...
(no debugging symbols found)...
Core was generated by `inetd'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libutil.so.3...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libwrap.so.3...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libipsec.so.1...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libc.so.4...(no debugging symbols found)...done.
Reading symbols from /usr/libexec/ld-elf.so.1...(no debugging symbols found)...
done.
#0  0x804ad01 in getsockname ()
(gdb) bt
#0  0x804ad01 in getsockname ()
#1  0x0 in ?? ()
(gdb) quit

Script done on Sun Dec  8 10:26:07 2002

	However, there is only one call to getsockname() in inetd.c
	Also, I have core dump and will suppy any details needed to track
	this down. Anyway, I've recompiled inetd with -O0 -g for now.
	

>How-To-Repeat:
	Don't known

>Fix:

	Unknown for me.

	Eugene Grosbein
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->dwmalone 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Sat Dec 21 07:25:08 PST 2002 
Responsible-Changed-Why:  
I suspect that the getsockname is a red herring caused by a lack 
of debugging info (it is a syscal, so you're more likely to get 
EFAULT from it, rather than a seg fault). 

I'll take the PR incase you get any more debugging information. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=46088 
State-Changed-From-To: open->closed 
State-Changed-By: dwmalone 
State-Changed-When: Sun Feb 9 12:34:54 PST 2003 
State-Changed-Why:  
I believe this PR is a duplicate of: 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=47313 

which contains more information. I've produced a problem for the 
problem described there. You can get it at: 

http://www.maths.tcd.ie/~dwmalone/inetd-stable.patch 
http://www.maths.tcd.ie/~dwmalone/inetd-current.patch 

It also covers the problems listed in PR 47694 and 46845. If 
you could test the patch, that would be great. 

David. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=46088 
>Unformatted:
