Hi Jean-Francois, On Do 01 Okt 2015 22:10:04 CEST, Mike Gabriel wrote:
Program received signal SIGSEGV, Segmentation fault. _XData32 (dpy=dpy@entry=0x2b319b0, data=<optimized out>, data@entry=0x34580d4, len=14588, len@entry=18652) at XlibInt.c:3792 3792 *buf++ = *data++; (gdb) l 3787 i = len; 3788 dpy->bufptr = (char *)buf + i; 3789 len -= i; 3790 i >>= 2; 3791 while (--i >= 0) 3792 *buf++ = *data++; 3793 } 3794 return 0; 3795 } 3796 #endif /* LONG64 */
Then I did several tests. To get better debug resolution, I compiled the lib again, but with '-Og' (or -O0, I tried both). Oddly, the problem goes away! I think there's some alignment problems here: See also: https://www.mail-archive.com/misc@openbsd.org/msg129941.html
Ok... Have you checked upstram X.Org already? Checked what they have at that place in the code? They probably have already fixed it.
See the xorg/libx11 Git repo on git.freedesktop.org. I normally compare the nxagent code with latest X.Org and then many issues dissolve when apply their changes.
I'm really confused, If i change the "data" member to an int (32bits) then it doesn't work. I get no errors, my x11 clients just don't show up (I use xterm as a test client app). I did manage to fix it by doing: diff --git a/nx-X11/lib/X11/XlibInt.c b/nx-X11/lib/X11/XlibInt.c index 47e2ea1..bfcab8d 100644 --- a/nx-X11/lib/X11/XlibInt.c +++ b/nx-X11/lib/X11/XlibInt.c @@ -3770,11 +3770,11 @@ void Data( int _XData32( Display *dpy, - register long *data, + volatile long *data, unsigned len) { - register int *buf; - register long i; + volatile int *buf; + volatile long i; while (len) { buf = (int *)dpy->bufptr; @@ -3785,6 +3785,7 @@ _XData32( } if (len < i) i = len; + i &= ~0x3; dpy->bufptr = (char *)buf + i; len -= i; i >>= 2;
Ok...
attached is the only change that has happened since 2006 or so around the code block you reference. @@ -1739,7 +1739,7 @@ void Data( int _XData32( Display *dpy, - register long *data, + register _Xconst long *data, unsigned len) { register int *buf; Mike -- DAS-NETZWERKTEAM mike gabriel, herweg 7, 24357 fleckeby fon: +49 (1520) 1976 148 GnuPG Key ID 0x25771B31 mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xf...