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 144302 - (PATCH)GTK+-2.4.1 not 64-bit clean
(PATCH)GTK+-2.4.1 not 64-bit clean
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
2.4.x
Other Solaris
: Urgent critical
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2004-06-14 05:08 UTC by devsk
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.5/2.6


Attachments
Workaround the &(guint32) to (guchar *) conversion leading to invalid address alignment on 64-bit (499 bytes, patch)
2004-06-14 05:10 UTC, devsk
none Details | Review

Description devsk 2004-06-14 05:08:20 UTC
Compile with Forte 7 on solaris 9 64-bit. testcombo fails with:

(dbx) where
  [1] _XData32(0x100037820, 0xffffffff7fffdc34, 0x4, 0xffffffff7f00ec68, 0x2,
0xffffffff7fffdbac), at 0xffffffff7d55b504
  [2] XChangeProperty(0x1, 0x1, 0x102, 0x6, 0x20, 0x0), at 0xffffffff7d52bf04
=>[3] _gdk_x11_window_set_user_time(window = 0x10011d2e0, timestamp =
27574954U), line 3351 in "gdkwindow-x11.c"
  [4] set_user_time(window = 0x10011d2e0, event = 0x100125210), line 819 in
"gdkevents-x11.c"
  [5] gdk_event_translate(display = 0x100042980, event = 0x100125210, xevent =
0xffffffff7fffe0a8, return_exposes = 0), line 1114 in "gdkevents-x11.c"
  [6] _gdk_events_queue(display = 0x100042980), line 2086 in "gdkevents-x11.c"
  [7] gdk_event_dispatch(source = 0x100048690, callback = (nil), user_data =
(nil)), line 2146 in "gdkevents-x11.c"
  [8] g_main_dispatch(0x100048710, 0x15ba80, 0xffffffff7f09abb0, 0x0, 0x0, 0x0),
at 0xffffffff7c028924
  [9] g_main_context_dispatch(0x100048710, 0x0, 0xffffffff7c1897a4,
0xffffffff7c029ed0, 0xffffffff7c184208, 0xffffffff7c1897a8), at 0xffffffff7c02a0cc
  [10] g_main_context_iterate(0x100048710, 0x1, 0x1, 0x1000c4620, 0x1,
0xffffffff7c1897a8), at 0xffffffff7c02a618
  [11] g_main_loop_run(0x1001204e0, 0x1, 0x100048710, 0x0, 0xffffffff7c184208,
0x1000c4620), at 0xffffffff7c02ad34
  [12] gtk_main(), line 1172 in "gtkmain.c"
  [13] main(argc = 1, argv = 0xffffffff7fffe848), line 301 in "testcombo.c"
(dbx)

the reason is that in file gdkwindow-x11.c guint32 is being cast into a pointer
(guchar *) and we get an invalid address alignment. The patch attached fixes this.
Comment 1 devsk 2004-06-14 05:10:33 UTC
Created attachment 28676 [details] [review]
Workaround the &(guint32) to (guchar *) conversion leading to invalid address alignment on 64-bit
Comment 2 devsk 2004-06-14 05:11:11 UTC
Workaround the &(guint32) to (guchar *) conversion leading to invalid address
alignment on 64-bit
Comment 3 Owen Taylor 2004-06-14 15:35:28 UTC
Correct fix is something like

 long timestamp_long = timestamp;

Cast isn't necessary, and this quantity needs to be a long whatever
width longs are on the platform.
Comment 4 devsk 2004-06-14 16:24:01 UTC
Comment on attachment 28676 [details] [review]
Workaround the &(guint32) to (guchar *) conversion leading to invalid address alignment on 64-bit

>--- gdkwindow-x11.c.ORG 2004-06-13 21:59:53.709990000 -0700
>+++ gdkwindow-x11.c     2004-06-13 20:55:44.680764000 -0700
>@@ -3331,10 +3331,11 @@
>  **/
> void
> _gdk_x11_window_set_user_time (GdkWindow *window,
>-                              guint32    timestamp)
>+                              guint32    timestamp2)
> {
>   GdkDisplay *display;
>   GdkDisplayX11 *display_x11;
>+  long timestamp=(long)timestamp2;
>
>   g_return_if_fail (window != NULL);
>   g_return_if_fail (GDK_IS_WINDOW (window));
Comment 5 Owen Taylor 2004-06-14 23:28:45 UTC
The name of the parameter shouldn't be changed - it needs to match
the doc comment and header file. And there should be no cast.

But there is no real need to provide a new version of the patch.
Comment 6 devsk 2004-06-15 00:17:01 UTC
cool...