debug and Mapserver crash

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Mon Mar 14 09:14:00 EST 2005


I have found it easiest to debug CGI crashes by setting the the
environment variables and then running mapserv in the debugger so you
can see where it is crashing. On Linux:

export REQUEST_METHOD=GET
export QUERY_STRING="put everything after the ? here in quotes"
gdb /var/www/cgi-bin/mapserv
run
<crash>
where       << this prints the call stack and line number of crash
quit

I assume you can doe something similar in windows, but I'll leave that
to the windows guys to describe.

-Steve W.

Bart van den Eijnden wrote:
> Hi Steve,
>
> my experience is that nothing is debugged to stderr on a crash
> (except premature end of script headers, mapserv.exe), but I was
> wondering if this would be logical and if others have experienced
> this behaviour. My experience is only on the Win32 platform though.
>
> I do agree with you that levels would be a very welcome enhancement.
>
> Best regards, Bart
>
> On Mon, 14 Mar 2005 08:53:28 -0500, Stephen Woodbridge
> <woodbri at SWOODBRIDGE.COM> wrote:
>
>> Bart,
>>
>> I'm not sure what happens on a crash, but my experience with the
>> DEBUG and LOG are as follows.
>>
>> 1) If LOG is turned on it only writes one line to the logfile that
>> I did not find to be very useful for anything.
>>
>> 2) DEBUG output does NOT go to the LOG file it goes to STDERR which
>>  should put it into the apache/error_log. I opened a separate
>> window and did a "tail -f /var/log/apache/error_log". FWIW, the
>> only information written during DEBUG is layer timing stats. so if
>> the files are flushed on a crash, you might get a clue about what
>> layer it crashed on.
>>
>> While this is better than nothing, I would be nice if the DEBUG
>> took a LEVEL which controlled the level of verbosity of the output
>> as a bit mask or level like:
>>
>> DEBUG  1  - timing stats DEBUG  2  - subroutine DEBUG  4  -
>> file/connection OPEN/CLOSE DEBUG  8  - SQL statements DEBUG 16  -
>> etc
>>
>> But alas, it doesn't work that way.
>>
>> HTH, -Steve W.
>>
>> Bart van den Eijnden wrote:
>>
>>> Hi list,
>>>
>>> does Mapserver write debug info for the functions that are
>>> successfully called before a crash (Internal Server Error)
>>> occurs?
>>>
>>> Or when it crashes it won't write anything at all?
>>>
>>> Best regards, Bart
>>>
>>> -- Using Opera's revolutionary e-mail client:
>>> http://www.opera.com/m2/
>>>
>>
>
>
>
> -- Using Opera's revolutionary e-mail client:
> http://www.opera.com/m2/
>



More information about the mapserver-dev mailing list