Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUDs
➜ General
➜ My mud will not start ??!!!??? (fixed)
My mud will not start ??!!!??? (fixed)
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
3
Posted by
| Dextermovies
(65 posts) Bio
|
Date
| Reply #30 on Sun 06 Dec 2009 11:24 PM (UTC) |
Message
| Thanks I had them both in Dystopia.h ....
This seems to be the culprit.
/*
* Read one word (into static buffer).
*/
char *fread_word(FILE * fp)
{
static char word[MAX_INPUT_LENGTH];
char buf[100];
char *pword;
char cEnd;
do
{
cEnd = getc(fp);
}
while (isspace(cEnd));
if (cEnd == '\'' || cEnd == '"')
{
pword = word;
}
else
{
word[0] = cEnd;
pword = word + 1;
cEnd = ' ';
}
for (; pword < word + MAX_INPUT_LENGTH; pword++)
{
*pword = getc(fp);
if (cEnd == ' ' ? isspace(*pword) : *pword == cEnd)
{
if (cEnd == ' ')
ungetc(*pword, fp);
*pword = '\0';
return word;
}
}
word[20] = '\0';
sprintf(buf, "Fread_word: word '%s' too long.", word);
bug(buf, 0);
my_exit(1);
return NULL;
}
Also it makes reference to
void boot_db(bool fCopyOver)
load_artifact_table();
and
void load_artifact_table()
{
FILE *fp;
char *word;
log_string("Loading Artifacts");
if ((fp = fopen("../txt/artifacts.txt", "r")) == NULL)
{
bug("Unable to open artifacts.txt", 0);
abort();
}
word = fread_word(fp);
while (str_cmp(word, END_MARKER))
{
struct arti_type *artifact = malloc(sizeof(struct arti_type));
artifact->owner = str_dup(word);
artifact->vnum = fread_number(fp);
artifact->active = fread_number(fp);
artifact->fun = fread_string(fp);
AttachToList(artifact, artifact_table);
word = fread_word(fp);
}
fclose(fp);
}
| Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #31 on Sun 06 Dec 2009 11:46 PM (UTC) |
Message
| Look in /txt/artifacts.txt for anything corrupt. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #33 on Mon 07 Dec 2009 12:53 AM (UTC) |
Message
| If you're sure load_artifact_table is causing this, set a breakpoint at it and then step into fread_word and print out any info there. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #35 on Mon 07 Dec 2009 01:27 AM (UTC) |
Message
| |
Posted by
| Dextermovies
(65 posts) Bio
|
Date
| Reply #36 on Tue 08 Dec 2009 03:46 PM (UTC) |
Message
| Ok it is the load_artifact command, I commented it out and put in return; and the mud works wonderfully now. | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #37 on Wed 16 Dec 2009 07:06 PM (UTC) Amended on Wed 16 Dec 2009 07:25 PM (UTC) by Nick Gammon
|
Message
| Another approach to capture if the MUD exits by calling exit(1) is to put a breakpoint on exit, like this example program:
#include <stdlib.h>
void a (void)
{
exit (1);
}
void b (void)
{
a ();
}
int main (void)
{
b ();
return 0;
}
Now if I run gdb, I want to find where in the code exit is called:
$ gdb test
GNU gdb 6.8-debian
(gdb) break exit
Function "exit" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (exit) pending.
(gdb) run
Starting program: /home/nick/development/test
Breakpoint 1, 0xb7ea8d06 in exit () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0 0xb7ea8d06 in exit () from /lib/tls/i686/cmov/libc.so.6
#1 0x080483d6 in a ()
#2 0x080483e1 in b ()
#3 0x080483f9 in main ()
(gdb)
Note the warning message about exit not existing just yet, but it picked it up after the libraries were loaded. Then when exit was called, you can see it was indeed located in function "a" called by function "b" called by "main". |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
98,266 views.
This is page 3, subject is 3 pages long:
1
2
3
It is now over 60 days since the last post. This thread is closed.
Refresh page
top