Hi people,

I'm able to reproduce a twm crash.

My environment is:
$ uname -a
FreeBSD oak.pohoyda.family 4.8-STABLE FreeBSD 4.8-STABLE #68: Mon Jul 21 20:31:53 CEST 
2003     [EMAIL PROTECTED]:/usr/src/sys/compile/OAK  i386
$ less /var/log/XFree86.0.log
XFree86 Version 4.2.0 / X Window System
(protocol Version 11, revision 0, vendor release 6600)
Release Date: 18 January 2002
$ less ~/.xsession
xsm
$

twm is built from anoncvs with debuginfo.

I log in via xdm/xlogin, have one xterm and twm started by the
system.xsm file. I save a checkpoint and do an immediate shutdown in
the xsm.

Next time I try to log in, I get a session chooser window, I select
my last session/checkpoint, and that's what happens:
Jul 27 22:34:53 oak /kernel: pid 9056 (twm), uid 1000: exited on signal 11 (core 
dumped)

Here go details:
$ gdb twm twm.core
...
(gdb) bt
#0  0x28234d28 in strcmp () from /usr/lib/libc.so.4
#1  0x80691d3 in GetWindowConfig (theWindow=0x808fc00, x=0xbfbff9ea, 
    y=0xbfbff9e8, width=0xbfbff9e2, height=0xbfbff9e0, iconified=0xbfbff9dc, 
    icon_info_present=0xbfbff9d8, icon_x=0xbfbff9e6, icon_y=0xbfbff9e4, 
    width_ever_changed_by_user=0xbfbff9d0, 
    height_ever_changed_by_user=0xbfbff9cc) at session.c:638
#2  0x804e816 in AddWindow (w=8388642, iconm=1, iconp=0x80cae68)
    at add_window.c:212
#3  0x80659ed in CreateIconManagers () at iconmgr.c:121
#4  0x805320d in main (argc=5, argv=0xbfbffca8) at twm.c:517
(gdb) frame 1
#1  0x80691d3 in GetWindowConfig (theWindow=0x808fc00, x=0xbfbff9ea, 
    y=0xbfbff9e8, width=0xbfbff9e2, height=0xbfbff9e0, iconified=0xbfbff9dc, 
    icon_info_present=0xbfbff9d8, icon_x=0xbfbff9e6, icon_y=0xbfbff9e4, 
    width_ever_changed_by_user=0xbfbff9d0, 
    height_ever_changed_by_user=0xbfbff9cc) at session.c:638
638                     if (strcmp (theWindow->class.res_name,
(gdb) l
633                      * to fail in finding the saved window configuration.
634                      * The best we can do is ignore WM_NAME if its value
635                      * changed in the previous session.
636                      */
637
638                     if (strcmp (theWindow->class.res_name,
639                             ptr->class.res_name) == 0 &&
640                         strcmp (theWindow->class.res_class,
641                             ptr->class.res_class) == 0 &&
642                        (ptr->wm_name == NULL ||
(gdb) l
643                         strcmp (theWindow->name, ptr->wm_name) == 0))
644                     {
645                         if (clientId)
646                         {
647                             /*
648                              * If a client ID was present, we should not check
649                              * WM_COMMAND because Xt will put a -xtsessionID arg
650                              * on the command line.
651                              */
652
(gdb) p theWindow->name
$5 = 0x0
(gdb) p *theWindow
$7 = {next = 0x0, prev = 0x0, w = 8388642, old_bw = 0, frame = 0, title_w = 0, 
  hilite_w = 0, gray = 0, icon_w = 0, icon_bm_w = 0, frame_x = 0, frame_y = 0, 
  frame_width = 0, frame_height = 0, frame_bw = 0, title_x = 0, title_y = 0, 
  icon_x = 0, icon_y = 0, icon_w_width = 0, icon_w_height = 0, icon_width = 0, 
  icon_height = 0, title_height = 0, title_width = 0, full_name = 0x0, 
  name = 0x0, icon_name = 0x0, name_width = 0, highlightx = 0, rightx = 0, 
  attr = {x = 0, y = 0, width = 150, height = 5, border_width = 1, depth = 16, 
    visual = 0x808d300, root = 53, class = 1, bit_gravity = 0, 
    win_gravity = 1, backing_store = 0, backing_planes = 4294967295, 
    backing_pixel = 0, save_under = 0, colormap = 32, map_installed = 1, 
    map_state = 0, all_event_masks = 4194304, your_event_mask = 4194304, 
    do_not_propagate_mask = 0, override_redirect = 0, screen = 0x8090080}, 
  hints = {flags = 0, x = 0, y = 0, width = 0, height = 0, min_width = 0, 
    min_height = 0, max_width = 0, max_height = 0, width_inc = 0, 
    height_inc = 0, min_aspect = {x = 0, y = 0}, max_aspect = {x = 0, y = 0}, 
    base_width = 0, base_height = 0, win_gravity = 0}, wmhints = 0x0, 
  group = 0, class = {res_name = 0x807098c "Untitled", 
    res_class = 0x807098c "Untitled"}, list = 0x0, border = 0, 
  icon_border = 0, border_tile = {fore = 0, back = 0}, title = {fore = 0, 
    back = 0}, iconc = {fore = 0, back = 0}, iconified = 0, icon = 0, 
  icon_on = 0, mapped = 0, auto_raise = 0, forced = 0, icon_not_ours = 0, 
  icon_moved = 0, highlight = 0, stackmode = 0, iconify_by_unmapping = 0, 
  iconmgr = 1, transient = 0, transientfor = 0, titlehighlight = 0, 
  iconmgrp = 0x80cae68, save_frame_x = 0, save_frame_y = 0, 
  save_frame_width = 0, save_frame_height = 0, zoomed = 0, wShaped = 0, 
  protocols = 0, cmaps = {cwins = 0x809a6e0, number_cwins = 1, 
    scoreboard = 0x0}, titlebuttons = 0x0, squeeze_info = 0x0, ring = {
    next = 0x0, prev = 0x0, cursor_valid = 0, curs_x = 0, curs_y = 0}, 
  nameChanged = 0, widthEverChangedByUser = 0, heightEverChangedByUser = 0}
(gdb) 


So, the problem is that the theWindow->name is NULL.

Now, if you look into add_window.c, you'll see:
188         tmp_win = (TwmWindow *)calloc(1, sizeof(TwmWindow));
...

BTW,
...
205         if (!I18N_FetchName(dpy, tmp_win->w, &name))
(gdb) p name
$1 = 0x80948c0 "TWM Icon Manager"

I have no idea what's the correct way to fix this.


-- 
Alexander Pohoyda
<[EMAIL PROTECTED]>
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to