 |
 |
 |
 |
 |
Author |
Message |
Delerak

Joined: 17 May 2005 Posts: 49 Location: Tampa
|
Posted: Wed Feb 28, 2007 2:55 am Post subject: Getting this mud running. |
|
|
Hey all. Got a few lines of problems with running my mud.
The first error.
Code: |
[darksun@omen pp]$ ./start-server 5040 &
[1] 20401
[darksun@omen pp]$ rm: cannot lstat `bin/booting': No such file or directory
./start-server: line 8: 20405 Aborted (core dumped)
bin/server 5040 >stdout
./start-server: line 8: 20407 Aborted (core dumped)
bin/server 5040 >stdout
|
Code: |
And the actual dump which shows the actual error.
(gdb) run
Starting program: /usr/users/mud/darksun/Argila2/Argila3.0/pp/bin/server
/usr/users/mud/darksun/Argila2/Argila3.0/pp/bin/server: error while
loading shared libraries: liblua5.1.so: cannot open shared object file:
No such file or directory
Program exited with code 0177.
|
I can fix that. With the export command. Then we get this error though.
Code: |
Starting program: /usr/users/mud/darksun/Argila2/Argila3.0/pp/bin/server
ERROR: main: Please specify a port number above 1024.
Program exited with code 01.
(gdb)
|
We don't think it's the port number relating to the mud, here is a copy of our start-server script.
Code: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/lib
rm bin/booting
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
do
rm stdout
bin/server 5040 > stdout &
wait
done
|
As you can see we have the port set to 5040. We can even use ./start-server 4500 to check other ports. This isn't the problem.
Here is the chunk of code that the error is coming from.
In comm.c
Code: |
/* Process any non-option arguments (namely the port number) */
if ( (optind >= argc)
|| !isdigit(*argv[optind])
|| (port = atoi (argv[optind])) <= 1024) {
fprintf (stderr, "ERROR: main: "
"Please specify a port number above 1024.\n");
exit (EXIT_FAILURE);
}
|
Thanks and I hope someone knows what's going on in this silly shell.
-D[/code] |
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Kelson
Joined: 18 May 2005 Posts: 71 Location: SC
|
Posted: Wed Feb 28, 2007 12:44 pm Post subject: |
|
|
Lacking any other information, my first guess is optind is 0 or >= argc. Could you include a bit of the preceeding code? |
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Delerak

Joined: 17 May 2005 Posts: 49 Location: Tampa
|
Posted: Wed Feb 28, 2007 5:06 pm Post subject: |
|
|
Sure here is some more of comm.c
Code: |
/*
* Want to use GNU-style long options if getopt_long() is available
*/
short_option = getopt_long (argc, argv, "vc:",
long_options, &option_index);
/* -1 means we've reached the end of the arguments */
if (short_option == -1) {
break;
}
switch (short_option) {
case 0:
break;
case 'v':
valgrind = TRUE;
break;
/* copyover - passes the mother descriptor on reboot */
case 'c':
fCopyOver = TRUE;
s = strtol (optarg, 0, 10);
break;
/* Unknown Option */
case '?':
/*
* If we are using the GNU getopt_long (), then it should have already
* printed an appropriate error message, and we can exit
*/
if (isprint (optopt)) {
fprintf (stderr, "ERROR: main "
"Unknown option '-%c'.\n", optopt);
}
else {
fprintf (stderr, "ERROR: main "
"Unknown option '\\x%x'.\n",
optopt);
}
exit (EXIT_FAILURE);
break;
/* Unhandled Option */
default:
if (isprint (short_option)) {
fprintf (stderr, "ERROR: main: "
"Unhandled short_option '%c'.\n",
short_option);
}
else {
fprintf (stderr, "ERROR: main "
"Unhandled short_option '\\x%x'.\n",
short_option);
}
exit (EXIT_FAILURE);
break;
}
}
|
Lemme know if you want more. |
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Drey
Joined: 15 May 2005 Posts: 24 Location: Livonia, MI
|
Posted: Wed Feb 28, 2007 7:37 pm Post subject: |
|
|
Does it run fine if you don't use the shell but just do "bin/server 5040" from the prompt?
If not, you might want to fire it up in gdb so you can examine the values of argc and **argv, or actually print out all of the parameters in comm.c if you're not familiar with using gdb.
If it runs fine from the command prompt, then there's something wrong with the shell script. |
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Delerak

Joined: 17 May 2005 Posts: 49 Location: Tampa
|
Posted: Thu Mar 01, 2007 2:04 am Post subject: |
|
|
Nope here is what I get.
Code: |
[darksun@omen bin]$ ./server 5040
Abort (core dumped)
[darksun@omen bin]$ gdb server
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...r
(gdb) run
Starting program: /usr/users/mud/darksun/Argila2/Argila3.0/pp/bin/server
ERROR: main: Please specify a port number above 1024.
Program exited with code 01.
|
Let me study up on gdb a bit more and I will try to get some more code to you guys, thanks. |
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Delerak

Joined: 17 May 2005 Posts: 49 Location: Tampa
|
Posted: Thu Mar 01, 2007 2:12 am Post subject: |
|
|
Hey, I think to make things easier I went ahead and uploaded the whole comm.c file to my webhost, I'm still looking over some gdb documentation, but it's a bit lengthy so I'm going to keep reading up on this tonight.
Here is the link to the file.
http://www.darksunkings.com/comm.c
Thanks again, guys.
-D |
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Delerak

Joined: 17 May 2005 Posts: 49 Location: Tampa
|
Posted: Thu Mar 01, 2007 5:44 am Post subject: Update. |
|
|
I commented out the area in comm.c that was giving me the port 1024 problems. Now this. Here is a copy of the gdb debug I tried.
Code: |
Starting program: /usr/users/mud/darksun/Argila2/Argila3.0/pp/bin/server
Breakpoint 1, main (argc=1, argv=0xbffff9f4) at comm.c:134
134 int option_index = 0; /* Index into long_options */
(gdb) next
143 while (1) {
(gdb) next
148 short_option = getopt_long (argc, argv, "vc:",
(gdb) next
153 if (short_option == -1) {
(gdb) next
221 luaVM = luaL_newstate();
(gdb) next
222 luaL_openlibs (luaVM);
(gdb) next
225 if ( chdir (DFLT_DIR) < 0 ) {
(gdb) next
231 bootstart=time(0);
(gdb) next
233 init_mysql();
(gdb) next
Program received signal SIGABRT, Aborted.
0x400d65c1 in kill () from /lib/libc.so.6
(gdb) next
Single stepping until exit from function kill,
which has no line number information.
Program terminated with signal SIGABRT, Aborted.
The program no longer exists.
|
Argila 2.0 is such a pain.
Last edited by Delerak on Thu Mar 01, 2007 5:47 am; edited 1 time in total |
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Delerak

Joined: 17 May 2005 Posts: 49 Location: Tampa
|
Posted: Thu Mar 01, 2007 5:46 am Post subject: |
|
|
I think this all has something to do with the LUA scripting engine that was put in with the code. |
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Drey
Joined: 15 May 2005 Posts: 24 Location: Livonia, MI
|
Posted: Thu Mar 01, 2007 5:42 pm Post subject: |
|
|
Well, this is peculiar. I was able to get the file you put up to compile with a little work (remove some includes, define some variables that must be defined elsewhere, etc). Once I did so, it ran fine for me. If no arguments were provided, it whined about needing a port. If I provide a number argument, it ran without complaints (as long as it was a numeric argument). I was doing this under the /bin/sh shell. |
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Delerak

Joined: 17 May 2005 Posts: 49 Location: Tampa
|
Posted: Thu Mar 01, 2007 5:59 pm Post subject: |
|
|
I can compile my code fine, it's getting the mud to run via the start server script. |
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Delerak

Joined: 17 May 2005 Posts: 49 Location: Tampa
|
Posted: Thu Mar 01, 2007 6:02 pm Post subject: |
|
|
Here's my code compiling.
Code: |
[darksun@omen src]$ make
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include comm.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include act.comm.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include act.informative.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include act.movement.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include crafts.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include objects.c
objects.c:3906: warning: `/*' within comment
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include act.offensive.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include act.other.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include wounds.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include money.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include staff.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include handler.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include db.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include commands.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include utility.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include limits.c
limits.c:649: warning: `/*' within comment
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include mobact.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include fight.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include weather.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include constants.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include olc.c
olc.c: In function `do_redesc':
olc.c:2467: warning: unused variable `delete_desc'
olc.c:2466: warning: unused variable `testdesc'
olc.c: In function `do_oset':
olc.c:4617: warning: char format, pointer arg (arg 4)
olc.c:4617: warning: char format, pointer arg (arg 5)
olc.c: In function `do_mset':
olc.c:5979: warning: char format, pointer arg (arg 4)
olc.c:5979: warning: char format, pointer arg (arg 5)
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include create_mobile.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include hash.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include roomprogs.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include nanny.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include save.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include magic.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include mobprogs.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include mysql.c
mysql.c: In function `store_mysql_obj':
mysql.c:754: warning: unused variable `trig_list'
mysql.c:752: warning: unused variable `trig'
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include somatics.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include clans.c
gcc -c -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include larg_prog.c
larg_prog.c: In function `larg_trigger_time_select':
larg_prog.c:18: warning: unused variable `rnum'
larg_prog.c:17: warning: unused variable `buf'
larg_prog.c: In function `larg_mob_trigger_time':
larg_prog.c:118: warning: unused variable `tmob'
larg_prog.c: In function `larg_trigger_room_create':
larg_prog.c:157: warning: implicit declaration of function `strchr'
larg_prog.c:157: warning: assignment makes pointer from integer without a cast
larg_prog.c: In function `larg_trigger_obj_create':
larg_prog.c:181: warning: assignment makes pointer from integer without a cast
larg_prog.c: In function `larg_trigger_mob_create':
larg_prog.c:206: warning: assignment makes pointer from integer without a cast
larg_prog.c: In function `larg_trigger_remove':
larg_prog.c:240: warning: unused variable `temp'
larg_prog.c: In function `larg_execute_script':
larg_prog.c:353: warning: implicit declaration of function `r_loadmob'
larg_prog.c:273: warning: unused variable `mess_room_num'
larg_prog.c: In function `larg_room_script_add':
larg_prog.c:479: warning: char format, pointer arg (arg 4)
larg_prog.c:479: warning: char format, pointer arg (arg 5)
larg_prog.c:485: warning: implicit declaration of function `isdigit'
larg_prog.c: In function `larg_room_script_delete':
larg_prog.c:519: warning: unused variable `head_trig'
larg_prog.c: In function `larg_mo_script_delete':
larg_prog.c:600: warning: unused variable `head_trig'
larg_prog.c:599: warning: unused variable `buf'
gcc -ggdb -DLINUX -O -Wall -I./include -I/usr/include/mysql/ -I/usr/include/openssl/ -I./include -L/usr/users/mud/darksun/lib/ -L/usr/lib/ -L/usr/lib/mysql/ -L./lib \
-L./lib -o ../bin/server \
-lz -lmysqlclient -llua5.1 -lm -ldl comm.o act.comm.o act.informative.o act.movement.o crafts.o objects.o act.offensive.o act.other.o wounds.o money.o staff.o handler.o db.o commands.o utility.o limits.o mobact.o fight.o weather.o constants.o olc.o create_mobile.o hash.o roomprogs.o nanny.o save.o magic.o mobprogs.o mysql.o somatics.o clans.o larg_prog.o
[darksun@omen src]$
|
|
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Aioros
Joined: 16 Jun 2005 Posts: 14 Location: Lisboa, Portugal
|
Posted: Fri Mar 02, 2007 3:05 pm Post subject: |
|
|
Runing the code from GDB won't call the startup script therefore you're calling the mud without arguments.
Try running the mud from gdb with
If you have the code compiled with the -g flag and you have a core file, you can use
and then type inside gdb
It should show you the call stack, showing you the path to the crashing line. |
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Delerak

Joined: 17 May 2005 Posts: 49 Location: Tampa
|
Posted: Fri Mar 02, 2007 5:08 pm Post subject: |
|
|
Code: |
This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) run 5040
Starting program: /usr/users/mud/darksun/Argila2/Argila3.0/pp/bin/server 5040
Program received signal SIGABRT, Aborted.
0x400d65c1 in kill () from /lib/libc.so.6
(gdb) next
Single stepping until exit from function kill,
which has no line number information.
Program terminated with signal SIGABRT, Aborted.
The program no longer exists.
|
Can't seem to figure what you mean by -g flag on compile? It won't let me provide that when I do make, unless I need to put -g in the makefile itself? |
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Drey
Joined: 15 May 2005 Posts: 24 Location: Livonia, MI
|
Posted: Fri Mar 02, 2007 6:22 pm Post subject: |
|
|
Delerak wrote: | Can't seem to figure what you mean by -g flag on compile? It won't let me provide that when I do make, unless I need to put -g in the makefile itself? |
Yes, the makefile likely has some lines at the beginning that define flags for the compiler and linker.
From the last gdb output you provided, it looks like it accept the port information and crashed further in to the program. It's beginning to sound like the shell script somehow isn't passing in the arguments. |
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
Author |
Message |
Delerak

Joined: 17 May 2005 Posts: 49 Location: Tampa
|
Posted: Fri Mar 02, 2007 10:47 pm Post subject: |
|
|
Yeah, somethings really messed up. Because that lib/libc.so.6 file isn't even mine. It's the servers. Going to check into that now. |
|
Back to top |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
|
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
|
|
 |
 |
 |
 |
|
 |