[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Fastcgipp-users] Segfault on apache shutdown
From: |
Eddie Carle |
Subject: |
Re: [Fastcgipp-users] Segfault on apache shutdown |
Date: |
Mon, 15 Aug 2011 12:57:05 -0600 |
On Fri, 2011-08-12 at 14:17 -0300, Riccardo Campisano wrote:
> Thanks for your fast reply.
>
> Running the application from the command line don't cause any problem.
> The git source was built using the bootstrap script in the package,
> however the version fastcgi++-2.0beta-6852ded9 built with ./configure
> && make has the same problem. The app run on a debian stable (a
> chrooted environment) with boost 1.35.
>
> I add your "debug" code, the source of the application is at the end
> of this email.
>
> When I start the apache end kill it without call the fcgi application
> on the browser, no error is reported. When I start the apache, call
> the fcgi, this log is reported (as correct):
>
> cat /tmp/errlog
> [2011-Aug-12 13:58:13] Debug 0
> [2011-Aug-12 13:58:13] Debug 1
> [2011-Aug-12 13:58:13] Echo::response()
>
> Whenever I stop apache after a call on the fcgi application, the error
> is reported by syslogd at /var/log/message
> Aug 12 13:59:30 ubuntudev kernel: [154439.084532] test.fcgi[6573]:
> segfault at 0 ip b77db2e8 sp bfd0e0d0 error 4 in
> libfastcgipp.so.2.0.0[b77d2000+73000]
>
> Thanks, and sorry for my English
> Riccardo
>
> ______________________________________________________________________________________
>
> #include <fstream>
> #include <boost/date_time/posix_time/posix_time.hpp>
>
> #include <fastcgi++/request.hpp>
> #include <fastcgi++/manager.hpp>
>
> void error_log(const char* msg)
> {
> using namespace std;
> using namespace boost;
> static ofstream error;
> if(!error.is_open())
> {
> error.open("/tmp/errlog", ios_base::out | ios_base::app);
> error.imbue(locale(error.getloc(), new
> posix_time::time_facet()));
> }
>
> error << '[' << posix_time::second_clock::local_time() << "] " <<
> msg << endl;
> }
>
> class Echo: public Fastcgipp::Request<wchar_t>
> {
> bool response()
> {
> error_log("Echo::response()");
> out << "Content-Type: text/html; charset=utf-8\r\n\r\n";
> out << "Hallo\n";
>
> return true;
> }
> };
>
> int main()
> {
> try
> {
> error_log("Debug 0");
> Fastcgipp::Manager<Echo> fcgi;
> error_log("Debug 1");
> fcgi.handler();
> error_log("Debug 2");
> }
> catch(std::exception& e)
> {
> error_log(e.what());
> }
> }
>
Wow, the plot thickens. It seems like such a simple application. Tt is
strange that it should segfault. Perhaps I am misunderstanding
something, but does the app seem to function fine up until apache tries
to terminate it?
--
Eddie Carle