I have noticed that Macromedia's flash plugin (i386) acquires semaphores, 
but does not appear to release them.  Exiting opera normally retains the
semaphores.  Duplicate semaphores are created if the plugin crashes -- while
I get no error message while running opera, and an F5 refresh
will start it running again -- I do see an operapluginwrapp.core file,
9.3MB in size but uselessly filled with zeros.

I would just say, "lousy, commercial binary software" but ... repeated
semaphores evetually produce a uvm_fault, on i386-current.

I don't know enough about how the semget syscalls operate to debug this
on my own.  Could this be a linux ABI issue?  Redhat-base?  linux_semget?
sys_semget?  

Pointers to where to look to debug this would be greatly appreciated.

Thanks!

   -Josh Grosse-

The failure and ddb trace:

----

uvm_fault(0xd68dfcf0, 0xf0d0000, 0, 1) -> e
kernel: page fault trap, code=0
Stopped at      sys_semget+0x138:       movzwl  0x14(%eax),%edx
ddb> trace
sys_semget(d65dd9f8,e8449ef8,e8449f58,e8029e30,220e) at sys_semget+0x138
linux_semget(d65dd9f8,e8449f68,e8449f58,1,14b) at linux_semget+0x2a
syscall() at syscall+0x2ea
--- syscall (number 117) ---
0x4eca465f:

----

A more complete trace from the kernel dump:

----

jggimi-josh:/var/crash> gdb bsd.gdb
GNU gdb 6.3
Copyright 2004 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-openbsd3.9"...
(gdb) target kvm bsd.3.core
#0  0xd0454969 in dumpsys () at /usr/src/sys/arch/i386/i386/machdep.c:2667
2667                            if ((error = (*dump)(dumpdev, blkno,
(gdb) bt
#0  0xd0454969 in dumpsys () at /usr/src/sys/arch/i386/i386/machdep.c:2667
#1  0xd045463a in boot (howto=18692)
    at /usr/src/sys/arch/i386/i386/machdep.c:2466
#2  0xd02f8184 in db_boot_crash_cmd (addr=-801934612, haddr=0, count=-1,
    modif=0xe8449cd8 "") at /usr/src/sys/ddb/db_command.c:625
#3  0xd02f7c0f in db_command (last_cmdp=0xd07142c0, cmd_table=0x0)
    at /usr/src/sys/ddb/db_command.c:259
#4  0xd02f7fee in db_command_loop () at /usr/src/sys/ddb/db_command.c:541
#5  0xd02fae06 in db_trap (type=0, code=0) at /usr/src/sys/ddb/db_trap.c:84
#6  0xd0450d1f in kdb_trap (type=6, code=0, regs=0xe8449e78)
    at /usr/src/sys/arch/i386/i386/db_interface.c:146
#7  0xd0460e11 in trap (frame=
      {tf_fs = 88, tf_gs = 16, tf_es = 16, tf_ds = 16, tf_edi = -694341020, 
tf_esi = 1, tf_ebp = -398156064, tf_ebx = 10, tf_edx = 0, tf_ecx = -692979920, 
tf_eax = 252511488, tf_trapno = 6, tf_err = 0, tf_eip = -801934612, tf_cs = 8, 
tf_eflags = 66183, tf_esp = -785272832, tf_ss = 10, tf_vm86_es = -692979920, 
tf_vm86_ds = 0, tf_vm86_fs = 0, tf_vm86_gs = 8718})
    at /usr/src/sys/arch/i386/i386/trap.c:262
#8  0xd0200f26 in calltrap ()
#9  0xd03372ec in sys_semget (p=0xf0d0500, v=0xf0d0500, retval=0xf0d0500)
    at /usr/src/sys/kern/sysv_sem.c:479
#10 0xd05b1886 in linux_semget (p=0xd65dd9f8, v=0x0, retval=0xe8449f58)
    at /usr/src/sys/compat/linux/linux_ipc.c:263
#11 0xd04616ba in syscall (frame=
      {tf_fs = 39, tf_gs = 39, tf_es = 39, tf_ds = 39, tf_edi = 0, tf_esi = 
432, tf_ebp = -813767544, tf_ebx = 2, tf_edx = 1, tf_ecx = 8718, tf_eax = 117, 
tf_trapno = 3, tf_err = 2, tf_eip = 1321879135, tf_cs = 43, tf_eflags = 582, 
tf_esp = -813767572, tf_ss = 39, tf_vm86_es = 0, tf_vm86_ds = 0, tf_vm86_fs = 
0, tf_vm86_gs = 0}) at /usr/src/sys/arch/i386/i386/trap.c:782
#12 0xd0200fe8 in syscall1 ()

----

Here's a look at the semaphores, message queues,  and shared memory in use:

----

jggimi-josh:/var/crash> ipcs -a -C bsd.3.core -N bsd.gdb
Message Queues:
T       ID     KEY        MODE       OWNER    GROUP  CREATOR   CGROUP CBYTES  
QNUM QBYTES LSPID LRPID    STIME    RTIME    CTIME

Shared Memory:
T       ID     KEY        MODE       OWNER    GROUP  CREATOR   CGROUP NATTCH   
SEGSZ  CPID  LPID    ATIME    DTIME    CTIME
m    65536    5432001 --rw------- _postgresql _postgresql _postgresql 
_postgresql      4 9641984 19896 19896 13:12:15 13:12:15 13:12:15
m   196609          0 --rw-------     josh     josh     josh     josh      2  
393216 30063 19190 13:29:16 13:29:20 13:29:16
m    65538          0 --rw-------     josh     josh     josh     josh      2  
196608 20865 19190 13:29:19 no-entry 13:29:19
m    65539          0 --rw-------     josh     josh     josh     josh      2  
196608 10049 19190 13:29:20 no-entry 13:29:20
m    65540          0 --rw-------     josh     josh     josh     josh      2  
393216   452 19190 13:29:21 13:30:14 13:29:21
m    65541          0 --rw-r--r--     josh     josh     josh     josh      1  
790528 19190 17172 13:29:28 13:29:28 13:29:28
m    65542          0 --rw-------     josh     josh     josh     josh      2  
196608   452 19190 13:29:28 13:30:14 13:29:28
m    65543          0 --rw-------     josh     josh     josh     josh      2   
12288   452 19190 13:29:28 13:30:14 13:29:28
m    65544          0 --rw-------     josh     josh     josh     josh      2  
196608 26707 19190 13:29:28 no-entry 13:29:28
m    65545          0 --rw-------     josh     josh     josh     josh      2  
196608 30063 19190 13:29:28 no-entry 13:29:28
m    65546          0 --rw-------     josh     josh     josh     josh      2  
196608 23129 19190 13:29:28 no-entry 13:29:28
m    65547          0 --rw-------     josh     josh     josh     josh      2   
12288 10049 19190 13:29:28 no-entry 13:29:28
m    65548          0 --rw-------     josh     josh     josh     josh      2   
12288 26707 19190 13:29:28 no-entry 13:29:28
m    65549          0 --rw-------     josh     josh     josh     josh      2   
12288 30063 19190 13:29:28 no-entry 13:29:28
m    65550          0 --rw-------     josh     josh     josh     josh      2   
12288 23129 19190 13:29:28 no-entry 13:29:28
m    65551          0 --rw-------     josh     josh     josh     josh      2  
393216 23129 19190 13:29:31 no-entry 13:29:31
m   196624          0 --rw-rw-rw-     josh     josh     josh     josh      0 
1611120  8527 19190 13:32:47 13:32:49 13:32:47
m    65553       8527 --rw-rw----     josh     josh     josh     josh      0   
64528  8527  8527 13:32:47 13:32:49 13:30:10
m    65554          0 --rw-------     josh     josh     josh     josh      2   
12288 20865 19190 13:30:18 no-entry 13:30:18
m    65555          0 --rw-------     josh     josh     josh     josh      2  
393216 20865 19190 13:30:18 no-entry 13:30:18
m    65556          0 --rw-rw-rw-     josh     josh     josh     josh      0 
1611120  9803 19190 13:32:59 13:33:00 13:32:59
m    65557       9803 --rw-rw----     josh     josh     josh     josh      0   
64528  9803  9803 13:32:59 13:33:00 13:32:59
m    65558          0 --rw-rw-rw-     josh     josh     josh     josh      0 
1611120 32140 19190 13:33:10 13:33:11 13:33:10
m    65559      32140 --rw-rw----     josh     josh     josh     josh      0   
64528 32140 32140 13:33:10 13:33:11 13:33:10
m    65560          0 --rw-rw-rw-     josh     josh     josh     josh      0 
1611120 29962 19190 13:33:24 13:33:25 13:33:24
m    65561      29962 --rw-rw----     josh     josh     josh     josh      0   
64528 29962 29962 13:33:24 13:33:25 13:33:24
m    65562          0 --rw-rw-rw-     josh     josh     josh     josh      0 
1611120  2593 19190 13:33:32 13:33:33 13:33:32
m    65563       2593 --rw-rw----     josh     josh     josh     josh      0   
64528  2593  2593 13:33:32 13:33:33 13:33:32
m    65564          0 --rw-rw-rw-     josh     josh     josh     josh      2 
1611120  8718 19190 13:33:44 no-entry 13:33:44

Semaphores:
T       ID     KEY        MODE       OWNER    GROUP  CREATOR   CGROUP NSEMS    
OTIME    CTIME
s    65536          0 --rw-------      www      www     root    wheel     1 
no-entry 13:12:01
s    65537          0 --rw-------      www      www      www      www     1 
no-entry 13:12:01
s    65538    5432001 --rw------- _postgresql _postgresql _postgresql 
_postgresql    17 no-entry 13:12:15
s    65539    5432002 --rw------- _postgresql _postgresql _postgresql 
_postgresql    17 no-entry 13:12:15
s    65540    5432003 --rw------- _postgresql _postgresql _postgresql 
_postgresql    17 no-entry 13:12:15
s    65541       8527 --rw-rw----     josh     josh     josh     josh     1 
no-entry 13:30:10
s    65542       9803 --rw-rw----     josh     josh     josh     josh     1 
no-entry 13:32:59
s    65543      32140 --rw-rw----     josh     josh     josh     josh     1 
no-entry 13:33:10
s    65544      29962 --rw-rw----     josh     josh     josh     josh     1 
no-entry 13:33:24
s    65545       2593 --rw-rw----     josh     josh     josh     josh     1 
no-entry 13:33:32

----

Here's my dmesg.  The DEBUG kernel is GENERIC plus these 3 lines:

makeoptions     DEBUG="-g" # add symbols for gdb
option          USB_DEBUG  # at pascoe@'s request for USB stick debugging
option          SCSIDEBUG  # at pascoe@'s request for USB stick debugging

----

OpenBSD 3.9-current (DEBUG) #3: Tue Jul 18 07:42:03 EDT 2006
    [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/DEBUG
cpu0: AMD Sempron(tm) 2600+ ("AuthenticAMD" 686-class, 256KB L2 cache) 1.84 GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE
real mem  = 502820864 (491036K)
avail mem = 450760704 (440196K)
using 4256 buffers containing 25243648 bytes (24652K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(37) BIOS, date 01/07/05, BIOS32 rev. 0 @ 0xfb9b0, 
SMBIOS rev. 2.2 @ 0xf0000 (44 entries)
bios0: ASUS A7VT
apm0 at bios0: Power Management spec V1.2
apm0: AC on, battery charge unknown
apm0: flags 70102 dobusy 1 doidle 1
pcibios0 at bios0: rev 2.1 @ 0xf0000/0xda84
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfda10/112 (5 entries)
pcibios0: PCI Exclusive IRQs: 3 5 10 11
pcibios0: PCI Interrupt Router at 000:17:0 ("VIA VT82C596A ISA" rev 0x00)
pcibios0: PCI bus #1 is the last bus
bios0: ROM list: 0xc0000/0x7e00 0xc8000/0x8000!
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "VIA VT8378 PCI" rev 0x00
ppb0 at pci0 dev 1 function 0 "VIA VT8377 AGP" rev 0x00
pci1 at ppb0 bus 1
vga1 at pci1 dev 0 function 0 "VIA VT8378 VGA" rev 0x01: aperture at 
0xe4000000, size 0x10000000
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
dc0 at pci0 dev 8 function 0 "Lite-On PNIC-II" rev 0x25: irq 10, address 
00:a0:cc:e3:42:d6
dcphy0 at dc0 phy 31: internal PHY
uhci0 at pci0 dev 16 function 0 "VIA VT83C572 USB" rev 0x80: irq 11
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: VIA UHCI root hub, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 16 function 1 "VIA VT83C572 USB" rev 0x80: irq 10
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: VIA UHCI root hub, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 16 function 2 "VIA VT83C572 USB" rev 0x80: irq 5
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: VIA UHCI root hub, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 16 function 3 "VIA VT6202 USB" rev 0x82: irq 3
ehci0: EHCI version 1.0
usb3 at ehci0: USB revision 2.0
uhub3 at usb3
uhub3: VIA EHCI root hub, rev 2.00/1.00, addr 1
uhub3: 6 ports with 6 removable, self powered
viapm0 at pci0 dev 17 function 0 "VIA VT8235 ISA" rev 0x00
iic0 at viapm0
pciide0 at pci0 dev 17 function 1 "VIA VT82C571 IDE" rev 0x06: ATA133, channel 
0 configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 0: <ExcelStor Technology J880>
wd0: 16-sector PIO, LBA48, 78533MB, 160836480 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 6
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
scsi_inqmatch: 2/5/1 <, , >
cd0 at scsibus0 targ 0 lun 0: <LITE-ON, DVDRW SHW-160P6S, PS01> SCSI0 5/cdrom 
removable
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 4
auvia0 at pci0 dev 17 function 5 "VIA VT8233 AC97" rev 0x50: irq 5
ac97: codec id 0x41445368 (Analog Devices AD1888)
ac97: codec features headphone, 20 bit DAC, No 3D Stereo
audio0 at auvia0
vr0 at pci0 dev 18 function 0 "VIA RhineII-2" rev 0x74: irq 11, address 
00:11:2f:85:b1:90
ukphy0 at vr0 phy 1: Generic IEEE 802.3u media interface, rev. 10: OUI 
0x004063, model 0x0032
isa0 at mainbus0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
lm0 at isa0 port 0x290/8: W83697HF
npx0 at isa0 port 0xf0/16: using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pccom0: console
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
biomask ff6d netmask ff6d ttymask ffef
pctr: user-level cycle counter enabled
mtrr: Pentium Pro MTRR support
uhub3: port 1, device disappeared after reset
uhidev0 at uhub0 port 1 configuration 1 interface 0
uhidev0: vendor 0x062a product 0x0000, rev 1.10/0.00, addr 2, iclass 3/1
ums0 at uhidev0: 3 buttons and Z dir.
wsmouse0 at ums0 mux 0
dkcsum: wd0 matches BIOS drive 0x80
root on wd0a

Reply via email to