Re: [Cppcms-users] cppcms hangs if cppcms::application ctor throws exception
Brought to you by:
artyom-beilis
|
From: Karsten A. <kar...@go...> - 2013-11-29 11:33:05
|
Aha, in debug mode the program behaves as expected. In release mode it
hangs. Any ideas?
On 29.11.2013 12:02, Shiv Shankar Dayal wrote:
> Try to debug using gdb and send a stack trace where it gets stuck. That
> will help.
>
>
> On Fri, Nov 29, 2013 at 3:51 PM, Karsten Ahnert
> <kar...@go... <mailto:kar...@go...>>
> wrote:
>
> My one hangs. I use gcc 4.7.3 and ubuntu 13.04 and CppCMS 1.0.4.
>
>
>
> On 29.11.2013 11:09, Shiv Shankar Dayal wrote:
> > Tested with GCC 4.7.0 GNU/Linux Mint 15 CppCMS 1.0.4 seems to work
> > fine as it prints "Exception" on console and program terminates.
> >
> >
> > On Fri, Nov 29, 2013 at 3:32 PM, Karsten Ahnert
> > <kar...@go...
> <mailto:kar...@go...>
> <mailto:kar...@go...
> <mailto:kar...@go...>>>
> > wrote:
> >
> > Hi,
> >
> > cppcms hangs if the constructor of cppcms::application and
> derived class
> > throw, see the code below. Any ideas how to fix this?
> >
> >
> >
> >
> > #include <cppcms/applications_pool.h>
> > #include <cppcms/service.h>
> > #include <cppcms/http_response.h>
> > #include <cppcms/application.h>
> >
> > #include <iostream>
> > #include <stdexcept>
> >
> > using namespace std;
> >
> > class my_app : public cppcms::application
> > {
> > public:
> >
> > my_app( cppcms::service& srv )
> > : cppcms::application( srv )
> > {
> > throw std::runtime_error( "Exception" );
> > }
> >
> > virtual void main(std::string url)
> > {
> > cout << "Hello world!" << endl;
> >
> > response().out() <<
> > "<html>\n"
> > "<body>\n"
> > " <h1>Hello World</h1>\n"
> > "</body>\n"
> > "</html>\n";
> > }
> > };
> >
> >
> > int main( int argc , char **argv )
> > {
> > try
> > {
> > cppcms::service app( argc , argv );
> > app.applications_pool().mount(
> cppcms::applications_factory<
> > my_app >() );
> > app.run();
> > }
> > catch( std::exception const &e )
> > {
> > std::cerr << e.what() << std::endl;
> > }
> >
> > return 0;
> > }
> >
> >
> ------------------------------------------------------------------------------
> > Rapidly troubleshoot problems before they affect your
> business. Most IT
> > organizations don't have a clear picture of how application
> performance
> > affects their revenue. With AppDynamics, you get 100% visibility
> > into your
> > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
> > AppDynamics Pro!
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Cppcms-users mailing list
> > Cpp...@li...
> <mailto:Cpp...@li...>
> > <mailto:Cpp...@li...
> <mailto:Cpp...@li...>>
> > https://lists.sourceforge.net/lists/listinfo/cppcms-users
> >
> >
> >
> >
> > --
> > Respect,
> > Shiv Shankar Dayal
> >
> >
> >
> ------------------------------------------------------------------------------
> > Rapidly troubleshoot problems before they affect your business.
> Most IT
> > organizations don't have a clear picture of how application
> performance
> > affects their revenue. With AppDynamics, you get 100% visibility
> into your
> > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
> AppDynamics Pro!
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
> >
> >
> >
> > _______________________________________________
> > Cppcms-users mailing list
> > Cpp...@li...
> <mailto:Cpp...@li...>
> > https://lists.sourceforge.net/lists/listinfo/cppcms-users
> >
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility
> into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
> AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> <mailto:Cpp...@li...>
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
>
>
> --
> Respect,
> Shiv Shankar Dayal
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
|