Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Question about suspend+resume & X11-application buggy-ness

From: Owain Ainsworth (zerooagooglemail.com)
Date: Mon Aug 02 2010 - 09:45:00 CDT

On Sun, Aug 01, 2010 at 03:02:22PM -0400, Ryan Flannery wrote:
> 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!

This would be an X/kernel bug. I have a couple of theories and am
looking into it. Depending on work commitments expect something in a day
or three.

Nearly all men can stand adversity, but
if you want to test a man's character, give him power.
                -- Abraham Lincoln