Re: [Cppcms-users] Segmentation fault
Brought to you by:
artyom-beilis
From: Artyom <art...@ya...> - 2010-10-20 21:21:14
|
I hadn't reproduced the crash bug, but there is other but that seems to be related, I'm working on it that may cause the crash. Also can you send me the backtrace of the crash? You can do it with gdb this way: Compile with "-g" switch and then in gdb > r -c config.js --- Observer Crash > bt ..... this is trace Artyom ----- Original Message ---- > From: Mario Palomo <mp...@us...> > To: cpp...@li... > Sent: Wed, October 20, 2010 7:30:07 PM > Subject: [Cppcms-users] Segmentation fault > > Hello, > > I'm starting to use CppCMS ("cppcms-0.99.3.tar.bz2" downloaded from > SourceForge), and noticed that when generating very long responses, the > executable ends with a segfault. I am using the built-in server, and I reduced > > the code to the following: > > ______________________________________________________________________________ > /* > bench.cpp > */ > #include <cppcms/application.h> > #include <cppcms/applications_pool.h> > #include <cppcms/service.h> > #include <cppcms/http_response.h> > #include <iostream> > > class bench : public cppcms::application > { > public: > bench(cppcms::service &srv) : cppcms::application(srv) { } > > virtual void main(std::string url) > { > for (int i=0; i < 100000; ++i) { > response().out() << i << "\n"; > } > }//main > };//class bench > > int main(int argc, char *argv[]) > { > try { > cppcms::service srv(argc, argv); > srv.applications_pool().mount(cppcms::applications_factory<bench>()); > srv.run(); > } > catch (const std::exception &e) { > std::cerr << e.what() << std::endl; > } > > return 0; > }//main > ______________________________________________________________________________ > > ______________________________________________________________________________ > /* > config.js > */ > { > "service": { > "api": "http", > "port": 8080, > }, > "http": { > "script_names": [ "/bench" ], > }, > } > ______________________________________________________________________________ > > > I start the application: > > $ ./bench -c config.js > > Then, I use "curl" to make a request: > > $ curl http://localhost:8080/bench > > And the application ("bench") terminates with a segmentation fault. > > A backtrace shows that the last statement that is executed is the line 476 of > file "cgi_api.cpp" ('write_some()' in function 'connection::write()'), but so > far I have not gotten more information. > > Can anyone else reproduce the problem? Can be solved if I use the latest > version in SVN? (I'll try to test soon with the latest version of the code). > > Thank you for creating something as awesome as CppCMS. Regards, > > Mario > > > > ------------------------------------------------------------------------------ > Nokia and AT&T present the 2010 Calling All Innovators-North America contest > Create new apps & games for the Nokia N8 for consumers in U.S. and Canada > $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing > Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store > http://p.sf.net/sfu/nokia-dev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |