After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 114035 - Wrong window sizes on Alpha, AMD64 architecture
Wrong window sizes on Alpha, AMD64 architecture
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
2.5.x
Other Linux
: High major
: METACITY2.6.x
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2003-05-30 13:58 UTC by Jens Bech Madsen
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Metacity logfile (296.88 KB, text/plain)
2003-05-30 14:12 UTC, Jens Bech Madsen
Details

Description Jens Bech Madsen 2003-05-30 13:58:14 UTC
This is using CVS HEAD built with jhbuild. Happens with both gcc-2.95 and 3.0.

Most windows are very large. A lot can't be resized for some reason. The
ones that I can resize show very strange sizes in the geometry box. Values
such as -570 x 987653656 are common.

Nautilus windows seem be have normal size as well. Also konsole (KDE
terminal) seems to work ok. All other terminals and most Gnome2
applications display this behaviour.

Looking through the metacity log file I see things like this which look
suspicious:


GEOMETRY: Updating WM_NORMAL_HINTS for 0x1800009 (Terminal)
GEOMETRY: Window 0x1800009 (Terminal) sets base size 1707 x 11946
GEOMETRY: Window 0x1800009 (Terminal) sets min size 15 x 1088604321
GEOMETRY: Window 0x1800009 (Terminal) sets resize width inc: 29952 height
inc: 6144
GEOMETRY: Window 0x1800009 (Terminal) sets gravity 0
Comment 1 Jens Bech Madsen 2003-05-30 14:12:09 UTC
Created attachment 16989 [details]
Metacity logfile
Comment 2 Jens Bech Madsen 2003-05-30 14:13:16 UTC
Note, I had to shorten the logfile since bugzilla failed when I tried
to upload the entire logfile. It should still contain the things I
find suspicious.
Comment 3 Havoc Pennington 2003-05-30 14:34:37 UTC
does "PWS" mean anything significant?

Metacity stable branch is known to work on 64-bit 
(I just fixed a startup bug on big-endian 64-bit, but it 
was already working fine on little)

HEAD may have some 64-bit issues as I don't know if it's been tested.
Hard for anyone to debug though, unless they have a 64-bit system.
Comment 4 Jens Bech Madsen 2003-05-30 14:47:55 UTC
PWS = Personal WorkStation, I doubt it matters, though I don't know
all that much about the Alpha architecture.

I will poke through the source code and see if I can find anything.
Comment 5 Havoc Pennington 2003-05-30 15:02:37 UTC
xprops.c:size_hints_from_results() looks like it might come out
badly. Adding some debug printf in there might help.
Comment 6 Rob Adams 2003-05-30 15:40:33 UTC
In a lot of places we cast an array of longs to an array of chars
before passing it to XChangeProperty (and presumably do the reverse
when we receive a PropertyNotify).  To me that seems horribly broken,
endian-wise.  If different clients are running on different
architectures this seems like it would cause very bad things to
happen. Is there some standard byte-order we should be using here?  Or
is there some black magic happening here that I don't know about?
Comment 7 Havoc Pennington 2003-05-30 16:07:28 UTC
The X server knows the endianness of the client, and swaps bytes on
the server side if required.

There's some horrible confusion in Xlib where it sometimes expects 
"long" for something that ends up as a CARD32 on the server side. 
I can never remember the details of that though.
Comment 8 Jens Bech Madsen 2003-05-30 17:11:54 UTC
Adding lines like this:

  printf("JBM: min_width -> raw: %d, conv: %d\n", raw->minWidth,
hints->min_width);

to size_hints_from_results() gives this sort of output:

JBM: min_width -> raw: 1, conv: 1
JBM: min_height -> raw: 3, conv: 3
JBM: max_width -> raw: 0, conv: 0
JBM: max_height -> raw: 160, conv: 160
JBM: width_inc -> raw: 1953654016, conv: 1953654016
JBM: height_inc -> raw: 1701407856, conv: 1953654016
JBM: min_width -> raw: 1, conv: 1
JBM: min_height -> raw: 512, conv: 512
JBM: max_width -> raw: 1, conv: 1
JBM: max_height -> raw: 512, conv: 512
JBM: width_inc -> raw: 12244224, conv: 12244224
JBM: height_inc -> raw: 96, conv: 12244224
JBM: min_width -> raw: 13, conv: 13
JBM: min_height -> raw: 0, conv: 0
JBM: max_width -> raw: 0, conv: 0
JBM: max_height -> raw: 4, conv: 4
JBM: width_inc -> raw: 0, conv: 0
JBM: height_inc -> raw: 12244344, conv: 0


This is from starting Gnome, starting an xterm, exiting xterm and
killing X.

Not sure if the modifiers are correct though.
Comment 9 Havoc Pennington 2003-05-30 19:02:14 UTC
I think raw should use "%ld" rather than "%d" (the compiler should
print warnings if this is wrong)
Comment 10 Jens Bech Madsen 2003-05-30 19:29:15 UTC
Results from using %ld for raw. 


JBM: min_width -> raw: -4611686018427387903, conv: 1
JBM: min_height -> raw: 3, conv: 3
JBM: max_width -> raw: 0, conv: 0
JBM: max_height -> raw: 160, conv: 160
JBM: width_inc -> raw: 7309940851192521984, conv: 1953654016
JBM: height_inc -> raw: 7955925896721427568, conv: 1953654016
JBM: min_width -> raw: 45675293565779969, conv: 1
JBM: min_height -> raw: 2314183217227235840, conv: 512
JBM: max_width -> raw: 72709329555292161, conv: 1
JBM: max_height -> raw: 2314183217227235840, conv: 512
JBM: width_inc -> raw: 2199035499776, conv: 12244224
JBM: height_inc -> raw: 96, conv: 12244224
JBM: min_width -> raw: 13, conv: 13
JBM: min_height -> raw: 0, conv: 0
JBM: max_width -> raw: 17179869184, conv: 0
JBM: max_height -> raw: 4, conv: 4
JBM: width_inc -> raw: 0, conv: 0
JBM: height_inc -> raw: 2199035499896, conv: 0
Comment 11 Havoc Pennington 2003-05-30 19:36:31 UTC
Oh, this may be really dumb - see the line:
#if defined(WORD64) && defined(UNSIGNEDBITFIELDS)

Try changing that line to "#if 1" and see what happens.
Comment 12 Jens Bech Madsen 2003-05-30 20:05:53 UTC
It gives the same numbers, funnily enough I get the same if I change
it to #if 0 as well.
Comment 13 Jens Bech Madsen 2003-07-15 10:21:15 UTC
Just built garnome 0.25.1 (2.5.2) and it exhibits the same problem.
Going back to 2.4.55 makes it work correctly.
Comment 14 Havoc Pennington 2003-09-25 04:06:29 UTC
Still seeing this in 2.6.1?
Comment 15 Jens Bech Madsen 2003-09-25 09:01:39 UTC
yes, no change. Built with garnome 0.27.1.
Comment 16 Havoc Pennington 2003-09-29 18:16:22 UTC
I think I see the problem. compare
async-props.c:async_get_property_handler() to
lib/X11/GetProp.c:XGetWindowProperty() in Xlib.

Xlib does the bizarre thing where XGetWindowProperty returns an array
of long if you ask for format 32. So format 32 may return an array of
64-bit values.

the metacity async property stuff always returns an array of 32-bit
values. But metacity-Xatomtype.h defines all the structs as blocks of
long, not as blocks of 32-bit integers.

Should make async_get_property_handler match the XGetWindowProperty
semantics (they're broken, but we use XGetWindowProperty elsewhere and
it will be too confusing to have two different ways to do it).
Comment 17 Havoc Pennington 2003-09-29 18:20:49 UTC
Bug #108926 has a patch for this, which I haven't reviewed yet.
Comment 18 Havoc Pennington 2003-09-29 22:17:41 UTC
I committed a slightly different patch to cvs (with a hack to avoid
the extra malloc/copy when possible). But should fix - please test and
advise.
Comment 19 Frederic Crozat 2003-09-30 07:51:36 UTC
Changing summary..

Gwenole, could you test havoc patch (from CVS) on AMD64 system ?
Comment 20 Rob Adams 2003-10-12 16:38:54 UTC
closing bug since we have no reason to believe that this is still a
problem.
Comment 21 Jens Bech Madsen 2003-10-26 15:59:34 UTC
Yes, it works correctly now on Alpha. Thanks a lot, now I can run the
development version again.