Okay, so I've been racking my brain like crazy trying to figure out what the heck in gedit has been crashing my MUD. Everytime I typed "l" to pull up "gedit_list" It crashed my MUD…. For anyone having the same problem with the snippet After about 8 hours of yanking my hair out (and there's not much to pull!), I've narrowed it down. Numerous sections of the code has a "\t" which stands for tab in the list. I tried removing them from "gedit_list" and STILL was crashing…
So, I typed "grep clan" *.c and found all the files that had clan in them…. olc.c, olc_save.c, and guild.c. You can't "grep" for '\t' as it pulls up EVERY letter t that there is… So by doing this, just search for 'clan' without the quotes. Notice all of the '\t' flags that are in there. Delete those, and replace with about four spaces (or 5 if you prefer), and then save the files. Remove ALL your *.o and do a clean re-compile. Then start up the MUD as normal. By the way, if you are running gdb at the time and just try reloading the rom file, and re-running it, it'll fubar the port. You HAVE to quit gdb, or kill your MUD already running, and then restart the MUD fresh.
Hope this helps, as I'm finally relieved! –Justin, a.k.a. Koqlb koqlb@subversive.themudhost.net ….
Nope. It kept telling me that there was an error in vprintf only when removing the \t in olc_act.c. THEN it gave me the core dump. Otherwise, it just hung.
It told me that vprintf.c file was not found and blah blah blah '\t' blah blah. So I figured there were more tab hashes in there, and when i searched for clan lo and behold there were about 6 more.
What you're describing (replacing tabs with spaces in print statements) almost certainly did not fix your problem. At best, you've just hidden the issues so they'll happen later or differently in the future. You can expect to see similar crashes in the future until you fix the actual root cause.
I wasn't even able to file it because '\t' could not be found in the my host system's vprintf.c file. Therefore, by removing the "\t" and replacing them with spaces DID work, because it allowed the code to run, and I can use "gedit list" correctly now. The problem is that my host's system file for vprintf.c probably doesn't have an identifier to convert tabs into the proper spaces. Either way, I've been debugging the crap out of it, and it works great.
It's not that it's replacing tabs. It's that the actual characters in the code looked like this:
for (i=1; i <= MAX_CLAN; i++) { if (clan_table[i].name != NULL && clan_table[i].name[0] != '\0') { sprintf(buf,"[%2d] %s\t Flags:\t[%s]\n\r", i, clan_table[i].name, flag_string( guild_flags, clan_table[i].flags ) ); add_buf(buffer, buf); } }
All I did was remove the \t and actually placed 5 spaces. Worked fine. In all the other .c files that included this (the clan system is the only thing that had this) I did the same. It worked.
Tabs wasn't your problem. The <= and/or index starting at 1 in your loop was more likely the problem.
01 Nov, 2014, alteraeon wrote in the 13th comment:
Votes: 0
Koqlb, what you're talking about, replacing the '\t' with spaces, is also known as "replacing tab characters with spaces". Yes, your system's vprintf supports it. No, you probably couldn't find it in the vprintf file at your skill level.
As pointed out above, your code might now be running, but this in no way fixes the problem. Your best option at this point would be to put the tab characters back to get it to crash again, then figure out what's actually wrong. Being able to duplicate an issue reliably goes a long way toward fixing it.
Alternately, you could just ignore me and the other people on this board. It's not like any of us know anything, after all we're only professional C programmers.
It's not my skill level, it's because I don't have access to the file on themudhost.net… but the funny thing is that it wasn't even that file, it was in act_info.c where the problem was. I'm not going to ignore the problem, I'll get to the bottom of it. Thanks.
02 Nov, 2014, Ssolvarain wrote in the 15th comment:
It's not like any of us know anything, after all we're only professional C programmers.
I'm a professional builder, and people ignore me all the time. Get over it.
Builder < Programmer. Learn your place, n00b. :-p
Seriously, though, the keyword was 'professional'. You're not a professional builder, because that's not a skill that translates outside of MU*s. Many of us actually are professional programmers. It's something we do for a living outside of MU*s. There's no need getting defensive over that.
03 Nov, 2014, Ssolvarain wrote in the 17th comment:
has been crashing my MUD. Everytime I typed "l" to pull up
"gedit_list"
It crashed my MUD…. For anyone having the same problem with the snippet
After about 8 hours of yanking my hair out (and there's not much to pull!),
I've narrowed it down. Numerous sections of the code has a "\t" which stands
for tab in the list. I tried removing them from "gedit_list" and STILL was crashing…
So, I typed "grep clan" *.c and found all the files that had clan in them….
olc.c, olc_save.c, and guild.c. You can't "grep" for '\t' as it pulls up EVERY letter
t that there is… So by doing this, just search for 'clan' without the quotes.
Notice all of the '\t' flags that are in there. Delete those, and replace with about four
spaces (or 5 if you prefer), and then save the files.
Remove ALL your *.o and do a clean re-compile.
Then start up the MUD as normal. By the way, if you are running gdb
at the time and just try reloading the rom file, and re-running it,
it'll fubar the port. You HAVE to quit gdb, or kill your MUD already running,
and then restart the MUD fresh.
Hope this helps, as I'm finally relieved!
–Justin, a.k.a. Koqlb
koqlb@subversive.themudhost.net
….