Last night, I cleaned out the Rustbot executable and recompiled. I didn't change any source code; I changed nothing. And as a result, it hung. Through some clever commenting-out of sections of code, I found that it was stuck in an infinite loop while reading a configuration file. The problem was that fstream::eof() was never returning a true value, which caused the loop to keep going and going and going and going and going and.. well, yeah. Infinite loop.
The most upsetting part about the problem was that the exact same code has worked for years. The source didn't change, nor did the config file itself. So why was eof never returning true?
I have no idea.
Tonight, I decided to just throw in my own end trigger which causes the loop to abort, and now it's back to normal....ish...cy.
I had to tutor tonight so my time with code was extremely limited. Look forward to more updates in the coming days, as I will be inundated with time which I can devote to Rustbot. Hooray!
No comments:
Post a Comment