logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Problems starting with speech module

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support
View previous topic :: View next topic  
Author Message
darwinscusp



Joined: 19 Jan 2005
Posts: 19

PostPosted: Wed Apr 06, 2005 2:49    Post subject: Problems starting with speech module Reply with quote

Hi,

I'm running nwn 1.65 on RedHat Enterprise Linux 4. I compiled NWNX2 successfully, and also managed to compile the speech plugin as well (though not easily, as my mysql libs and includes are not in a "standard" location. Odd since I compiled it from source Razz).

Anyway, each time I start nwn, it appears to come up ok at first, then crashes with a Segmentation Fault. Here's the exact message:

Code:
[darwinscusp@pooh nwn]$ sudo ./nwnstartup.sh

NWNX2lib: Init
NWNX2lib: org SetString() at 0x81e5210, new SetString() at 0x96334c
* Parsing configuration...
NWN Extender v2.5.3-rc1
(c) 2004 by the APS/NWNX Linux Conversion Group
Based on the Win32 version (c) 2003 by Ingmar Stieger (Papillon)
and Jeroen Broekhuizen
visit us at http://www.avlis.org

* Loading modules...
[Speech] SetDebugLevel(0) called.  Current value=0
SPEECH plugin Registerred.
[Database] SetDebugLevel(0) called.  Current value=0
ODBC plugin Registerred.
[MNX] SetDebugLevel(0) called.  Current value=0
MNX plugin Registerred.
[FUNCTIONS] SetDebugLevel(0) called.  Current value=0
FUNCTIONS plugin Registerred.
[HASHSET] SetDebugLevel(0) called.  Current value=0
HASHSET plugin Registerred.
* NWNX2 activated.
Neverwinter Nights Server
Build:8066
Copyright BioWare Corp 1998-2004

Server: Loading...
Server: Running...

Server: Loading module "OOTH - Code Base"...../nwnstartup.sh: line 21: 21798 Segmentation fault      ./nwserver -publicserver 1 -servername "World of Jade - Alpha" -playerpassword xxxxxx -dmpassword xxxxxx -oneparty 0 -pvp 2 -difficulty 3 -elc 1 -reloadwhenempty 0 -module "OOTH - Code Base" -maxclients 32 -servervault 1 -maxlevel 40 -gametype 0 -autosaveinterval 0 "$@"


I've checked the logs, and everything appears to operate fine, except for the little debug message about "seems to be hanging here" from the speech plugin, and the segmentation fault of course.

I just downloaded all the code from this site today, so I imagine it's the latest versions.

Any suggestions?
Back to top
View user's profile Send private message
darwinscusp



Joined: 19 Jan 2005
Posts: 19

PostPosted: Thu Apr 07, 2005 4:28    Post subject: Reply with quote

Ok, not to be a dweeb and follow up on my own question, but I've done some additional work and isolated the problem somewhat.

I completely deleted and reinstalled NWN, complete with all my haks, modules, etc. I then deleted all the nwnx stuff from my build tree, and unarchived and rebuilt all those components as well, verifying everything linked to mysql (and in the case of the speech plugin, that -lpcap was used).

I'm now able to start modules, and run with normal database interaction just fine. However, whenever I issue a command (like *talk*) or anything that the speech plugin would grab, the server Seg Faults, and crashes.

I did not compile nwnx with debug symbols, but can do so if that will help diagnose the speech plugin issue.

Thanks,

darwinscusp
Back to top
View user's profile Send private message
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Thu Apr 07, 2005 8:26    Post subject: Reply with quote

Have you done everything thats stated in the document (also in the OnLoad event)? And did you also imported the ERF of Lanthar? If you haven't this can cause undefined behaviour.
Back to top
View user's profile Send private message Visit poster's website
darwinscusp



Joined: 19 Jan 2005
Posts: 19

PostPosted: Thu Apr 07, 2005 14:34    Post subject: Reply with quote

I don't recall anything specific to the speech plugin that required modification of the onload event.

I'm using a module that I've previously developed on Windows. I'd already imported Lanthar's erf into this module, and it worked there fine.

The only difference in aps2.erf that I noticed, between the Windows and Linux versions, was the addition of the NWNX!INIT line in SQLInit() for the linux version. I'll reimport Lanthar's erf, as well as aps2.erf, recompile, and try again.

Thanks for the response JeroenB. I'll post my results.
Back to top
View user's profile Send private message
darwinscusp



Joined: 19 Jan 2005
Posts: 19

PostPosted: Fri Apr 08, 2005 1:06    Post subject: Reply with quote

Ok, I reinstalled the aps_include and aps_onload scripts from aps2.erf from the linux-version of nwnx2 (the most recent one). I then saved, exited, reopened, recompiled.

When I launched the server, everything appeared normal, and database interaction worked as I'd expect (I have a DB-based spawn system that worked fine).

However, again, whenever I issued *help* or any string the speech plugin might interact with, the server segfaults, and crashes.

I did an strace, to see exactly what's going on, but it's not particularly helpful:

Code:
.
.
.gettimeofday({1112914645, 726604}, NULL) = 0
gettimeofday({1112914645, 726646}, NULL) = 0
gettimeofday({1112914645, 726677}, NULL) = 0
gettimeofday({1112914645, 726720}, NULL) = 0
nanosleep({0, 10000000}, 0)             = ? ERESTART_RESTARTBLOCK (To be restart
ed)
+++ killed by SIGSEGV +++


Any suggestions?
Back to top
View user's profile Send private message
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Fri Apr 08, 2005 8:29    Post subject: Reply with quote

In the onload you must specifiy the name of the server, otherwise it doesn't know where to look (it early .. so I hope I don't talk nonsens here)..
Back to top
View user's profile Send private message Visit poster's website
darwinscusp



Joined: 19 Jan 2005
Posts: 19

PostPosted: Fri Apr 08, 2005 22:49    Post subject: Reply with quote

Ahhh, true enough. Since I reimported the lds module, I need to add those two lines back. I'll give that a try this evening.

Thanks for the response, and sorry I keep asking so many questions. I have all this working in VMware running in windows, but I'd really prefer to get away from windows completely if possible.


Thanks again.
Back to top
View user's profile Send private message
darwinscusp



Joined: 19 Jan 2005
Posts: 19

PostPosted: Sat Apr 09, 2005 0:42    Post subject: Reply with quote

Ok, I readded the code to set the module name, but I continue to get the segfault.

So far, I've completely reinstalled NWN from scratch, installed nwnx and the speech plugin, compiling and installing both. I've also reimported the aps2.erf and the Talus erf, adding code to the lds_mod_load (or whatever it's called), to include the two lines mentioned in the speech plugin documentation about the server name.

NWNX is still working like a champ, but the speech plugin is not getting along with something, causing a segfault each time it's invoked, and crashing the server.
Back to top
View user's profile Send private message
JeroenB



Joined: 31 Dec 2004
Posts: 228
Location: Netherlands

PostPosted: Sat Apr 09, 2005 8:03    Post subject: Reply with quote

I will have a look at my configuration of it soon.
Back to top
View user's profile Send private message Visit poster's website
darwinscusp



Joined: 19 Jan 2005
Posts: 19

PostPosted: Sat Apr 09, 2005 14:32    Post subject: Reply with quote

Thanks JeroenB.

One thing I've noticed, is my speech plugin seems to compile libpcap and libmysqlclient statically, rather than shared. At least that's my guess -- here's what makes me think so:

your nwnx_speech.so:
Code:
[darwinscusp@pooh speech]$ ls -l nwnx_speech.so
-rwxr-xr-x  1 darwinscusp darwinscusp 108899 Jan 13 09:58 nwnx_speech.so
[darwinscusp@pooh speech]$ ldd nwnx_speech.so
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7fcb000)
        libz.so.1 => /usr/lib/libz.so.1 (0xb7fbb000)
        libpcap.so.0 => not found
        libmysqlclient.so.12 => not found
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7ef0000)
        libm.so.6 => /lib/tls/libm.so.6 (0xb7ecd000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7ec5000)
        libc.so.6 => /lib/tls/libc.so.6 (0xb7d9b000)
        /lib/ld-linux.so.2 (0x00a83000)


my compiled nwnx_speech.so:
Code:
[darwinscusp@pooh nwn]$ ls -l nwnx_speech.so
-rwxr-xr-x  1 darwinscusp darwinscusp 1306495 Apr  6 20:55 nwnx_speech.so
[darwinscusp@pooh nwn]$ ldd nwnx_speech.so
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7eb6000)
        libz.so.1 => /usr/lib/libz.so.1 (0xb7ea6000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7ddb000)
        libm.so.6 => /lib/tls/libm.so.6 (0xb7db8000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7db0000)
        libc.so.6 => /lib/tls/libc.so.6 (0xb7c87000)
        /lib/ld-linux.so.2 (0x00a83000)


My version doesn't list libmysqlclient or libpcap, but the size is significantly larger. Incidentally, my nwnx.so doesn't list libmysqlclient either, but functions properly, so the library must've been compiled into it statically?

Anyway, thanks for your continued help, and I apologize for being so bothersome. I'm just anxious to use your plugin Smile.
Back to top
View user's profile Send private message
darwinscusp



Joined: 19 Jan 2005
Posts: 19

PostPosted: Fri Apr 15, 2005 4:11    Post subject: Curioser and curiouser Reply with quote

Because I was concerned that perhaps the shared library issue mentioned above might be causing some problems, I recompiled libpcap and mysql (was upgrading anyway), and made sure to compile with shared libraries. I then recompiled all of nwnx and the speech plugin. ldd nwnx_speech.so now lists libpcap and libmysqclient properly. But I still experience the segmentation fault issue.

Hope that helps maybe narrow the issue some.

If I can do anything further to help troubleshoot this, or provide additional info, I'm all ears.

Thanks,

darwinscusp
Back to top
View user's profile Send private message
darwinscusp



Joined: 19 Jan 2005
Posts: 19

PostPosted: Fri May 06, 2005 19:58    Post subject: New Makefile.in Reply with quote

In the process of troubleshooting my nwnx_speech.so problem, I created a (new) Makefile.in for the speech plugin. Using the following steps, once can configure,make, and install it, via the nwnx2 steps.

Here are the steps.

1) tar xzf linnwnx2-2.5.3-rc1.tar.gz.
2) cd linnwnx2.
3) mkdir speech.
4) cd speech.
5) unzip /your/full/path/nwnx_speech_linux_01.zip.
6) create a file called Makefile.in containing the code below.
7) cd .. # You should now be in /blah/blah/linnwnx2
Cool ./configure --prefix=/usr/local/nwn --with-extraplugins=speech
9) make
10) sudo make install

I've been screwing with this code tree for a while, so it's possible I've overlooked something. Feel free to let me know.

Code:
CXX = @CXX@
LIBS = -lmysqlclient -lz -lpcap
FLAGS = -w -fPIC -shared -W -Wall @LDFLAGS@
DEFS = -DHAVE_CONFIG_H

# TODO: snarf from configure somehow
# the user should be able to specify NWNXDIR
# if NWNXDIR is not specified, configure should
# probe (.. ../linnwnx2) and die if not found.
#NWNXDIR = @NWNXDIR@
NWNXDIR = ..

# CFLAGS = -g -O2 -I$(NWNXDIR)
# CXXFLAGS= -g -O2 $(CFLAGS)
CPPFLAGS = @CPPFLAGS@ -mcpu=i386 -I$(NWNXDIR)

NWNXBASE=$(NWNXDIR)/NWNXBase.o $(NWNXDIR)/gline.o $(NWNXDIR)/db/data.o $(NWNXDIR)/db/dbmysql.o

all: nwnx_speech.so

nwnx_speech.so: listener.o NWNXSpeech.o plugin-speech.o $(NWNXBASE)
    $(CXX) $(FLAGS) -o $@ $^ $(LIBS) $(DEFS)

clean:
    /bin/rm -f *.o *.so *~

distclean: clean
    /bin/rm -f Makefile

install: all
    mkdir -p @prefix@/ ; install nwnx_speech.so @prefix@/


Also note the area preceding "mkdir -p" and "/bin/rm", etc above *must* be tabs, not spaces.

Hope that helps somebody out.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux technical support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group