Re: [ctwm] [rt.lp.se #134] ctwm crashed by ClickToFocus function turning on

2007-12-31 Thread 佐藤 純弘 via RT
Thanks, build new binary and confirmed ctwm doesn't crash anymore in the
situation which I mentioned as original report. :)

Cheers,
- Yoshihiro

On Sat, 29 Dec 2007 17:20:39 +0100, Olaf Seibert via RT [EMAIL PROTECTED] 
said:
 
 On Thu 27 Dec 2007 at 16:25:54 +0100, Olaf Seibert via RT wrote:
 I suppose this must be cleaned up, to at least initialise all other
 fields to some sane default.
 
 I committed and pushed that patch, revision
 a8cae659665e273b3e4176d24da78ddfe0e33371.
 
 -Olaf.



Re: [ctwm] [rt.lp.se #134] ctwm crashed by ClickToFocus function turning on

2007-12-29 Thread Olaf Seibert via RT
On Thu 27 Dec 2007 at 16:25:54 +0100, Olaf Seibert via RT wrote:
 I suppose this must be cleaned up, to at least initialise all other
 fields to some sane default.

I committed and pushed that patch, revision
a8cae659665e273b3e4176d24da78ddfe0e33371.

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl-- Cetero censeo authored delendum esse.



Re: [ctwm] [rt.lp.se #134] ctwm crashed by ClickToFocus function turning on

2007-12-27 Thread Olaf Seibert via RT
One difference with the original report that I should mention is that I
encounter the crash only when I move the transient window off-screen.
This seems fairly expected, since the NULL dereference occurs inside an
if-block which tests for exactly such a condition. I used a transient
window of xmh for testing (a bit faster to start up than Firefox and
useful while I was offline).

On Wed 26 Dec 2007 at 21:05:30 +0100, Matthew D. Fuller via RT wrote:
 I wonder if it has something to do with being a transient window
 (which doesn't have occupation, without that option set, which isn't
 in the given rc file).

The same thought had occurred to me. I tried adding
TransientHasOccupation and DecorateTransients (separately and together)
but it made no difference. What does make a difference though is adding
a Workspaces {...} statement. With that, the crash no longer occurs.

Tracing this indeed reveals, in add_window.c:AddWindow():

/*===[ Matthew McNeill 1997 ]==*
 * added the occupation parameter to this function call so that the 
 * occupation can be set up in a specific state if desired 
 * (restore session for example)
 */

/* note, this is where tmp_win-vs get setup, among other things */

if (restoredFromPrevSession) {
  SetupOccupation (tmp_win, saved_occupation);
} else
  SetupOccupation (tmp_win, 0);
tmp_win-old_parent_vs = vs;
/*=*/

and workmgr.c:SetupOccupation() starts with

if (! Scr-workSpaceManagerActive) {
twm_win-occupation = 1;
return;
}
 
I suppose this must be cleaned up, to at least initialise all other
fields to some sane default.

Untested:

if (! Scr-workSpaceManagerActive) {
twm_win-occupation = 1  0;   /* occupy workspace #0 */
/*
 * Choose some valid virtual screen.
 * InitVirtualScreens() always seems to set this to non-NULL.
 */
twm_win-vs = Scr-vScreenList; /* only one virtual screen */
/* more?... */
return;
}

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl-- Cetero censeo authored delendum esse.



Re: [ctwm] [rt.lp.se #134] ctwm crashed by ClickToFocus function turning on

2007-12-27 Thread Rhialto
One difference with the original report that I should mention is that I
encounter the crash only when I move the transient window off-screen.
This seems fairly expected, since the NULL dereference occurs inside an
if-block which tests for exactly such a condition. I used a transient
window of xmh for testing (a bit faster to start up than Firefox and
useful while I was offline).

On Wed 26 Dec 2007 at 21:05:30 +0100, Matthew D. Fuller via RT wrote:
 I wonder if it has something to do with being a transient window
 (which doesn't have occupation, without that option set, which isn't
 in the given rc file).

The same thought had occurred to me. I tried adding
TransientHasOccupation and DecorateTransients (separately and together)
but it made no difference. What does make a difference though is adding
a Workspaces {...} statement. With that, the crash no longer occurs.

Tracing this indeed reveals, in add_window.c:AddWindow():

/*===[ Matthew McNeill 1997 ]==*
 * added the occupation parameter to this function call so that the 
 * occupation can be set up in a specific state if desired 
 * (restore session for example)
 */

/* note, this is where tmp_win-vs get setup, among other things */

if (restoredFromPrevSession) {
  SetupOccupation (tmp_win, saved_occupation);
} else
  SetupOccupation (tmp_win, 0);
tmp_win-old_parent_vs = vs;
/*=*/

and workmgr.c:SetupOccupation() starts with

if (! Scr-workSpaceManagerActive) {
twm_win-occupation = 1;
return;
}
 
I suppose this must be cleaned up, to at least initialise all other
fields to some sane default.

Untested:

if (! Scr-workSpaceManagerActive) {
twm_win-occupation = 1  0;   /* occupy workspace #0 */
/*
 * Choose some valid virtual screen.
 * InitVirtualScreens() always seems to set this to non-NULL.
 */
twm_win-vs = Scr-vScreenList; /* only one virtual screen */
/* more?... */
return;
}

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl-- Cetero censeo authored delendum esse.



Re: [ctwm] [rt.lp.se #134] ctwm crashed by ClickToFocus function turning on

2007-12-26 Thread Matthew D. Fuller via RT
On Sat, Dec 22, 2007 at 03:38:37PM +0100 I heard the voice of
Rhialto, and lo! it spake thus:
 
 So I do think that Tmp_win-vs == NULL is indeed a bug. Somehow ctwm
 seems to think the window isn't on-screen.

I wonder if it has something to do with being a transient window
(which doesn't have occupation, without that option set, which isn't
in the given rc file).


-- 
Matthew Fuller (MF4839)   |  [EMAIL PROTECTED]
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
   On the Internet, nobody can hear you scream.



Re: [ctwm] [rt.lp.se #134] ctwm crashed by ClickToFocus function turning on

2007-12-22 Thread Rhialto
On Thu 22 Nov 2007 at 23:13:08 +0100, Matthew D. Fuller via RT wrote:
 On Sun, Aug 12, 2007 at 08:23:20PM +0200 I heard the voice of
 ?? ?? via RT, and lo! it spake thus:
 
  to reproduce this, 
1. run ctwmrc with attched .ctwmrc
2. then get no-title bar window popup
 easiest way is using Firefox, go basic authenticated page
 then enable to get password popup
3. click button to close popup (OK / Cancel /etc/)
4. ... then ctwm crash, get core.
 
 I get a slightly different trace.  Whether that's due to code changes,
 or corruption from signal handlers, I don't know.
 
 Mine is bombing out in events.c:2681, which is:
 
 XTranslateCoordinates(dpy, Tmp_win-vs-window, [...]
 
 Examination of the core in gdb shows that Tmp_win-vs is NULL, hence
 the SEGV.  The attached patch seems to prevent the crash here, but I
 have no idea whether it's a correct fix, or just invalid in a
 non-crashing way; it's very much shotgunned.  Olaf may know better?

I just found I had overlooked this mail in my inbox.  I'm looking at the
code to refresh my memory.

It appears that Tmp_win-vs is supposed to be non-NULL pretty much all
the time that a window is actually mapped in some virtual screen (and
point to that virtual screen).

In this context, a virtual screen corresponds to a physical monitor, and
if you have several physical monitors arranged with Xinerama, ctwm has a
virtual screen for each (while X does its best to do the opposite, if I
understand correctly, and present them all together as a single
display).

This code deals with the user dragging a window outside of the bounds of
the current virtual screen, and ctwm checks if it should move the window
to a different virtual screen.

(A tricky detail with virtual screens is this: each virtual screens must
display a different workspace, because each window can be shown on only
1 virtual screen. But there are also windows that are present in
multiple workspaces, and if one window happens to be in multiple visible
workspaces, it can still be shown in only one of them. And if it vanishes
from one, it must reappear in another. This makes handling the -vs
pointer somewhat, eh, tricky).

So I do think that Tmp_win-vs == NULL is indeed a bug. Somehow ctwm
seems to think the window isn't on-screen.

Your patch is probably not a bad workaround, especially if there are no
multiple virtual screens around.

Personally my first workaround would probably be to check if it is NULL,
and if so, get out of the whole if-clause, because it is uncertain in
which virtual screen the window is anyway. Something like (untested):

if ((xl  0 || yt  0 || xl  Scr-rootw || yt  Scr-rooth) 
Tmp_win-vs != NULL) {

(and looking at it now, instead of Scr-rootw and -rooth, it should
probably use something else to better express that we're looking at a
virtual screen's width and height)

Maybe I'll have time to look at this in more detail later.

 Matthew Fuller (MF4839)   |  [EMAIL PROTECTED]
-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl-- Cetero censeo authored delendum esse.



Re: [ctwm] [rt.lp.se #134] ctwm crashed by ClickToFocus function turning on

2007-11-22 Thread Matthew D. Fuller via RT
On Sun, Aug 12, 2007 at 08:23:20PM +0200 I heard the voice of
佐藤 純弘 via RT, and lo! it spake thus:

 to reproduce this, 
   1. run ctwmrc with attched .ctwmrc
   2. then get no-title bar window popup
easiest way is using Firefox, go basic authenticated page
then enable to get password popup
   3. click button to close popup (OK / Cancel /etc/)
   4. ... then ctwm crash, get core.

I get a slightly different trace.  Whether that's due to code changes,
or corruption from signal handlers, I don't know.

Mine is bombing out in events.c:2681, which is:

XTranslateCoordinates(dpy, Tmp_win-vs-window, [...]

Examination of the core in gdb shows that Tmp_win-vs is NULL, hence
the SEGV.  The attached patch seems to prevent the crash here, but I
have no idea whether it's a correct fix, or just invalid in a
non-crashing way; it's very much shotgunned.  Olaf may know better?


-- 
Matthew Fuller (MF4839)   |  [EMAIL PROTECTED]
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
   On the Internet, nobody can hear you scream.

#
# old_revision [1dfd5be037e9fb09f9aee3d938dcca2848aa7744]
#
# patch events.c
#  from [39f3358ff082d672b599845150ceab6806a03603]
#to [faecee097f0d8826210e043688de7642c4b3814d]
#

--- events.c39f3358ff082d672b599845150ceab6806a03603
+++ events.cfaecee097f0d8826210e043688de7642c4b3814d
@@ -2675,10 +2675,14 @@ void HandleButtonRelease(void)
if(xl  0 || yt  0 || xl  Scr-rootw || yt  Scr-rooth) {
int odestx, odesty;
int destx, desty;
-   Window cr;
+   Window cr, tsrc;
virtualScreen *newvs;
 
-   XTranslateCoordinates(dpy, Tmp_win-vs-window, 
+   if(Tmp_win-vs!=NULL)
+   tsrc = Tmp_win-vs-window;
+   else
+   tsrc = Scr-Root;
+   XTranslateCoordinates(dpy, tsrc,
Scr-XineramaRoot, xl, yt, odestx, odesty, cr);
 
newvs = findIfVScreenOf(odestx, odesty);


[ctwm] [rt.lp.se #134] ctwm crashed by ClickToFocus function turning on

2007-08-12 Thread 佐藤 純弘 via RT
Hi there,

I got ctwm crash by 3.8a with attached config, here is the stack trace:

(gdb) bt
#0  0x00138cef in _setjmp () from /lib/tls/libc.so.6
#1  0x0017eabd in _IO_no_init () from /lib/tls/libc.so.6
#2  0x0013a4f5 in atol () from /lib/tls/libc.so.6
#3  0x0805b961 in Crash (signum=11) at ctwm.c:1313
#4  0x00138ec8 in raise () from /lib/tls/libc.so.6
#5  0x080979f0 in set_last_window (current=0x6f63692e) at
clicktofocus.c:28
#6  0x080736ae in HandleDestroyNotify () at events.c:2300
#7  0x08073ec5 in HandleUnmapNotify () at events.c:2542
#8  0x0806eb6d in DispatchEvent () at events.c:502
#9  0x0806ec83 in HandleEvents () at events.c:546
#10 0x0805a687 in main (argc=4, argv=0xbfffbd64, environ=0xbfffbd78)
at ctwm.c:905

to reproduce this, 
  1. run ctwmrc with attched .ctwmrc
  2. then get no-title bar window popup
   easiest way is using Firefox, go basic authenticated page
   then enable to get password popup
  3. click button to close popup (OK / Cancel /etc/)
  4. ... then ctwm crash, get core.

Best regards,

Yoshihiro Satou
[EMAIL PROTECTED]

- - - - -
.ctwmrc
- - - - -

ShowIconManager
IconManagerDontShow { xclock xpbiff }
IconManagerGeometry 100x600-2+2 1
IconifyByUnmapping
SortIconManager
NoCaseSensitive
BorderWidth 3
ButtonIndent 0
ConstrainedMoveTime 0
MoveDelta 6
NoBackingStore
NoDefaults
NoMenuShadows
NoSaveUnders
ClickToFocus
RaiseDelay 250
NoTitle { cmdtool xclock xbiff }
NoTitleFocus

IconFont -*-fixed-medium-r-normal-*-14-*-*-*-*-*-jisx0208.1983-0
IconManagerFont
-*-fixed-medium-r-normal-*-14-*-*-*-*-*-jisx0208.1983-0
MenuFont -*-fixed-medium-r-normal-*-14-*-*-*-*-*-jisx0208.1983-0
ResizeFont -*-fixed-medium-r-normal-*-14-*-*-*-*-*-jisx0208.1983-0
TitleFont -*-fixed-medium-r-normal-*-14-*-*-*-*-*-jisx0208.1983-0
WorkSpaceFont -*-fixed-medium-r-normal-*-10-*-*-*-*-*-jisx0208.1983-0

RestartPreviousState
TitleButtonBorderWidth 1
DefaultFunction f.nop
WindowFunction f.iconify
LeftTitleButton :iconify = f.iconify
LeftTitleButton :question = f.menu ThisWinOperations
RightTitleButton :resize = f.resize
Button1 =  : frame   : f.function delta_move_else_raise
Button1 =  : title   : f.function delta_move_else_raiselower
Button1 =  : icon: f.function delta_move_else_deiconify
Button1 =  : iconmgr : f.iconify
Button2 =  : root: f.menu Main Menu
Button2 =  : title   : f.menu Main Menu
Button3 =  : frame   : f.menu ThisWinOperations
Button3 =  : icon: f.menu ThisWinOperations
Button3 =  : iconmgr : f.menu ThisWinOperations
Button3 =  : root: f.menu Main Menu
Button3 =  : title   : f.menu ThisWinOperations
Button1 = c|m  : all : f.beep
Button2 = c|m  : all : f.beep
Button3 = c|m  : window  : f.move
Button1 = m|s  : all : f.beep
Button2 = m|s  : all : f.beep
Button3 = m|s  : all : f.beep
Button1 = m: window  : f.raiselower
Button2 = s: all : f.resize
F9= c: all : f.restart
F9= s: all : f.quit

function delta_move_else_deiconify {
  f.move f.deltastop f.deiconify
}
function delta_move_else_raise {
  f.move f.deltastop f.raise
}
function delta_move_else_raiselower {
  f.move f.deltastop f.raiselower
}


menu ThisWinOperations
 {
THIS Window f.title
Relocate  f.occupy
Destroy f.destroy
Close f.delete
(Un)Zoom f.zoom
Win Refresh f.winrefresh
(De)Iconify f.iconify
Raise f.raise
Lower f.lower
Move f.move
Resize f.resize
Distribute f.occupyall
 }

menu Main Menu
 {
Main Menu f.title
Firefox   !env LC_ALL=ja_JP.eucJP LANG=ja_JP.eucJP 
XMODIFIERS=\@im=kinput2\ firefox 
Emacs !emacs --multibyte -fn fontset-standard 
  f.separator
Apps Term !kterm -km sjis -geometry 91x25 -title AppsTerm  
Calculator!xcalc 
  f.separator
  f.nop
Lock Terminal !xscreensaver-command -lock
  f.nop
  f.separator
Log Out   f.quit
 }