Welcome to the Builder Academy

Question Running on Raspberry Pi2 and learning some BASIC Linux

More
25 Jun 2015 21:20 #5349 by AshlarTaltos
As much as I can, I have tried to debug scientifically, yes.
I followed the thread. I've googled as much as I can. I've tried
removing the *room* that throws the error. Then the one after that,
and again. Then began on the mobs that threw an error. And again.
Ad nauseum.

As of now, I have it running, sort of. After removing 7 world files and 14 mobs.
As I said, it would just be nice to use all of tbaMUD, and not just the stuff that
happens to work. Fresh install of os, fresh install of tbaMUD. Compiler errors about
variables that are set, but not used (a lot of them), then this problem.

As far as I can tell, it's a problem with the way the actual mud reads those files,
as the same issues tend to happen with stock Circle files. So as much as I would
like to go through and fix all the incorrect parts, I could more easily get a different
base that will run properly on ARM.

I'll just use it broken and fix it myself. At least I can guarantee a working
product that way. Thanks!

Please Log in or Create an account to join the conversation.

More
26 Jun 2015 22:01 #5350 by thomas
So it happens on and off, for the same files?

Please Log in or Create an account to join the conversation.

More
05 Aug 2020 21:28 #8826 by doogie
I know this is old, but for anyone else who comes looking for how to fix this, it's in db.c in fread_string(). Sometimes, there is a ~ stored in the memory location in front of tmp array. The for loop will decrement below the starting memory address, making it read the ~ and think it's at the end of the room. So it expects to start a new room, but is in the middle of a room record which makes it error out. This seems to be related somehow to how the Pi stores data, although it could technically affect any platform.

Anyway, the fix is to modify the for loop to add a pointer check:
for (point-- ; (*point=='\r' || *point=='\n') && point > tmp; point--);

and add an if check to the else statement after the loop to make sure we're pointing at the right place:
if (*point == '\n' || *point == '\r')
*point = '\r';
else
*(++point) = '\r';

*(++point) = '\n';
*(++point) = '\0';

That should stop the crashing. I believe this is slotted to be fixed soon.

Cheers

Please Log in or Create an account to join the conversation.

More
19 Dec 2020 19:41 #9771 by criz
Hello after 5 years!

I tried this with a new install: I'm getting a error on running bin/circle -m

Dec 19 14:26:51 2020 :: Loading triggers and generating index.
Dec 19 14:26:51 2020 :: SYSERR: fread_string: string too large (db.c)
Dec 19 14:26:51 2020 :: trig vnum 0


Here's the segment of the db.c file I updated. Did I miss something?

if (!fgets(tmp, 512, fl)) {
log("SYSERR: fread_string: format error at or near %s", error);
exit(1);
}
/* If there is a '~', end the string; else put an "\r\n" over the '\n'. */
/* now only removes trailing ~'s -- Welcor */
point = strchr(tmp, '\0');
for (point-- ; (*point=='\r' || *point=='\n') && point > tmp; point--);
if (*point == '\n' || *point == '\r') {
*point = '\r';
} else {
*(++point) = '\r';
*(++point) = '\n';
*(++point) = '\0';
}
templength = point - tmp;

if (length + templength >= MAX_STRING_LENGTH) {
log("SYSERR: fread_string: string too large (db.c)");
log("%s", error);
exit(1);
} else {
strcat(buf + length, tmp); /* strcat: OK (size checked above) */
length += templength;
}
} while (!done);

Please Log in or Create an account to join the conversation.

More
31 Dec 2020 05:47 #9772 by doogie
At a glance, it looks like you may have inadvertantly deleted the tilde check. It should look something like this:

/* If there is a '~', end the string; else put an "\r\n" over the '\n'. */
/* now only removes trailing ~'s -- Welcor */
point = strchr(tmp, '\0');
for (point-- ; (*point=='\r' || *point=='\n') && point > tmp; point--);
if (*point=='~') {
*point='\0';
done = 1;
} else {
if (*point == '\n' || *point == '\r')
*point = '\r';
else
*(++point) = '\r';

*(++point) = '\n';
*(++point) = '\0';
}

templength = point - tmp;

if (length + templength >= MAX_STRING_LENGTH) {
log("SYSERR: fread_string: string too large (db.c)");
log("%s", error);
exit(1);
} else {
strcat(buf + length, tmp); /* strcat: OK (size checked above) */
length += templength;
}
} while (!done);

Best,
Doogie
The following user(s) said Thank You: lacrc

Please Log in or Create an account to join the conversation.

More
22 Jan 2021 20:53 #9779 by criz
Just following up - thank you to the kind person who updated the relevant file on github! Downloaded the zip file from there, compiled and have it successfully running on a Raspberry Pi 2 - no errors! Happy to be back in Midgaard !

Please Log in or Create an account to join the conversation.

Time to create page: 0.210 seconds