Hello misc, I have a small X application I use on my laptop that behaves buggy after some suspend+resumes. Detailed description below, but first...
HOLY HELL thank you to all the devs who made suspend+resume work! I had almost forgotten what it was like to suspend+walk-to-work+resume and be on my way. Thank you again. The application is a small, horizontal stats display-er. After most suspend+resume's it continues to work fine. It always works fine after the first resume. After 3-5 resume's, there's a ~50% chance the display goes "buggy" (details below). In trying to resolve the problem, I am curious about the following: 1. Initially, I tried to catch a resume thinking a SIGCONT would be issued, and manually clear the display and re-draw. This doesn't appear to happen. Out of curiosity, on a resume is any signal issued to each process? man'ing and Googling haven't helped. Digging through src/sys/kern/* is rewarding, but so far no help. It seemed like a SIGCONT would be appropriate, but am I correct in that this is not the case? 2. Should my application have to do anything specific on a resume? Of course this depends on the application, but regarding the X display, it doesn't immediately appear to me that my application should have to do anything. My app is using rudimentary double-buffering: backbuffer is a Pixmap that's painted black on each call (XFillRectangle), the graphics are drawn, and then XCopyArea'd to the window. When it goes "buggy", it appears some of the backbuffer isn't being cleared, or it's being copied at an offset into the window. The normal display looks like this: http://ryanflannery.net/hacking/xstatbar/barshot.png The buggy display looks like this: http://ryanflannery.net/hacking/xstatbar/xstatbar-bad.png The current code is here, if curious: http://ryanflannery.net/hacking/xstatbar/files/xstatbar-current.tar.gz You can see where the CPU graphs are duplicated, and the green overflows the display. Thanks in advance for any help, and thanks to the devs again for suspend+resume! -Ryan dmesg follows: OpenBSD 4.7-current (GENERIC.MP) #97: Thu Jul 8 16:21:40 MDT 2010 dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP real mem = 3193634816 (3045MB) avail mem = 3094781952 (2951MB) mainbus0 at root bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe0010 (73 entries) bios0: vendor LENOVO version "7LETC1WW (2.21 )" date 07/01/2008 bios0: LENOVO 7658CTO acpi0 at bios0: rev 2 acpi0: tables DSDT FACP SSDT ECDT TCPA APIC MCFG HPET SLIC BOOT ASF! SSDT SSDT SSDT SSDT acpi0: wakeup devices LID_(S3) SLPB(S3) LURT(S3) DURT(S3) IGBE(S4) EXP0(S4) EXP1(S4) EXP2(S4) EXP3(S4) EXP4(S4) PCI1(S4) USB0(S3) USB1(S3) USB2(S3) USB3(S3) USB4(S3) EHC0(S3) EHC1(S3) HDEF(S4) acpitimer0 at acpi0: 3579545 Hz, 24 bits acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat cpu0 at mainbus0: apid 0 (boot processor) cpu0: Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz, 2494.19 MHz cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,NXE,LONG cpu0: 6MB 64b/line 16-way L2 cache cpu0: apic clock running at 199MHz cpu1 at mainbus0: apid 1 (application processor) cpu1: Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz, 2493.75 MHz cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,NXE,LONG cpu1: 6MB 64b/line 16-way L2 cache ioapic0 at mainbus0: apid 1 pa 0xfec00000, version 20, 24 pins ioapic0: misconfigured as apic 2, remapped to apid 1 acpihpet0 at acpi0: 14318179 Hz \\_SB_.PCI0 post-crs: 0 \\_SB_.PCI0 post-bbn: 0, 0 acpiprt0 at acpi0: bus 0 (PCI0) acpiprt1 at acpi0: bus -1 (AGP_) acpiprt2 at acpi0: bus 2 (EXP0) acpiprt3 at acpi0: bus 3 (EXP1) acpiprt4 at acpi0: bus 4 (EXP2) acpiprt5 at acpi0: bus 5 (EXP3) acpiprt6 at acpi0: bus 13 (EXP4) acpiprt7 at acpi0: bus 21 (PCI1) acpiec0 at acpi0 acpicpu0 at acpi0: C3, C2, C1, PSS acpicpu1 at acpi0: C3, C2, C1, PSS acpipwrres0 at acpi0: PUBS acpitz0 at acpi0: critical temperature 127 degC acpitz1 at acpi0: critical temperature 100 degC acpibtn0 at acpi0: LID_ acpibtn1 at acpi0: SLPB acpibat0 at acpi0: BAT0 model "42T4573" serial 2285 type LION oem "SONY" acpibat1 at acpi0: BAT1 not present acpiac0 at acpi0: AC unit online acpithinkpad0 at acpi0 acpidock0 at acpi0: GDCK not docked (0) cpu0: Enhanced SpeedStep 2493 MHz: speeds: 2501, 2500, 2000, 1600, 1200, 800 MHz pci0 at mainbus0 bus 0 pchb0 at pci0 dev 0 function 0 "Intel GM965 Host" rev 0x0c vga1 at pci0 dev 2 function 0 "Intel GM965 Video" rev 0x0c wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation) wsdisplay0: screen 1-5 added (80x25, vt100 emulation) intagp0 at vga1 agp0 at intagp0: aperture at 0xe0000000, size 0x10000000 inteldrm0 at vga1: apic 1 int 16 (irq 10) drm0 at inteldrm0 "Intel GM965 Video" rev 0x0c at pci0 dev 2 function 1 not configured em0 at pci0 dev 25 function 0 "Intel ICH8 IGP M AMT" rev 0x03: apic 1 int 20 (irq 11), address 00:1f:e2:12:76:f7 uhci0 at pci0 dev 26 function 0 "Intel 82801H USB" rev 0x03: apic 1 int 20 (irq 11) uhci1 at pci0 dev 26 function 1 "Intel 82801H USB" rev 0x03: apic 1 int 21 (irq 11) ehci0 at pci0 dev 26 function 7 "Intel 82801H USB" rev 0x03: apic 1 int 22 (irq 11) usb0 at ehci0: USB revision 2.0 uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1 azalia0 at pci0 dev 27 function 0 "Intel 82801H HD Audio" rev 0x03: apic 1 int 17 (irq 11) azalia0: codecs: Analog Devices AD1984, Conexant/0x2bfa, using Analog Devices AD1984 audio0 at azalia0 ppb0 at pci0 dev 28 function 0 "Intel 82801H PCIE" rev 0x03: apic 1 int 20 (irq 11) pci1 at ppb0 bus 2 ppb1 at pci0 dev 28 function 1 "Intel 82801H PCIE" rev 0x03: apic 1 int 21 (irq 11) pci2 at ppb1 bus 3 ath0 at pci2 dev 0 function 0 "Atheros AR5212 (IBM MiniPCI)" rev 0x01: apic 1 int 17 (irq 11) ath0: AR5424 10.3 phy 6.1 rf5424 10.2, WOR2W, address 00:22:69:12:2f:51 ppb2 at pci0 dev 28 function 2 "Intel 82801H PCIE" rev 0x03: apic 1 int 22 (irq 11) pci3 at ppb2 bus 4 ppb3 at pci0 dev 28 function 3 "Intel 82801H PCIE" rev 0x03: apic 1 int 23 (irq 11) pci4 at ppb3 bus 5 ppb4 at pci0 dev 28 function 4 "Intel 82801H PCIE" rev 0x03: apic 1 int 20 (irq 11) pci5 at ppb4 bus 13 uhci2 at pci0 dev 29 function 0 "Intel 82801H USB" rev 0x03: apic 1 int 16 (irq 10) uhci3 at pci0 dev 29 function 1 "Intel 82801H USB" rev 0x03: apic 1 int 17 (irq 11) uhci4 at pci0 dev 29 function 2 "Intel 82801H USB" rev 0x03: apic 1 int 18 (irq 11) ehci1 at pci0 dev 29 function 7 "Intel 82801H USB" rev 0x03: apic 1 int 19 (irq 11) usb1 at ehci1: USB revision 2.0 uhub1 at usb1 "Intel EHCI root hub" rev 2.00/1.00 addr 1 ppb5 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xf3 pci6 at ppb5 bus 21 cbb0 at pci6 dev 0 function 0 "Ricoh 5C476 CardBus" rev 0xba: apic 1 int 16 (irq 10) "Ricoh 5C832 Firewire" rev 0x04 at pci6 dev 0 function 1 not configured cardslot0 at cbb0 slot 0 flags 0 cardbus0 at cardslot0: bus 22 device 0 cacheline 0x0, lattimer 0xb0 pcmcia0 at cardslot0 pcib0 at pci0 dev 31 function 0 "Intel 82801HEM LPC" rev 0x03 pciide0 at pci0 dev 31 function 1 "Intel 82801HBM IDE" rev 0x03: DMA, channel 0 configured to compatibility, channel 1 configured to compatibility atapiscsi0 at pciide0 channel 0 drive 0 scsibus0 at atapiscsi0: 2 targets cd0 at scsibus0 targ 0 lun 0: <Optiarc, DVD RW AD-7910A, 1.D1> ATAPI 5/cdrom removable cd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 pciide0: channel 1 ignored (disabled) ahci0 at pci0 dev 31 function 2 "Intel 82801HBM AHCI" rev 0x03: apic 1 int 16 (irq 10), AHCI 1.1 scsibus1 at ahci0: 32 targets sd0 at scsibus1 targ 0 lun 0: <ATA, FUJITSU MHW2160B, 0084> SCSI3 0/direct fixed sd0: 152627MB, 512 bytes/sec, 312581808 sec total ichiic0 at pci0 dev 31 function 3 "Intel 82801H SMBus" rev 0x03: apic 1 int 23 (irq 11) iic0 at ichiic0 usb2 at uhci0: USB revision 1.0 uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1 usb3 at uhci1: USB revision 1.0 uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1 usb4 at uhci2: USB revision 1.0 uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1 usb5 at uhci3: USB revision 1.0 uhub5 at usb5 "Intel UHCI root hub" rev 1.00/1.00 addr 1 usb6 at uhci4: USB revision 1.0 uhub6 at usb6 "Intel UHCI root hub" rev 1.00/1.00 addr 1 isa0 at pcib0 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 pms0 at pckbc0 (aux slot) pckbc0: using irq 12 for aux slot wsmouse0 at pms0 mux 0 pcppi0 at isa0 port 0x61 midi0 at pcppi0: <PC speaker> spkr0 at pcppi0 aps0 at isa0 port 0x1600/31 mtrr: Pentium Pro MTRR support uvideo0 at uhub1 port 5 configuration 1 interface 0 "Chicony Electronics Co., Ltd. Integrated Camera" rev 2.00/3.20 addr 2 uvideo0: video control not supported for this device. video0 at uvideo0 vscsi0 at root scsibus2 at vscsi0: 256 targets softraid0 at root root on sd0a swap on sd0b dump on sd0b WARNING: / was not properly unmounted video0 detached uvideo0 detached uvideo0 at uhub1 port 5 configuration 1 interface 0 "Chicony Electronics Co., Ltd. Integrated Camera" rev 2.00/3.20 addr 2 uvideo0: video control not supported for this device. video0 at uvideo0