On Thu, Jul 29, 2010 at 02:50:23PM +0200, David Coppa wrote:
> Hi,
>
> This patch fixes a crash on sparc64 with xenocara/app/xclock.
>
> The pid variable that is passed to XChangeProperty() is not a long.
> The libX11 code deferences the variable as a long and on a 64-bit sparc
> this must be aligned on a 8-byte boundary.
> Because it is an int, it gets aligned on a 4-byte boundary, causing a
> bus error.
sure, ok.
The number of bugs this weird API has caused in infinite.
>
> Cheers,
> David
>
> Index: xclock.c
> ===================================================================
> RCS file: /cvs/xenocara/app/xclock/xclock.c,v
> retrieving revision 1.2
> diff -u -p -r1.2 xclock.c
> --- xclock.c 26 Sep 2009 14:35:39 -0000 1.2
> +++ xclock.c 29 Jul 2010 12:37:49 -0000
> @@ -215,7 +215,7 @@ main(int argc, char *argv[])
>
> #ifdef HAVE_GETPID
> {
> - pid_t pid = getpid();
> + unsigned long pid = (unsigned long) getpid();
> XChangeProperty(XtDisplay(toplevel), XtWindow(toplevel),
> XInternAtom(XtDisplay(toplevel), "_NET_WM_PID", False),
> XA_CARDINAL, 32, PropModeReplace,
>
--
Matthieu Herrb