From nobody@FreeBSD.org  Wed Sep 26 17:36:44 2007
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 996F716A41B
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 26 Sep 2007 17:36:44 +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 994F213C48E
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 26 Sep 2007 17:36:44 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l8QHaixG041410
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 26 Sep 2007 17:36:44 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.1/8.14.1/Submit) id l8QHahiL041409;
	Wed, 26 Sep 2007 17:36:43 GMT
	(envelope-from nobody)
Message-Id: <200709261736.l8QHahiL041409@www.freebsd.org>
Date: Wed, 26 Sep 2007 17:36:43 GMT
From: Serguey Grigoriev <serguey-grigoriev@yandex.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Parallel port printing crashes CURRENT
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         116669
>Category:       kern
>Synopsis:       [lpt] [patch] Parallel port printing crashes CURRENT
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jhb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 26 17:40:07 GMT 2007
>Closed-Date:    Mon Sep 29 15:48:13 UTC 2008
>Last-Modified:  Mon Sep 29 15:48:13 UTC 2008
>Originator:     Serguey Grigoriev
>Release:        7-CURRENT amd64
>Organization:
PCN JSC
>Environment:
FreeBSD amico.pcn.su 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Wed Sep 26 11:24:13 MSD 2007     root@amico.pcn.su:/usr/obj/usr/src/sys/SMPALTQ  amd64
>Description:
my 7-Current amd64 system panics during sending print jobs to LPT connected
printers. I've found this problem at the beginning of May. Kernels compiled
with April or older sources still work fine.

Panic screens look like this:

panic: bad stray interrupt
cpuid = 0
KDB: enter: panic
[thread pid = 11 tid 100002 ]
Stopped at kdb_enter+0x2f: leave

The call stack trace is:

Tracing pid 11 tid 100002 td 0xffffff003db84990
kdb_enter() at kdb_enter+0x30
intr_execute_handlers() at intr_execute_handlers+0x183
Xapic_isr1() at Xapic_isr1()+0x7f
--- interrupt, rip = 0xffffffff8071ec56, rsp = 0xffffffffa075fbd0, rbp > = 0xffffffffa075fbe0 ---
acpi_cpu_c1() at acpi_cpu_c1+0x6
acpi_cpu_idle() at acpi_cpu_idle+0x27c
sched_idletd() at sched_idletd+0x35
fork_exit() at fork_exit+0x153
fork_trampoline() at fork_trampoline+0xe
--- trap 0, rip = 0, rsp = 0xffffffffa075fd30, rbp = 0 ---

There is a workaround. If LPT ports are switched to the polling mode the
system does not crash but becomes less interactive. For example the mouse
pointer is periodically (during sending print jobs over LPT) blocked on
the screen for a few seconds.

>How-To-Repeat:
This problem repeats every time I print not tiny files.
>Fix:


>Release-Note:
>Audit-Trail:

From: "Li-Lun \"Leland\" Wang" <llwang@infor.org>
To: bug-followup@FreeBSD.org, serguey-grigoriev@yandex.ru
Cc:  
Subject: Re: kern/116669: Parallel port printing crashes CURRENT
Date: Tue, 9 Oct 2007 20:55:13 -0500

 I am experiencing the same problem on my amd64 -current box.  It seems
 that it does not always panic when I print.  Sometimes the printing job
 succeeds, but then my ad0 and msk0 stops responding with the console
 flooded with messages like
 
 ad0: WARNING - SETFEATURES SET TRANSFER MODE taskqueue timeout -
 completing request directly
 ad0: WARNING - SETFEATURES SET_MULTI taskqueue timeout - completing
 request directly
 ad0: WARNING - SETFEATURES SET ENABLE RCACHE taskqueue timeout -
 completing request directly
 ad0: WARNING - SETFEATURES SET ENABLE WCACHE taskqueue timeout -
 completing request directly
 msk0: watchdog timeout (missed Tx interrupts) -- recovering
 
 I obtained a kernel dump with INVARIANTS, WITNESS, and DIAGNOSTIC
 enabled, but somehow I wasn't able to boot with WITNESS enabled without
 WITNESS_SKIPSPIN.  Here is my backtrace.  I can provide my dump if
 needed.
 
 Unread portion of the kernel message buffer:
 lpt0: [GIANT-LOCKED]
 lpt0: [ITHREAD]
 
 
 Flaptta0l:  t[rGaIpA NT3-0L:O CKED]
 lpt0: [ITHREAD]
 reserved (unknown) fault while in kernel mode
 cpuid = 0; apic id = 00
 instruction pointer     = 0x8:0xffffffff8035c092
 stack pointer           = 0x10:0xffffffffabb5ab90
 frame pointer           = 0x10:0xffffffffabb5aba0
 code segment            = base 0x0, limit 0xfffff, type 0x1b
                         = DPL 0, pres 1, long 1, def32 0, gran 1
 processor eflags        = interrupt enabled, IOPL = 0
 current process         = 11 (idle: cpu0)
 Physical memory: 2022 MB
 Dumping 160 MB: 145 129 113 97 81 65 49 33 17 1
 
 #0  doadump () at pcpu.h:194
 194             __asm __volatile("movq %%gs:0,%0" : "=r" (td));
 (kgdb) bt
 #0  doadump () at pcpu.h:194
 #1  0xffffffff8018191c in db_fncall (dummy1=Variable "dummy1" is not available.
 ) at /usr/src/sys/ddb/db_command.c:486
 #2  0xffffffff80181e1c in db_command_loop () at
 /usr/src/sys/ddb/db_command.c:401
 #3  0xffffffff8018375d in db_trap (type=Variable "type" is not available.
 ) at /usr/src/sys/ddb/db_main.c:222
 #4  0xffffffff8025618a in kdb_trap (type=30, code=0, tf=0xffffffffabb5aae0)
     at /usr/src/sys/kern/subr_kdb.c:502
 #5  0xffffffff8037c042 in trap_fatal (frame=0xffffffffabb5aae0,
 eva=Variable "eva" is not available.
 )
     at /usr/src/sys/amd64/amd64/trap.c:692
 #6  0xffffffff8037caec in trap (frame=0xffffffffabb5aae0) at
 /usr/src/sys/amd64/amd64/trap.c:499
 #7  0xffffffff8036354e in calltrap () at
 /usr/src/sys/amd64/amd64/exception.S:169
 #8  0xffffffff8035c092 in acpi_cpu_c1 () at
 /usr/src/sys/amd64/acpica/acpi_machdep.c:68
 #9  0xffffffff8018eae2 in acpi_cpu_idle () at
 /usr/src/sys/dev/acpica/acpi_cpu.c:937
 #10 0xffffffff8024c2ec in sched_idletd (dummy=Variable "dummy" is not available.
 ) at /usr/src/sys/kern/sched_ule.c:2601
 #11 0xffffffff80213d1d in fork_exit (callout=0xffffffff8024c292
 <sched_idletd>, arg=0x0,
     frame=0xffffffffabb5ac80) at /usr/src/sys/kern/kern_fork.c:796
 #12 0xffffffff803638be in fork_trampoline () at
 /usr/src/sys/amd64/amd64/exception.S:397
 #13 0x0000000000000000 in ?? ()
 #14 0x0000000000000000 in ?? ()
 #15 0x0000000000000001 in ?? ()
 #16 0x0000000000000000 in ?? ()
 #17 0x0000000000000000 in ?? ()
 #18 0x0000000000000000 in ?? ()
 #19 0x0000000000000000 in ?? ()
 #20 0x0000000000000000 in ?? ()
 #21 0x0000000000000000 in ?? ()
 #22 0x0000000000000000 in ?? ()
 #23 0x0000000000000000 in ?? ()
 #24 0x0000000000000000 in ?? ()
 #25 0x0000000000000000 in ?? ()
 #26 0x0000000000000000 in ?? ()
 #27 0x0000000000000000 in ?? ()
 #28 0x0000000000000000 in ?? ()
 #29 0x0000000000000000 in ?? ()
 #30 0x0000000000000000 in ?? ()
 #31 0x0000000000000000 in ?? ()
 ---Type <return> to continue, or q <return> to quit---
 #32 0x0000000000000000 in ?? ()
 #33 0x0000000000000000 in ?? ()
 #34 0x0000000000000000 in ?? ()
 #35 0x0000000000000000 in ?? ()
 #36 0x0000000000000000 in ?? ()
 #37 0x0000000000903000 in ?? ()
 #38 0xffffffff8056e540 in tdg_maxid ()
 #39 0xffffffff8057ad40 in tdq_cpu ()
 #40 0xffffff00010c5cf8 in ?? ()
 #41 0xffffff00010c59f0 in ?? ()
 #42 0xffffffffabb5a4a0 in ?? ()
 #43 0xffffffffabb5a448 in ?? ()
 #44 0xffffffff8057ad40 in tdq_cpu ()
 #45 0xffffffff8024bbcc in sched_switch (td=0xffffffff8024c292,
 newtd=Cannot access memory at address 0xffffffffffffffb0
 )
     at /usr/src/sys/kern/sched_ule.c:1902
 Previous frame inner to this frame (corrupt stack?)

From: Richard Loken <tech@athabascau.ca>
To: bug-followup@FreeBSD.org, serguey-grigoriev@yandex.ru
Cc:  
Subject: Re: kern/116669: Parallel port printing crashes CURRENT
Date: Fri, 21 Dec 2007 10:12:10 -0700

 I am experiancing the printer on parallel port system crash on an AMD64 
 but I have FreeBSD 7.0rc4 for i386.  Tiny files print but any thing of 
 any size causes a crash and reboot.  I will try changing the port 
 configuration as described in the problem report but a fix would 
 appreciated.
 
      Richard Loken
      Senior System Administrator
      Athabasca University
      Athabasca, Alberta  Canada
 
 
 __ 
     This communication is intended for the use of the recipient to whom it
     is addressed, and may contain confidential, personal, and or privileged
     information. Please contact us immediately if you are not the intended
     recipient of this communication, and do not copy, distribute, or take
     action relying on it. Any communications received in error, or
     subsequent reply, should be deleted or destroyed.
 ---

From: "S.N.Grigoriev" <serguey-grigoriev@yandex.ru>
To: bug-followup@freebsd.org
Cc:  
Subject: kern/116669: Parallel port printing crashes CURRENT
Date: Thu, 10 Jan 2008 17:12:12 +0300

 Patch proposed by John Baldwin at
 
 http://www.FreeBSD.org/~jhb/patches/ppbus_intr.patch
 
 has fixed the problem. This PR can be closed.
 
 Regards,
 Serguey Grigoriev.
State-Changed-From-To: open->analyzed 
State-Changed-By: linimon 
State-Changed-When: Fri Jan 11 02:16:44 UTC 2008 
State-Changed-Why:  
jhb has proposed a patch as a workaround and the submitter notes that  
it fixes the problem to him.  So, assign this one pending checkin. 

The discussion in another thread seemed to indicate that this was a 
workaround, and a more complete solution will be needed post-release. 


Responsible-Changed-From-To: freebsd-bugs->jhb 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Jan 11 02:16:44 UTC 2008 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=116669 
State-Changed-From-To: analyzed->closed 
State-Changed-By: jhb 
State-Changed-When: Mon Sep 29 15:47:09 UTC 2008 
State-Changed-Why:  
The better fix is now in HEAD (ppc has its own intr_event to handle 
child interrupt handlers).  I don't think it will be merged to 7.x, 
however. 

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