Black screen of death

Dear all

I have this strange problem. While running a phab developed application
containing approx 350 widgets clicking on a button widget (not always the
same one) causes the screen to go black.

My application is still active as I can press the Windows Start button on
the keyboard and bring up a terminal and type pidin arg and see my processes
still running, but there is no output to the screen.

The terminal window does not have any boarders.

If I ctl/alt/shift/backspace I can restart photon and the problem is fixed
but my photon application has died as expected.

Anyone else seen anything like this.

Rod Stevens
CSIRO Minerals

That sounds like a pwm crash.

Does your application have many windows? Does the crash usually happen
when some of them are being closed? Does it always happen when the
click causes the keyboard focus to be given to the window, or does it
sometimes happen when the window you click on already has focus? Do all
your windows have the Ph_WM_FOCUS flag set in Pt_ARG_WINDOW_MANAGED_FLAGS?

Rodney Stevens wrote:

Dear all

I have this strange problem. While running a phab developed application
containing approx 350 widgets clicking on a button widget (not always the
same one) causes the screen to go black.

My application is still active as I can press the Windows Start button on
the keyboard and bring up a terminal and type pidin arg and see my processes
still running, but there is no output to the screen.

The terminal window does not have any boarders.

If I ctl/alt/shift/backspace I can restart photon and the problem is fixed
but my photon application has died as expected.

Anyone else seen anything like this.

Rod Stevens
CSIRO Minerals

Wojtek

To answer your questions

The application has 2 major windows one of which has tabs to 6 panes with a
lot of widgets, the other 4 windows/dialogs are basic.

“Closing windows” Yes I have had it do this, so I reconfigured the program
so that the main window never closes. Now I only seem to get it when someone
clicks a button. Opening and closing sub windows does not seem to pose the
same problem.

Clicking a button has code in the callback to change the image attached to
that button as well as doing the callback task There is also an image
asingned to the button to indicate that it has been pressed. I don’t know
whether this may have anything to do with the instability.

This fault only shows up randomly and is not reproduceable by doing the same
sequence of button presses.

The buttons are on the window that has focus. One brings up a new window the
other just changes the button image as explained above.

I will have to check the Ph_WM_FOCUS flags.

Could data/array pointer errors corrupt something that could cause the pmw
to crash or is it memory protected from my application (I thought it would
be).

Thanks for these thoughts.

Rod

“Wojtek Lerch” <Wojtek_L@yahoo.ca> wrote in message
news:duk7q9$ojh$1@inn.qnx.com

That sounds like a pwm crash.

Does your application have many windows? Does the crash usually happen
when some of them are being closed? Does it always happen when the click
causes the keyboard focus to be given to the window, or does it sometimes
happen when the window you click on already has focus? Do all your
windows have the Ph_WM_FOCUS flag set in Pt_ARG_WINDOW_MANAGED_FLAGS?

Rodney Stevens wrote:
Dear all

I have this strange problem. While running a phab developed application
containing approx 350 widgets clicking on a button widget (not always the
same one) causes the screen to go black.

My application is still active as I can press the Windows Start button on
the keyboard and bring up a terminal and type pidin arg and see my
processes still running, but there is no output to the screen.

The terminal window does not have any boarders.

If I ctl/alt/shift/backspace I can restart photon and the problem is
fixed but my photon application has died as expected.

Anyone else seen anything like this.

Rod Stevens
CSIRO Minerals

Wojtek

Thanks for the hint about the managed flags, it would seem that one of the
development team members had change a number of the managed flags and I had
not noticed the fact.

I have reset the managed flags to default and will see how the system
performs now.

Rod

Rodney Stevens wrote:

Wojtek

To answer your questions

The application has 2 major windows one of which has tabs to 6 panes with a
lot of widgets, the other 4 windows/dialogs are basic.

Since we’re talking about a window manager problem, it doesn’t matter
what kind of widgets you have in the windows. As far as pwm is
concerned, a window is atomic, and the widgets in your window are just
some private data structures that your application uses to keep track of
what to draw in the window and how to react to clicks at different
positions in the window. And, of course, pwm doesn’t care what you draw
or how you react to clicks, unless the reaction involves opening,
closing, or changing the state of windows.

“Closing windows” Yes I have had it do this, so I reconfigured the program
so that the main window never closes. Now I only seem to get it when someone
clicks a button. Opening and closing sub windows does not seem to pose the
same problem.

The reason I asked about opening and closing windows is because there’s
a known bug in pwm that can sometimes cause a crash after you close a
parent window that has a child window, but only if one of them has the
Ph_WM_FOCUS flag unset (I don’t remember which one). If your crash
happens when no windows are being closed, or when all windows have the
Ph_WM_FOCUS flag set, then it seems that you have discovered a different
bug.

Clicking a button has code in the callback to change the image attached to
that button as well as doing the callback task There is also an image
asingned to the button to indicate that it has been pressed. I don’t know
whether this may have anything to do with the instability.

No, pwm has no way to know anything about your buttons or their images.

This fault only shows up randomly and is not reproduceable by doing the same
sequence of button presses.

That part is consistent with the known bug: since it involves accessing
memory after it’s been freed, the crash depends on subtle details of
what your heap happens to look like, which is affected by such things as
the speed of your mouse when it touched a window frame, which parts of
the frame it touched, and so on.

The buttons are on the window that has focus. One brings up a new window the
other just changes the button image as explained above.

Does the crash actually happen when a new window is being opened?
Does it depend on whether the window you click on has the focus already
or it’s the click that gives it focus?

I will have to check the Ph_WM_FOCUS flags.

Could data/array pointer errors corrupt something that could cause the pmw
to crash or is it memory protected from my application (I thought it would
be).

The memory is protected, but theoretically, a corruption could cause you
to send a bad message that pwm doesn’t know how to handle. Of course,
there’s code in pwm that checks the sanity of incoming messages and
tries to reject the obviously silly ones, but since that code is not
something that gets a high priority in our testing, there’s a chance
that it’s not completely bullet-proof.

But if it was your application corrupting its memory, I’d expect it to
crash more often than cause pwm to crash – have you seen your
application crash, too?

Thanks for these thoughts.

Rod

Rodney Stevens wrote:

Wojtek

Thanks for the hint about the managed flags, it would seem that one of the
development team members had change a number of the managed flags and I had
not noticed the fact.

I don’t blame you – there’s no officially documented relation between
the managed flags and pwm crashes, is there? :wink: