From nobody@FreeBSD.org  Sun Jan  3 08:21:19 2010
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 E25A4106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  3 Jan 2010 08:21:19 +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 D0FF78FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  3 Jan 2010 08:21:19 +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 o038LJkX011385
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 3 Jan 2010 08:21:19 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o038LJ4B011384;
	Sun, 3 Jan 2010 08:21:19 GMT
	(envelope-from nobody)
Message-Id: <201001030821.o038LJ4B011384@www.freebsd.org>
Date: Sun, 3 Jan 2010 08:21:19 GMT
From: Vaibhav Gavane <vaibhav.gavane@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: sysutils/apcupsd segfaults during shutdown
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         142259
>Category:       ports
>Synopsis:       sysutils/apcupsd segfaults during shutdown
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    itetcu
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 03 08:30:02 UTC 2010
>Closed-Date:    Mon Jan 21 18:56:02 UTC 2013
>Last-Modified:  Mon Jan 21 18:56:02 UTC 2013
>Originator:     Vaibhav Gavane
>Release:        8.0-RELEASE
>Organization:
>Environment:
FreeBSD 127.0.0.1 8.0-RELEASE-p1 FreeBSD 8.0-RELEASE-p1 #1: Fri Dec 4 20:11:36 IST 2009 root@127.0.0.1:/usr/obj/usr/src/sys/CUSTOM i386
>Description:
apcupsd terminates (sometimes) with a segmentation fault during shutdown. The fault occurs in drivers/usb/generic/generic-usb.c::pusb_ups_check_state at line:

retval = usb_interrupt_read(my_data->fd, USB_ENDPOINT_IN|1, (char*)buf, sizeof(buf), timeout);

when my_data is NULL.
>How-To-Repeat:
The problem is not reproducible with every shutdown/restart; just seems to happen every now and then.
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->itetcu 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Jan 3 08:30:13 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142259 
State-Changed-From-To: open->feedback 
State-Changed-By: itetcu 
State-Changed-When: Tue Jan 5 07:37:55 UTC 2010 
State-Changed-Why:  
Can you please compile with debug and symbols and optain a backtraceble 
core? Thanks. 

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

From: Vaibhav Gavane <vaibhav.gavane@gmail.com>
To: itetcu@freebsd.org, bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/142259: sysutils/apcupsd segfaults during shutdown
Date: Tue, 5 Jan 2010 15:42:37 +0530

 --001636e1fcaed2c78a047c681373
 Content-Type: text/plain; charset=ISO-8859-1
 
 On Tue, Jan 5, 2010 at 1:07 PM,  <itetcu@freebsd.org> wrote:
 
 > Synopsis: sysutils/apcupsd segfaults during shutdown
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: itetcu
 > State-Changed-When: Tue Jan 5 07:37:55 UTC 2010
 > State-Changed-Why:
 > Can you please compile with debug and symbols and optain a backtraceble
 > core? Thanks.
 >
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=142259
 >
 
 Backtrace from core:
 
 Thread 2 (Thread 28201140 (LWP 100101)):
 #0 0x0805325f in pusb_ups_check_state (ups=0x28206000) at generic-usb.c:539
 #1 0x08051f21 in usb_ups_check_state (ups=0x28206000) at usb.c:214
 #2 0x0804a34d in do_device (ups=0x28206000) at device.c:237
 #3 0x0804cc93 in main (argc=2, argv=0xbfbfee30) at apcupsd.c:317
 
 Thread 1 (Thread 2824e140 (LWP 100115)):
 #0 0x281b5273 in read () from /lib/libc.so.7
 #1 0x280bab62 in read () from /lib/libthr.so.3
 #2 0x08057bba in check_stale_lockfile (ups=0x28206000) at apclock.c:78
 #3 0x08057dbf in delete_lockfile (ups=0x28206000) at apclock.c:238
 #4 0x0804c7ec in apcupsd_terminate (sig=15) at apcupsd.c:97
 #5 <signal handler called>
 #6 0x281b51f3 in select () from /lib/libc.so.7
 #7 0x280ba9d0 in select () from /lib/libthr.so.3
 #8 0x0805716f in net_accept (fd=6, cli_addr=0xbf9fef74) at apclibnis.c:369
 #9 0x0804d46b in do_server (ups=0x28206000) at apcnis.c:187
 #10 0x280b870f in pthread_getprio () from /lib/libthr.so.3
 #11 0x00000000 in ?? ()
 0x0805325f 539 retval = usb_interrupt_read(my_data->fd, USB_ENDPOINT_IN|1,
 (char*)buf, sizeof(buf), timeout);
 
 --001636e1fcaed2c78a047c681373
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 On Tue, Jan 5, 2010 at 1:07 PM, =A0<span dir=3D"ltr">&lt;<a href=3D"mailto:=
 itetcu@freebsd.org">itetcu@freebsd.org</a>&gt;</span> wrote:<br><blockquote=
  class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli=
 d;padding-left:1ex;">
 Synopsis: sysutils/apcupsd segfaults during shutdown<br>
 <br>
 State-Changed-From-To: open-&gt;feedback<br>
 State-Changed-By: itetcu<br>
 State-Changed-When: Tue Jan 5 07:37:55 UTC 2010<br>
 State-Changed-Why:<br>
 Can you please compile with debug and symbols and optain a backtraceble<br>
 core? Thanks.<br>
 <br>
 <a href=3D"http://www.freebsd.org/cgi/query-pr.cgi?pr=3D142259" target=3D"_=
 blank">http://www.freebsd.org/cgi/query-pr.cgi?pr=3D142259</a><br>
 </blockquote><div><br></div><div>Backtrace from core:</div><div><br>Thread =
 2 (Thread 28201140 (LWP 100101)):<br>#0  0x0805325f in pusb_ups_check_state=
  (ups=3D0x28206000) at generic-usb.c:539<br>#1  0x08051f21 in usb_ups_check=
 _state (ups=3D0x28206000) at usb.c:214<br>
 #2  0x0804a34d in do_device (ups=3D0x28206000) at device.c:237<br>#3  0x080=
 4cc93 in main (argc=3D2, argv=3D0xbfbfee30) at apcupsd.c:317<br><br>Thread =
 1 (Thread 2824e140 (LWP 100115)):<br>#0  0x281b5273 in read () from /lib/li=
 bc.so.7<br>
 #1  0x280bab62 in read () from /lib/libthr.so.3<br>#2  0x08057bba in check_=
 stale_lockfile (ups=3D0x28206000) at apclock.c:78<br>#3  0x08057dbf in dele=
 te_lockfile (ups=3D0x28206000) at apclock.c:238<br>#4  0x0804c7ec in apcups=
 d_terminate (sig=3D15) at apcupsd.c:97<br>
 #5  &lt;signal handler called&gt;<br>#6  0x281b51f3 in select () from /lib/=
 libc.so.7<br>#7  0x280ba9d0 in select () from /lib/libthr.so.3<br>#8  0x080=
 5716f in net_accept (fd=3D6, cli_addr=3D0xbf9fef74) at apclibnis.c:369<br>#=
 9  0x0804d46b in do_server (ups=3D0x28206000) at apcnis.c:187<br>
 #10 0x280b870f in pthread_getprio () from /lib/libthr.so.3<br>#11 0x0000000=
 0 in ?? ()<br>0x0805325f      539           retval =3D usb_interrupt_read(m=
 y_data-&gt;fd, USB_ENDPOINT_IN|1, (char*)buf, sizeof(buf), timeout);<br><br=
 >
 </div>
 
 --001636e1fcaed2c78a047c681373--
State-Changed-From-To: feedback->open 
State-Changed-By: itetcu 
State-Changed-When: Tue Jan 12 17:25:46 UTC 2010 
State-Changed-Why:  
Feedback received. 

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

From: Vaibhav Gavane <vaibhav.gavane@gmail.com>
To: "bug-followup"@FreeBSD.org
Cc: Ion-Mihai Tetcu <itetcu@freebsd.org>
Subject: Re: ports/142259: sysutils/apcupsd segfaults during shutdown
Date: Sat, 1 May 2010 16:53:31 +0530

 I have found that disabling the network information server causes
 apcupsd to terminate somewhat differently during shutdown. The
 following lines appear in messages:
 
 May  1 15:55:54 127 apcupsd[588]: apcupsd exiting, signal 15
 May  1 15:55:54 127 apcupsd[588]: apcupsd FATAL ERROR in newups.c at
 line 103 Mutex lock failure. ERR=Resource deadlock avoided
 May  1 15:55:55 127 last message repeated 4653 times
 May  1 15:55:55 127 kernel: pid 588 (apcupsd), uid 0: exited on signal
 11 (core dumped)
 
 The figure "4653" is variable. Correspondingly, the following lines
 fill up apcupsd.events:
 
 2010-05-01 15:55:55 +0530  apcupsd FATAL ERROR in newups.c at line 103
 Mutex lock failure. ERR=Resource deadlock avoided
 
 Core dumps are also variable. In one particular case, the backtrace is:
 
 Thread 1 (Thread 28201140 (LWP 100093)):
 #0  0x281a5d24 in open () from /lib/libc.so.7
 Cannot access memory at address 0xbf9fffb0
 
 And in another case:
 
 Thread 1 (Thread 28201140 (LWP 100099)):
 #0  0x281b26fc in fwrite () from /lib/libc.so.7
 #1  0x281a595f in open () from /lib/libc.so.7
 #2  0xbfa003d0 in ?? ()
 #3  0xbfa001cc in ?? ()
 #4  0xbfa00384 in ?? ()
 #5  0x281c8ad8 in ?? () from /lib/libc.so.7
 #6  0x281c8ad8 in ?? () from /lib/libc.so.7
 #7  0x00000001 in ?? ()
 #8  0xbfa003a8 in ?? ()
 #9  0x281a6ffd in open () from /lib/libc.so.7
 #10 0x00000000 in ?? ()
 <snip>
 #97 0x281b2825 in fwrite () from /lib/libc.so.7
 Previous frame inner to this frame (corrupt stack?)
State-Changed-From-To: open->feedback 
State-Changed-By: itetcu 
State-Changed-When: Fri Nov 30 22:26:04 UTC 2012 
State-Changed-Why:  
Can you test with the latest port and let me know if there is still a 
problem? Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=142259 
State-Changed-From-To: feedback->closed 
State-Changed-By: itetcu 
State-Changed-When: Mon Jan 21 18:56:02 UTC 2013 
State-Changed-Why:  
Feedback timeout 

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