3dxsrv crash (segfault)

Questions and answers about 3Dconnexion devices on UNIX and Linux.

Moderator: Moderators

Post Reply
nuclear
Posts: 15
Joined: Sat Jun 16, 2007 6:24 am
Location: Greece
Contact:

3dxsrv crash (segfault)

Post by nuclear »

Hello, and I'm running Debian GNU/Linux (kernel 2.6.16.9) and I have trouble making the driver work.

Initially I had the problem that I saw other people post in here, with the utmp "user not found" messages. I used the workaround that someone posted in this forum (a small C snipped that adds a utmp entry the way 3dxsrv expects it) and got it to "start" (leds lit up and everything). But every time after a few seconds the driver segfaults.

Running it with -debug, produces the following output:

Code: Select all

# /etc/3DxWare/daemon/3dxsrv -d usb -debug
[2007-06-16 16:51:18] 3dxsrv.c,647: displayname = :0.0
[2007-06-16 16:51:18] auth.c :: authGetUser(), FOUND: user = nuclear, id = :0, line = :0, pid =     4922, host = , type = 7
[2007-06-16 16:51:18] 
[2007-06-16 16:51:18] auth.c :: authGetUser(), FOUND: user home = "/home/nuclear"
[2007-06-16 16:51:18] 3dxsrv.c :: startupCommandLine(), authGetUser(), user=nuclear
[2007-06-16 16:51:18] UdDev: Opening USB device on USB port /proc/bus/usb/003/002
[2007-06-16 16:51:18] UdDev: SpaceNavigator opened
[2007-06-16 16:51:18] UdDev: Opening SpaceNavigator device on USB port /proc/bus/usb/003/002
[2007-06-16 16:51:18] snav_usb.c :: UdDevRezero(): Rezeroing the device
[2007-06-16 16:51:18] 3dxsrv.c :: startupCommandLine(), XOpenDisplay called with display name=:0.0, display = 8099cd0
[2007-06-16 16:51:18] 3dxsrv.c :: startupCommandLine(), SUCCESS!

3DxWareUNIX = V1.2.7
Device      = SpaceNavigator
Firmware    = V3.18
[2007-06-16 16:51:18] Home directory: /home/nuclear
Segmentation fault
P.S. I'm thinking of writing my own free software driver for this thing (unless you have plans on releasing yours, which would be great!). Is there any documentation you can provide on how to interface with the space navigator?
UtaSH
Moderator
Moderator
Posts: 3754
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

core file ?

Post by UtaSH »

Hi nuclear,

officially we only support Red Hat EL and SuSE. But the problem with "failed to get user" seems to appear on other Linux distris as well. Let's see if we can get more information from your case ...

Does the driver create a core file when it crashes?

Uta Ludwig
3Dconnexion

PS: concerning the SpaceNavigator's interface - see here.
nuclear
Posts: 15
Joined: Sat Jun 16, 2007 6:24 am
Location: Greece
Contact:

Post by nuclear »

Hello, sorry I didn't provide more helpful information on my first post but I was rather busy at the time.

No there are no core files, but I used gdb to get a backtrace, which produces this:

Code: Select all

#0  0x0805a0fa in uiAllocFonts ()
#1  0x0805ad09 in UdUiInit ()
#2  0x0804c655 in main ()
Initially I had lesstif installed providing libXm, and just in case I also tried installing OpenMotif, but the result is the same.
nuclear
Posts: 15
Joined: Sat Jun 16, 2007 6:24 am
Location: Greece
Contact:

Post by nuclear »

Also I did an ltrace and the last things it does are:
A shitload of XrmGetResource(), which all return 0.
Then:

Code: Select all

XLoadQueryFont(0x809cbe8, 0x80785ac, 0xbfda3298, 0x8096008, 0x8096008) = 0
XmFontListCreate(0, 0x807847b, 0xbfda3298, 0x8096008, 0x8096008) = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
Is there no way to avoid running the GUI and just use the driver that feeds X events? I don't really need the GUI.
UtaSH
Moderator
Moderator
Posts: 3754
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH »

So, your problem is not the "user not found" issue.
It seems that on your machine there is a problem with the fonts. We will check the code if we can find the cause, but this issue has a low priority due to the fact that you are working with an unsupported Linux distribution.

We will post here if we have news (or more questions).

Uta Ludwig
3Dconnexion
nuclear
Posts: 15
Joined: Sat Jun 16, 2007 6:24 am
Location: Greece
Contact:

Post by nuclear »

Just to clarify, my problem is *not only* the "user not found" issue :)

I mean, I do have that problem, but as I mentioned before, I used a code snippet posted by someone in this forum to add a user to utmp the way 3dxsrv expects it. Which is of course a big fat hack :)

Only then can I continue further and I get the segfault.

Idially, you shouldn't have to use that utmp mechanism to detect users. And also you should seperate the driver itself from the configuration GUI so that various font/motif/whatever problems should not impact on the usability of the device.

Anyhow, as I mentioned on my original post, I'm writing a free software replacement driver (daemon). Thanks to a proof-of-concept hack by "Simon Budig" I understood how to interface with the device (pretty simple indeed).

I'm now working on the X server integration to make it work identically to your daemon, so that it can serve as a drop-in replacement for those who have issues (like me) with it, or would prefer to use something more hackable i.e. free software (like me :). I will post whenever it's done and working properly.
kidb
Posts: 14
Joined: Fri Jun 08, 2007 10:53 am

Post by kidb »

The spacenavigator can be configured in the xorg.conf, without the 3dxware stuff.

Code: Select all

Section "ServerLayout"
        ...
        InputDevice    "SpaceNav[0]"
        ...
EndSection

Section "InputDevice"
        Identifier  "SpaceNav[0]"
        Driver      "evdev"
        Option      "Name"   "3Dconnexion SpaceNavigator"
        Option      "Mode"   "relative"
        Option      "XRelativeAxisMap"  "0"
        Option      "YRelativeAxisMap"  "1"
        Option      "ZRelativeAxisMap"  "2"
        Option      "RXRelativeAxisMap" "3"
        Option      "RYRelativeAxisMap" "4"
        Option      "RZRelativeAxisMap" "5"
        Option      "ZRelativeAxisButtons" "off"
EndSection
Source: https://projects.blender.org/tracker/in ... 9&atid=127

P.S.: This patch is not the official 6ndof implementation for blender. The developers work, with 3dconnexion support, for a different solution.
Last edited by kidb on Wed Jun 20, 2007 7:57 am, edited 2 times in total.
UtaSH
Moderator
Moderator
Posts: 3754
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH »

The spacenavigator can be configured in the xorg.conf, without the 3dxware stuff.
Yes, if you want to use it with Blender (or another 3D application that supports input devices via this possibility) this would work.

But if you want to use our device wit ProE Wildfire, Unigraphics NX, or Maya or ... then you need to provide the data of the device via XClientMessages.

Uta Ludwig
3Dconnexion
nuclear
Posts: 15
Joined: Sat Jun 16, 2007 6:24 am
Location: Greece
Contact:

Post by nuclear »

kidb: Thanks very much for the info. Although I'm hardly familiar with the XInput extension and how you use it in a client program, it this seems like the preferable way to interface with the device under X11.

However the XClientMessageEvent mechanism seems rather simple and since the "standard" SDK uses it, all other programs use that as well.

In any case, my 3dxsrv replacement seems to work now. It will need more testing and tuning, but I can rotate the cube from the SDK examples.
I will install maya 8 later on and see if it works properly there too.

Somehow it feels a bit awkward, like some axes are not right. So anyone who has used the original 3dxsrv and wants to test it, mail me at nuclear@siggraph.org and I'll send you a test version.

What I'm doing, is getting the 6 axis values from the linux event interface, and pass them to xevent.xclient.data.s[2] to s[7]. The SDK code seems to expect the values there. Then I'm passing the time interval from the previous motion event to s[8] (in milliseconds).

The order of the axis values is (consider a coordinate system with Z going up from the desk where the device is sitting and X/Y being the desk plane):

Code: Select all

xevent.xclient.data.s[2]: move along X axis
xevent.xclient.data.s[3]: move along Y axis
xevent.xclient.data.s[4]: move along Z axis
xevent.xclient.data.s[5]: rotate around X axis
xevent.xclient.data.s[6]: rotate around Y axis
xevent.xclient.data.s[7]: rotate around Z axis
Is that right? It seems the SDK expects it that way.
UtaSH
Moderator
Moderator
Posts: 3754
Joined: Mon Nov 27, 2006 10:34 am
Location: Munich, Germany
Contact:

Post by UtaSH »

What I'm doing, is getting the 6 axis values from the linux event interface, and pass them to xevent.xclient.data.s[2] to s[7]. The SDK code seems to expect the values there. Then I'm passing the time interval from the previous motion event to s[8] (in milliseconds).

The order of the axis values is (consider a coordinate system with Z going up from the desk where the device is sitting and X/Y being the desk plane):

Code: Select all

xevent.xclient.data.s[2]: move along X axis
xevent.xclient.data.s[3]: move along Y axis
xevent.xclient.data.s[4]: move along Z axis
xevent.xclient.data.s[5]: rotate around X axis
xevent.xclient.data.s[6]: rotate around Y axis
xevent.xclient.data.s[7]: rotate around Z axis
Is that right? It seems the SDK expects it that way.

Looks good :)
Post Reply