From cfb1990d4e845201182ef254da0ae9fe0536c616 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Sat, 21 Jun 2014 22:29:44 +0200 Subject: Add 057_nx-X11-bigendian-ppc64-no-session-window.patch. Fix failures in session windows coming up on Big Endian systems like PPC64. (Fixes: #516). --- ...11-bigendian-ppc64-no-session-window.full.patch | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 debian/patches/057_nx-X11-bigendian-ppc64-no-session-window.full.patch (limited to 'debian/patches/057_nx-X11-bigendian-ppc64-no-session-window.full.patch') diff --git a/debian/patches/057_nx-X11-bigendian-ppc64-no-session-window.full.patch b/debian/patches/057_nx-X11-bigendian-ppc64-no-session-window.full.patch new file mode 100644 index 000000000..eae46e10d --- /dev/null +++ b/debian/patches/057_nx-X11-bigendian-ppc64-no-session-window.full.patch @@ -0,0 +1,43 @@ +Description: No session window with on PPC64 builds +Author: Mihai Moldovan +Abstract: + An endiannes issue was setting incorrect event masks when creating X11 windows. + . + This time, a smaller integer has been casted to a bigger one and passed to some + function actually setting its value. + . + This meant, that garbage from stack was attached to the smaller integer value, + putting unknown memory into the lower bytes of the bigger integer. + . + Fix this by creating a big, initialized temporary variable, let the function do + its magic on that one and pass the value back to the smaller variable -- and + cross your fingers the smaller variable can hold it without overrunning. (The + last bit is a design issue we can't really fix and has been around even before + this patch.) + +--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c ++++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c +@@ -327,7 +327,10 @@ + + if (mask & CWEventMask) + { +- nxagentGetEventMask(pWin, (Mask*)&attributes.event_mask); ++ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ ++ Mask tmp_mask = attributes.event_mask; ++ nxagentGetEventMask(pWin, &tmp_mask); ++ attributes.event_mask = (int)tmp_mask; + } + #ifdef WARNING + else +@@ -2891,7 +2894,10 @@ + + if (mask & CWEventMask) + { +- nxagentGetEventMask(pWin, (Mask*)&attributes.event_mask); ++ /* Assume that the mask fits in int... broken on Big Endian 64bit systems. */ ++ Mask tmp_mask = attributes.event_mask; ++ nxagentGetEventMask(pWin, &tmp_mask); ++ attributes.event_mask = (int)tmp_mask; + } + #ifdef WARNING + else -- cgit v1.2.3