when i was installing windows i had used a name with non-latin characters, but then i changed that to a latin-character one from the control panel... however i just created another user account and now it runs just fine... so i guess you were right...Geoff the Medio wrote:or a logging issue... Does your Windows username have non-latin characters in it? Issues with them seemed to have been fixed a few months ago, but it's possble there are still issues.
Common build error
Moderator: Oberlus
Re: Common build error
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Common build error
That's irritating. Can you try to hunt down where the crash is happening with your non-latin name? My guess is that the Ogre logger or the general FreeOrion logger (log4cpp) are not converting the UTF-8 or UTF-16 path strings properly. If you can step through the code or add some debugging lines to check how the pathes are being handled and identify where the crash happens, that would be useful.georgido wrote:when i was installing windows i had used a name with non-latin characters, but then i changed that to a latin-character one from the control panel... however i just created another user account and now it runs just fine... so i guess you were right...
Re: Common build error
Code: Select all
void FileAppender::_append(const LoggingEvent& event) {
std::string message(_getLayout().format(event));
if (!::write(_fd, message.data(), message.length())) {
// XXX help! help!
}
}
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Common build error
Does it help if you modify CategoryStream::flush() in CategoryStream.cpp to be this:
Probably a long shot, but maybe worth a try to wrap it in a try-cach block.
Code: Select all
void CategoryStream::flush() {
try {
if (_buffer) {
getCategory().log(getPriority(), _buffer->str());
delete _buffer;
_buffer = NULL;
}
} catch (...) {
// logging failed...
}
}
Re: Common build error
nope, still the same...Geoff the Medio wrote:Does it help if you modify CategoryStream::flush() in CategoryStream.cpp to be this:Probably a long shot, but maybe worth a try to wrap it in a try-cach block.Code: Select all
void CategoryStream::flush() { try { if (_buffer) { getCategory().log(getPriority(), _buffer->str()); delete _buffer; _buffer = NULL; } } catch (...) { // logging failed... } }
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Common build error
Can you modify this function with the cout line and tell me if / what is output on the console before the crash?
Edit: And may try putting
after the cout line.
Code: Select all
void FileAppender::_append(const LoggingEvent& event) {
std::string message(_getLayout().format(event));
std::cout << "_fd: " << _fd << std::endl;
if (!::write(_fd, message.data(), message.length())) {
// XXX help! help!
}
}
Code: Select all
if (_fd == -1)
return;
Re: Common build error
it was indeed -1 and after putting the return statement the game runs normally... just to mention it, fd was printed more than one time, if that means anything...Geoff the Medio wrote:Can you modify this function with the cout line and tell me if / what is output on the console before the crash?Edit: And may try puttingCode: Select all
void FileAppender::_append(const LoggingEvent& event) { std::string message(_getLayout().format(event)); std::cout << "_fd: " << _fd << std::endl; if (!::write(_fd, message.data(), message.length())) { // XXX help! help! } }
after the cout line.Code: Select all
if (_fd == -1) return;
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Common build error
Except that you won't get any log files... except maybe ogre.log; does that get created?georgido wrote:it was indeed -1 and after putting the return statement the game runs normally...
This suggests it's unable to create the file for some reason, likely due to the log4cpp code not handling the non-latin pathes correctly, or not being fed them in a form it can use.
It should print it out every time the game tries to write something to the log file.just to mention it, fd was printed more than one time, if that means anything...
Re: Common build error
well aside from the empty freeorion file now there is a freeoriond file but no ogre.logGeoff the Medio wrote:except maybe ogre.log; does that get created?
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Common build error
Does freeoriond.log contain anything?
If you felt like looking into the logger initialization and what the path string it gets sent is, that might be helpful. I don't have time at the moment to point you to the right place to look, though.
If you felt like looking into the logger initialization and what the path string it gets sent is, that might be helpful. I don't have time at the moment to point you to the right place to look, though.
Re: Common build error
there were two lines:Geoff the Medio wrote:Does freeoriond.log contain anything?
If you felt like looking into the logger initialization and what the path string it gets sent is, that might be helpful. I don't have time at the moment to point you to the right place to look, though.
2013-01-14 22:30:22,028 DEBUG Server : (ServerFSM) Idle
2013-01-14 22:30:22,028 DEBUG Server : FreeOrion server waiting for network events
once i get more familiar with the code (actually first day looking at it) i guess i'll give it a look...
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Common build error
That's bizzare... Why would the client be unable to write to its log file, while the server can do so fine at almost the same file location?georgido wrote:there were two lines:Geoff the Medio wrote:Does freeoriond.log contain anything?
2013-01-14 22:30:22,028 DEBUG Server : (ServerFSM) Idle
2013-01-14 22:30:22,028 DEBUG Server : FreeOrion server waiting for network events
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Common build error
Looks like there is a bit of a difference in how the client and server log file pathes are set up. Could you try this patch to see if it gets the client log working with the non-latin username?
- Attachments
-
[The extension patch has been deactivated and can no longer be displayed.]
Re: Common build error
something's wrong with line 15 from the patch file...Geoff the Medio wrote:Looks like there is a bit of a difference in how the client and server log file pathes are set up. Could you try this patch to see if it gets the client log working with the non-latin username?
std::ofstream : Error:type name not allowed
temp: Error:expected a ';'
also temp is considered undefined on line 16
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Common build error
Weird... It looks fine to me... I guess it didn't apply properly for you. Try manually replacing these lines of HumanClientApp.cpp (around line 194)...georgido wrote:something's wrong with line 15 from the patch file...
Code: Select all
boost::filesystem::path log_path = GetUserDir() / "freeorion.log";
// erase old log
boost::filesystem::ofstream temp(log_path);
temp.close();
std::string LOG_FILENAME = PathString(log_path);
log4cpp::Appender* appender = new log4cpp::FileAppender("FileAppender", LOG_FILENAME);
Code: Select all
const std::string HUMAN_CLIENT_LOG_FILENAME((GetUserDir() / "freeorion.log").string());
// a platform-independent way to erase the old log
std::ofstream temp(HUMAN_CLIENT_LOG_FILENAME.c_str());
temp.close();
log4cpp::Appender* appender = new log4cpp::FileAppender("FileAppender", HUMAN_CLIENT_LOG_FILENAME);