Re: [Cppcms-users] "booster::thread: failed to create a thread" error while running application
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2011-08-19 12:22:53
|
----- Original Message ----- > From: Abhishek Kaushik <abh...@gm...> > To: cpp...@li... > Cc: > Sent: Friday, August 19, 2011 8:28 AM > Subject: [Cppcms-users] "booster::thread: failed to create a thread" error while running application > > Hi, > > > I am facing this error on my linux server which is running CentOS. > > When I try to run any of the example applications, be it hello_world, > message_board, the compilation happens correctly without any errors, > > but when I try to run the application, example for message board: > ./mb -c config.js > > I get the following error: > "booster::thread: failed to create a thread" > > and the Application doesn't starts. > Let me know if anymore information I can provide on it, and this is the only > one- > line error I get while trying to run the application. Hello, This is very strange as it fails to create a new thread which should not happen, is there any chances that you have to few resources or you have a problems with ulimit? Provide an output of ulimit -a Have you changed service.worker_threads and/or service.worker_processes options in configuration files? To what value? To investigate the problem more: Please apply these changes: Index: pthread.cpp =================================================================== --- pthread.cpp (revision 1913) +++ pthread.cpp (working copy) @@ -65,9 +65,10 @@ } else { // failed to create - delete the object + int err = errno; delete ptr; ptr = 0; - throw runtime_error("booster::thread: failed to create a thread"); + throw runtime_error(std::string("booster::thread: failed to create a thread:") + strerror(err)); } } thread::~thread() On the file booster/lib/thread/src/pthread.cpp And try to run and see what is the reason of the error. Also: 1. Please tell me what version of CentOS are you running? (provide also uname -a) 2. Current limits ulimit -a 3. What platform (x86, x86_64, arm, PPC etc). 4. What version of CppCMS do you use? 5. What compiler and what version of compiler do you use. 6. Please run make test and see if tests are pass or fail and what exactly fails (provide a log) 7. Please provide a backtrace of the exception. At the topmost level where you catch the exception: catch(std::exception const &e) { std::cerr<<"Caught exception: "<<e.what()<<std::endl; std::cerr<<booster::trace(e) << std::endl; return 1; } It would print a full stack trace of where the exception had occurred. (You also need to add) #include <booster/backtrace.h> > Please help. > > Uptil now, I have been doing all my compilations on windows only, as I expected > that compilation won't be difficult on linux box as it is on windows, and > now I > decided to move on production linux box facing this error. > Actually Linux is the primary development platform so I'd rather expect the other way, it is much harder to configure/run code on Windows then on Linux. > Also let me know if this could be an issue in server configurations. > Maybe, take a notes on ulimit and other resources. > Thanks > Best, Artyom |