Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Apr 100 21:29:37 +0200 (CEST)
From:      Boris Nikolaus <bn@tellique.de>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/18024: when printing through gs: panic: lockmgr: not exclusive lock holder
Message-ID:  <200004151929.VAA23075@mail.tellique.de>

next in thread | raw e-mail | index | archive | help

>Number:         18024
>Category:       kern
>Synopsis:       when printing through gs: panic: lockmgr: not exclusive lock ho
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 15 12:30:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Boris Nikolaus
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
>Environment:

From dmesg(1):
    ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
    ppc0: Generic chipset (EPP/NIBBLE) in COMPATIBLE mode
    ppi0: <Parallel I/O> on ppbus0
    lpt0: <Printer> on ppbus0
    lpt0: Interrupt-driven port
    plip0: <PLIP network interface> on ppbus0

From config file:
    # Parallel-Port Bus
    device              ppc0    at isa? irq 7
    device              ppbus
    device              lpt
    device              ppi
    device              plip
    options             DEBUG_LOCKS     # Extra debugging code for locks
                                        # added to find the lockmgr panic

From /etc/printcap:
    lp|ps|HP-Destjet 500:\
        :sh:\
        :lp=/dev/lpt0:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:\
        :pl#64:of=/usr/local/libexec/lpd/magicfilter-lp:
    
/usr/local/libexec/lpd/magicfilter-lp: 
    #!/usr/bin/perl 
    
    # treat LF as CR+LF
    printf("\033&k2G") || exit 2;

    # read first two characters
    read(STDIN, $first, 2) || exit 2;
    
    if ($first eq "%!") {
        # it is postscript; use ghostscript to convert
        open(OUT, "|/usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=djet500 -sOu
tputFile=- -");
        select OUT;     
    }                  

    # print file to printer (or ghostscript)
    print $first;
    while (read(STDIN, $buf, 4096)) {
        print $buf;
    }   
    
    if ($first ne "%!") {
        print "\f"; 
    }
    
    exit 0;

>Description:
    
When printing a PostScript file, the kernel panics immediately after printing:
% lpr test.ps
%       
panic: lockmgr: pid 221, not exclusive lock holder 219 unlocking
Debugger("panic")
Stopped at       Debugger+0x35:  movb    $0,0xc02fc980
db> trace              
Debugger(c0290143) at Debugger+0x35
panic(c028f340,dd,c028f320,db,40080040) at panic+0x70
debuglockmgr(c327b838,6,0,c7a0a700,c0292ad0) at debuglockmgr+0x29c
brelse(c327b810,c0948b80,10,0,0) at brelse+0x5b7
PPBUS_WRITE(c094a800,2,2000,c7a0a700,c094a800) at PPBUS_WRITE+0x1e50
spec_vnoperate(c841ae20,c0ae9700,c841ae0c,c022f139,c841ae20) at spec_vnoperate+0
x6e4
ufs_itimes(...) at ufs_itimes+0x250a
ufs_vnoperatespec(...) at ufs_vnoperatespec+0x15
vn_close(...) at vn_close+0x40
debug_vn_lock(...) at debug_vnlock+0xb4
fdrop(...) at fdrop+0xb9
closef(...) at closef+0x9b
fdfree(...) at fdfree+0x30
exit1(...) at exit1+0x189
exit1(...) at exit1
syscall(2f,2f,2f,0,ffffffff) at syscall+0x176
Xint0x80_syscall() at Xint0x80_syscall+0x26
db> ps 
pid proc     addr     uid ppid pgrp flag   stat wmesg wchan cmd
221 c7a0a700 c8419000 1   1    219  006004 2                gs
211 ...                
db>

When converting the file by hand and printing the result, everything works
fine:
% gs -dSAFER -dNOPAUSE -q -sDEVICE=djet500 -sOutputFile=- - <test.ps >test.djet5
00
% lpr test.djet500
% [ no panic ]

I've no idea, why this works and the other panics.

>How-To-Repeat:

On my machine the crash occurs whenever I print a PostScript file.

I have no way to check if it occurs everywhere using my config or magicfilter
or ...

If you need further information (memory dumps after the panic or some config
parameters) don't hesitate to ask me: bn@tellique.de

>Fix:
   
You can get around this bug by converting the postscript file before
printing (s. a.).

>Release-Note:
>Audit-Trail:
>Unformatted:
 lder


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004151929.VAA23075>