You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Marc Schablewski <ms...@clickware.de> on 2001/04/27 11:04:25 UTC

general/7641: Exception-handling does not work when writing an apache-module in C++

>Number:         7641
>Category:       general
>Synopsis:       Exception-handling does not work when writing an apache-module in C++
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          support
>Submitter-Id:   apache
>Arrival-Date:   Fri Apr 27 02:10:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     ms@clickware.de
>Release:        1.3.
>Organization:
apache
>Environment:
System:   SuSE Linux 6.2 (Kernel 2.2.10), 333MHz AMD-K6 2 Processor, 448MB RAM
Compiler: egcs-2.91.66
>Description:
I recently wrote an apache module for my company using the C++ languege. It also uses some self-written Libraries that use exceptions for error reporting.

Now, may problem is that when an exception is thrown, the code inside of a catch-block is not executed. Instead, the whole request is cancled and a "No Object Data" error is sent back to the client.

To get around this problem, I tried to put the whole c++ stuff into its own shared library, which I then dynamically load in my modul's initialisation phase, but this results in the same error.

Is there any solution to this problem?
Thanks in advance for your help!

Regards, Marc
>How-To-Repeat:
Just write a simple module with the following content-handler:

int modcwh_handler(request_rec *r) {
   r->content_type = "text/plain";
   ap_send_http_header(r);
   ap_rputs("before exception!\n",r);
   try{
      throw "exception";
   }catch(...){
      ap_rputs("exception caught!\n",r);
   }
   ap_rputs("after exception!\n",r);
   return OK;
}
>Fix:
No
>Release-Note:
>Audit-Trail:
>Unformatted:
 [In order for any reply to be added to the PR database, you need]
 [to include <ap...@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]