From: rketcham <Ric...@gm...> - 2008-11-18 20:15:47
|
Hello, I've written a logging class which I want to use with other applications for logging process information. The logging class works on my desktop (which is using Ubuntu) but when I cross-compile it with the 1508 buildroot (with threading enabled - fixed via toolchain/Makefile.in) and deploy it on a gumstix, the class segfaults when it tries to write to an already opened file. When the toolchain is rebuilt with threading disabled, the program miraculously works and is able to write to the file it creates. My other buildroot versions (1552, 1627, 1633) have threading enabled and don't work as well. These are the includes for my class: #include <string> //String #include <fstream> //File IO #include <sstream> //String Editing #include <stdio.h> #include <time.h> The class segfaults here: m_logFile.write(logString.c_str(),logString.size()); logString is a string created from a stringstream object: ostringstream logLine; logLine<<"stuff"; string logString = logLine.str(); I need to be able to use this logging class within an application that is also using threading. Any ideas? Thanks, Rich -- View this message in context: http://www.nabble.com/fstream-with-threading-enabled-segfaults-tp20567377p20567377.html Sent from the Gumstix mailing list archive at Nabble.com. |