Bug 61220 (suse46220)

Summary: Update NX to release 3.2
Product: [openSUSE] openSUSE 11.0 Reporter: Stefan Dirsch <sndirsch>
Component: X11 ApplicationsAssignee: Stefan Dirsch <sndirsch>
Status: RESOLVED FIXED QA Contact: Stefan Dirsch <sndirsch>
Severity: Enhancement    
Priority: P2 - High CC: benjamin.j.mccann, eich, jens-novell, max-novell, schmidt, sgt-d, steiner-reg, suse-beta, tom.horsley, tschaefer
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: Linux   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Patch that improves the situation somehow

Description Stefan Dirsch 2004-09-27 20:20:56 UTC
--> nx-X11/programs/Xserver/hw/nxagent/GC.c 
 
Program received signal SIGSEGV, Segmentation fault. 
0x0000000000478204 in nxagentCreateGC (pGC=0x760130) at GC.c:130 
130       nxagentGCPriv(pGC)->gc = XCreateGC(nxagentDisplay, 
 
I've tried 1.4.0 snapshot 6, but IIRC it happened also before.  
Sources were: 
  
nx-X11-1.4.0-4.tar.gz 
nxagent-1.4.0-54.tar.gz 
nxcomp-1.4.0-25.tar.gz 
nxcompext-1.4.0-3.tar.gz 
 
Downgrading to stable sources 
 
nx-X11-1.3.2-9.tar.gz 
nxagent-1.3.2-23.tar.gz 
nxcomp-1.3.2-4.tar.gz 
nxcompext-1.3.2-6.tar.gz 
  
doesn't help. Now nxagent crashes in fbCreatePixmap 
 
Program received signal SIGSEGV, Segmentation fault. 
0x000000000046b8b7 in fbCreatePixmap () 
(gdb) bt 
#0  0x000000000046b8b7 in fbCreatePixmap () 
#1  0x0000000000454d56 in nxagentCreatePixmap () 
#2  0x00000000004afaae in miCreateScreenResources () 
#3  0x00000000004363ac in main ()
Comment 1 Stefan Dirsch 2004-09-27 20:21:41 UTC
Workaround for now is to use the 32bit RPM also for AMD64. 
Comment 2 Stefan Dirsch 2004-09-28 02:08:55 UTC
From: Gian Filippo Pinzari <pinzari@nomachine.com> 
Date: Mon, 27 Sep 2004 15:00:37 +0200 
 
It has been reported that libraries should be compiled with 
-fPIC to run on 64 bits. We look forward at doing this by default 
in future. There is no time to change the build procedure for the 
1.4.0 but the patches should be somehow trivial. 
 
The crash with nxagent has been reported by some Debian porters 
and recently pointed out by Fabian Franz. We didn't investigate 
it yet. It's unclear if the crash also occurs when running the 
executable included in the NoMachine packages or it only affects 
nxagent when compiling on AMD64. 
 
/Gian Filippo. 
 
Comment 3 Stefan Dirsch 2004-09-28 02:17:10 UTC
AFAIK it's only required to use -fPIC for shared libs or for static 
libs which are linked into shared libs. I didn't find any files, which 
are used in shared libs or static libs (which are later linked into 
static libs) and are not compiled with -fPIC. So it looks like this is 
not the problem. 
 
Comment 4 Stefan Dirsch 2004-10-04 18:24:47 UTC
Same problem on s390x, whereas it works on s390. So it really looks like a 
64bit problem in general. 
Comment 5 Stefan Dirsch 2004-10-05 17:22:17 UTC
How to debug this:  
 
- login to x86_64 machine (e.g. ssh -X magellan) 
- build NX: 
  sux 
  . /work/src/bin/.profile 
  cd /work/SRC/all/NX 
  build 
- build nxagent with debug information 
  chroot /abuild/buildsystem.magellan.<username> 
  cd usr/src/packages/BUILD/nx-X11/programs/Xserver/hw/nxagent 
  make clean 
  make depend 
  make CDEBUGFLAGS=-g 
- leave chroot environment 
- start nxagent: 
  cd /abuild/buildsystem.magellan.<username> 
  cd usr/src/packages/BUILD/nx-X11/programs/Xserver/hw/nxagent 
  export LD_LIBRARY_PATH=../../../../exports/lib/:\ 
   ../../../../../nxcomp:\ 
   ../.././../../../nxcompext/ 
  gdb ../../nxagent 
  [...] 
  set args :1 
  ... and so on ... 
 
Matthias, interested? 
Comment 6 Matthias Hopf 2004-10-05 22:12:27 UTC
Looks like a really bad stray pointer, though I'm not exactly sure right now.

The backtrace above tries to access a private GC with index 317(!), which is not 
initialized. Do to the high number I checked where nxagentGCPrivateIndex is 
changed during runtime (should only be in Init.c:222, it is not accessed r/w 
elsewhere), but I get that it is changed to -27(!) in:

#0  0x0000002a957ac1a5 in XInternAtoms ()
   from ../../../../exports/lib/libX11.so.6
#1  0x000000000045edcc in nxagentQueryAtoms (pScreen=0x726d30) at Atoms.c:172

The arguments of #1 look fine, so I'll have to dig into libX11.

Stay tuned.
Comment 7 Stefan Dirsch 2004-10-05 22:17:23 UTC
Oops. Maybe it's related to the special libX11 of NX. Does it work, when the 
special X11 libs are not used? Adjust LD_LIBRARY_PATH for this. 
Comment 8 Matthias Hopf 2004-10-05 22:20:22 UTC
Don't know exactly what's going on, but appearantly gdb's watchpoints are not 
reliable. Grrrr.
Stay tuned.

Stefan: will try.
Comment 9 Matthias Hopf 2004-10-05 22:45:35 UTC
Found the reason...

sizeof(Atom)=8 in stack frame 0 != sizeof(Atom)=4 in stack frame 1...

Now I have to look where this no-brainer was defined...

Correct me if I'm wrong, but Atoms should always be 32bit values?
Comment 10 Matthias Hopf 2004-10-05 23:11:13 UTC
Ok, a litte bit more information:

xfree86/hw/nxagent/Atoms.c:51 defines a Atom array nxagentAtoms[]
which is filled in
xfree86/hw/nxagent/Atoms.c:172 using lib/X11/IntAtom.c:62

The later is from libX11, which uses a different type setting, thus overwrites 
the nxagentAtom[] array and a fair amount of additional variables that happen to 
ly immedeately after the array. This finally leads to the error described.
Comment 11 Matthias Hopf 2004-10-06 20:10:14 UTC
Created attachment 24668 [details]
Patch that improves the situation somehow

This patch fixes several 32bit vs. 64bit type problems. I'm sure that I haven't
found all of them (currently the nxagent window remains black, but it doesn't
crash any more).
Clearly this server has *major* 64bit problems, so this should be discussed
with the author.
Comment 12 Stefan Dirsch 2004-10-06 20:41:08 UTC
Thanks. Needs to be discussed on nxdeveloppers or Gian Filippo Pinzarri, the 
main author of NX. 
 
  http://www.nomachine.com/mailinglists.php 
 
For now we use the 32bit RPM on AMD64.  
 
Looks like the commercial NX Server RPMs, which contain nxagent are only 
available for Linux (IA32) and Solaris (Sparc(32?)). So indeed the NX sources 
might not be 64 bit clean at all. 
 
  http://www.nomachine.com/download.php 
 
Gian told me on nxusers also, that currently no Linux AMD64 Server version is 
planned. 
 
Comment 13 Matthias Hopf 2004-10-12 17:43:23 UTC
I set this to LATER as we cannot fix this without any patches from upstream.
Comment 14 Stefan Dirsch 2004-10-12 17:46:14 UTC
See my comment #12. 
Comment 15 Stefan Dirsch 2004-10-14 16:45:01 UTC
<!-- SBZ_reopen -->Reopened by sndirsch@suse.de at Thu Oct 14 10:45:01 2004
Comment 16 Stefan Dirsch 2004-10-14 16:45:01 UTC
We should keep this as enhancement. Otherwise it will get lost. 
Comment 17 Stefan Dirsch 2005-04-04 21:37:15 UTC
Some news from Gian Filippo 
 
>So you have any news about this? The 32bit RPM built for x86 can be 
>used on x86_64. So it's no showstopper for us. 
 
As I mentioned in previous messages, we have a massive amount of 
things to do for the next releases and don't have presently a 
commitment to supporting a native AMD64 port. We have not planned 
creating and supporting native nxserver/nxnode/nxmanager/nxclient 
executables for such a platform, so, from a business perspective, 
at least at the moment, any time allocated for such activities 
wouldn't make any sense. 
 
That said, I'm happy to hear that this doesn't constitute a show- 
stopper. I assume that most of the changes are trivial (like adding 
a few flags when compiling and changing a few lines of code), but 
still this would require time and resources to extensively test 
the produced builds, time that that we would prefer to put on dif- 
ferent tasks. 
 
Thanks for notifying us about this issue. 
 
Comment 18 Stefan Dirsch 2006-07-28 10:06:10 UTC
*** Bug 195319 has been marked as a duplicate of this bug. ***
Comment 19 Stefan Dirsch 2006-09-01 16:42:57 UTC
Maybe this was fixed by accident with NX 2.0? Well, I doubt ...
Comment 20 Stefan Dirsch 2006-12-21 03:46:28 UTC
*** Bug 230147 has been marked as a duplicate of this bug. ***
Comment 21 Stefan Dirsch 2007-03-26 14:44:13 UTC
*** Bug 257334 has been marked as a duplicate of this bug. ***
Comment 22 Stefan Dirsch 2007-06-21 11:07:13 UTC
Date: Thu, 21 Jun 2007 05:49:39 +0200
From: Fabian Franz <FabianFranz@gmx.de>
To: freenx-knx@kde.org
Subject: [FreeNX-kNX] NX 3.0 is out

Hi all,

NX 3.0 was released by our friends at NoMachine today, sporting all the features you asked for here and at NoMachine for years:

[...]
- Full support for the x86_64 architecture
[...]
Comment 23 Stefan Dirsch 2007-07-10 07:54:00 UTC
The update to NX 3.0 can't happen "tomorrow" due to FreeNX dependancies. See

  http://mail.kde.org/pipermail/freenx-knx/2007-July/005473.html

for more details.
Comment 24 Stefan Dirsch 2007-07-18 02:51:09 UTC
Since there is some hope now, raising the priority.
Comment 25 Stefan Dirsch 2007-09-16 19:17:37 UTC
*** Bug 310741 has been marked as a duplicate of this bug. ***
Comment 26 darren winter 2007-09-27 19:38:12 UTC
curious, will this be fixed in 10.3 final?

or can i upgrade it from a repo or something?
Comment 27 Stefan Dirsch 2007-09-27 19:45:48 UTC
The 64bit version won't be fixed for 10.3 final. Hopefully this time only the i386 version will be on the media, so nobody will stumble across this problem.
There is no NX 3.0 repo in buildservice yet.
Comment 28 Stefan Dirsch 2007-11-13 04:54:54 UTC
Unfortunately NX 3.0 is still not usable on x86_64. 

# nxagent 

NXAGENT - Version 3.0.0

Copyright (C) 2001, 2007 NoMachine.
See http://www.nomachine.com/ for more information.

Info: Agent running with pid '14233'.
Session: Starting session at 'Tue Nov 13 05:50:44 2007'.
nxagentCheckForPixmapFormatsCompatibility: WARNING! Failed to match internal pixmap format depth [8] bpp [8] pad [32].
nxagentCheckForPixmapFormatsCompatibility: WARNING! Failed to match internal pixmap format depth [15] bpp [16] pad [32].
Info: Using alpha channel in render extension.
Info: Not using local device configuration changes.
No core keyboard
Error: Aborting session with 'Failed to initialize core devices'.
Session: Aborting session at 'Tue Nov 13 05:50:45 2007'.
Session: Session aborted at 'Tue Nov 13 05:50:45 2007'.

This is again a 64bit issue. 32bit nxagent work fine.

# nxagent

NXAGENT - Version 3.0.0

Copyright (C) 2001, 2007 NoMachine.
See http://www.nomachine.com/ for more information.

Info: Agent running with pid '14259'.
Session: Starting session at 'Tue Nov 13 05:53:07 2007'.
Info: Using alpha channel in render extension.
Info: Not using local device configuration changes.
error opening security policy file /usr/lib/xserver/SecurityPolicy
expected keysym, got XF86KbdLightOnOff: line 71 of pc
expected keysym, got XF86KbdBrightnessDown: line 72 of pc
expected keysym, got XF86KbdBrightnessUp: line 73 of pc
Session: Session started at 'Tue Nov 13 05:53:18 2007'.

[nxagent window opens]

FreeFontPath: FPE "/usr/share/fonts/misc/" refcount is 2, should be 1; fixing.
Comment 29 Stefan Dirsch 2007-12-14 17:22:40 UTC
The nxagent binary available from !M doesn't suffer from this problem.

NXAGENT - Version 3.1.0

Copyright (C) 2001, 2007 NoMachine.
See http://www.nomachine.com/ for more information.

Info: Agent running with pid '20642'.
Session: Starting session at 'Fri Dec 14 18:22:08 2007'.
Info: Using alpha channel in render extension.
Info: Not using local device configuration changes.
error opening security policy file /usr/X11R6/lib/X11/xserver/SecurityPolicy
expected keysym, got XF86KbdLightOnOff: line 71 of pc
expected keysym, got XF86KbdBrightnessDown: line 72 of pc
expected keysym, got XF86KbdBrightnessUp: line 73 of pc
Session: Session started at 'Fri Dec 14 18:22:08 2007'.
Info: Screen [0] resized to geometry [1672x787].
Session: Terminating session at 'Fri Dec 14 18:22:10 2007'.
Session: Session terminated at 'Fri Dec 14 18:22:10 2007'.
FreeFontPath: FPE "/usr/share/fonts/misc/" refcount is 2, should be 1; fixing.
Comment 30 Stefan Dirsch 2007-12-15 04:50:52 UTC
Ok. Tried to build NX 3.1.0, but the sources are somewhat broken at the moment.

(nx-X11/lib/X11/XlibInt.c)
XlibInt.c: In function '_XReply':
XlibInt.c:2108: error: 'NX_FLUSH_SYNC' undeclared (first use in this function)
XlibInt.c:2108: error: (Each undeclared identifier is reported only once
XlibInt.c:2108: error: for each function it appears in.)
XlibInt.c:2108: error: too many arguments to function 'NXTransFlush'

(nx-X11/programs/Xserver/hw/nxagent/Screen.c)
Screen.c: In function 'nxagentShadowPoll':
Screen.c:2707: warning: implicit declaration of function 'REGION_NULL'
Screen.c:2707: error: 'pScreen' undeclared (first use in this function)
Screen.c:2707: error: (Each undeclared identifier is reported only once
Screen.c:2707: error: for each function it appears in.)
Screen.c:2812: warning: the address of 'box' will always evaluate as 'true'
Comment 31 Stefan Dirsch 2007-12-17 19:19:16 UTC
Date: Mon, 17 Dec 2007 19:37:49 +0100
From: Stefan Dirsch <sndirsch@suse.de>
To: User Support for FreeNX Server and kNX Client <freenx-knx@kde.org>
Subject: Re: [FreeNX-kNX] nxagent 3.1.0 build problems

On Mon, Dec 17, 2007 at 01:30:05PM -0200, Marcelo Boveto Shima wrote:
> I got NX 3.1.0 working for ubuntu.
> The links from nomachine were incorrect, there wasn't a link for
> nx-X11-3.1.0-1.
> Try to use nx-X11-3.1.0-1 instead of nx-X11-compat-3.1.0-1.

Thanks! This fixes the build for me as well. Still nxagent doesn't
work, whereas the binary one you can download does.

# nxagent  :1

NXAGENT - Version 3.1.0

Copyright (C) 2001, 2007 NoMachine.
See http://www.nomachine.com/ for more information.

Info: Agent running with pid '27416'.
Session: Starting session at 'Mon Dec 17 19:35:02 2007'.
nxagentCheckForPixmapFormatsCompatibility: WARNING! Failed to match internal pixmap format depth [8] bpp [8] pad
+[32].
nxagentCheckForPixmapFormatsCompatibility: WARNING! Failed to match internal pixmap format depth [15] bpp [16] pad
+[32].
Info: Using alpha channel in render extension.
Info: Not using local device configuration changes.
No core keyboard
Error: Aborting session with 'Failed to initialize core devices'.
Session: Aborting session at 'Mon Dec 17 19:35:02 2007'.
Session: Session aborted at 'Mon Dec 17 19:35:02 2007'.


# LD_LIBRARY_PATH=/usr/NX/lib/ /usr/NX/bin/nxagent :1

NXAGENT - Version 3.1.0

Copyright (C) 2001, 2007 NoMachine.
See http://www.nomachine.com/ for more information.

Info: Agent running with pid '27427'.
Session: Starting session at 'Mon Dec 17 19:36:35 2007'.
Info: Using alpha channel in render extension.
Info: Not using local device configuration changes.
error opening security policy file /usr/X11R6/lib/X11/xserver/SecurityPolicy
expected keysym, got XF86KbdLightOnOff: line 71 of pc
expected keysym, got XF86KbdBrightnessDown: line 72 of pc
expected keysym, got XF86KbdBrightnessUp: line 73 of pc
Session: Session started at 'Mon Dec 17 19:36:36 2007'.
Info: Screen [0] resized to geometry [1672x787].
Session: Terminating session at 'Mon Dec 17 19:36:38 2007'.
Session: Session terminated at 'Mon Dec 17 19:36:38 2007'.
FreeFontPath: FPE "/usr/share/fonts/misc/" refcount is 2, should be 1; fixing.

Best regards,
Stefan
Comment 32 Stefan Dirsch 2008-03-11 01:04:49 UTC
Still the same problema after updating to

- nxssh-3.1.0-2.tar.gz
- nxcomp-3.1.0-6.tar.gz
- nxagent-3.1.0-7.tar.gz
- nx-X11-3.1.0-4.tar.gz

in NX/NX3 (buildservice).
Comment 33 Frank Steiner 2008-05-15 21:33:52 UTC
Hi,
I don't have any problem with the 32bit NX/FreeNX RPMs on our x86_64 SLES10 acting as NX server, when connecting with a linux client.

But trying to connect from a 32bit Windows nx client (up to the latest 3.2 release), nxagent segfaults just as described in bug 257334, if I connect with "WAN" settings. 
With all other settings I can connect if I remove all ~/.nx/cache-unix-* and ~/.nx/C-* directories files from the users home whos login I use for nx before every connection try. If I forget to remove those files once, nxagent also crashed on this connection try.

So even with the 32bit RPMs there are some problems with nxagent when connecting from Windows :-( It doesn't matter what versions of NX and FreeNX I try, even with the latest builds from the repositories.

Comment 34 Stefan Dirsch 2008-07-05 04:57:05 UTC
*** Bug 406573 has been marked as a duplicate of this bug. ***
Comment 35 Stefan Dirsch 2008-07-19 20:00:13 UTC
Looks like the latest NX source packages fix the "No core keyboard" issue, so I'll try to switch to NX 3.x with x86_64 support for openSUSE 11.1.
Comment 36 Stefan Dirsch 2008-07-20 23:40:13 UTC
(In reply to comment #35 from Stefan Dirsch)
> Looks like the latest NX source packages fix the "No core keyboard" issue, so
> I'll try to switch to NX 3.x with x86_64 support for openSUSE 11.1.

done. :-) Finally ...

Frank Steiner, your issue is unrelated to this bugreport.