<br><font size=2 face="sans-serif">Thanks Umberto! Good hint. In this context
I found something.</font>
<br>
<br><font size=2 face="sans-serif">Since this kind of problem may occure
to others to, I'll briefly </font>
<br><font size=2 face="sans-serif">summarize the steps I go:</font>
<br>
<br><font size=2 face="sans-serif">a) In map.h include somewhere the line</font>
<br><font size=2 face="sans-serif">#include &lt;mcheck.h&gt;</font>
<br>
<br><font size=2 face="sans-serif">b) Compile Mapserver with debug-option:</font>
<br><font size=2 face="sans-serif">./configure &lt;flags&gt; &nbsp;--enable-debug</font>
<br><font size=2 face="sans-serif">make</font>
<br>
<br><font size=2 face="sans-serif">c) Before starting tomcat set the environmentvariable
&nbsp;MALLOC_TRACE</font>
<br><font size=2 face="sans-serif">to the name of a logfile.</font>
<br><font size=2 face="sans-serif">export MALLOC_TRACE=/opt/jakarta-tomcat-4.1.31/logs/malloctrace</font>
<br>
<br><font size=2 face="sans-serif">The tracefile will contains information
about calls to &quot;malloc&quot; and &quot;free&quot;:</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;- Function called malloc/free
</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp;- address of allocated/freed
memory</font>
<br>
<br><font size=2 face="sans-serif">By this file one can look for the &quot;pairs&quot;.
</font>
<br>
<br><font size=2 face="sans-serif">I'll still have to test in in practice.
But I'm hopefull, that this will help to </font>
<br><font size=2 face="sans-serif">narrow the problem down.</font>
<br>
<br><font size=2 face="sans-serif">Benedikt Rothe</font>
<br>
<br>
<br><font size=2><tt>Umberto Nicoletti &lt;umberto.nicoletti@gmail.com&gt;
schrieb am 02.11.2005 12:29:05:<br>
<br>
&gt; Newer glibc have internal checks that are probably turned on by<br>
&gt; default on some distros.<br>
&gt; Try to play with the MALLOC_CHECK_ variable and read this (it is about<br>
&gt; fedora core, but should apply to suse too):<br>
&gt; <br>
&gt; &nbsp; &nbsp; glibc<br>
&gt; &nbsp; &nbsp; &nbsp; The version of glibc provided with Fedora Core
3 performs<br>
&gt; &nbsp; &nbsp; &nbsp; additional internal sanity checks to prevent
and detect data<br>
&gt; &nbsp; &nbsp; &nbsp; corruption as early as possible. By default,
should corruption<br>
&gt; &nbsp; &nbsp; &nbsp; be detected, a message similar to the following
will be displayed<br>
&gt; &nbsp; &nbsp; &nbsp; on standard error (or logged via syslog if stderr
is not open):<br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; *** glibc detected *** double free or corruption:
0x0937d008 ***<br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; By default, the program that generated this error
will also be<br>
&gt; &nbsp; &nbsp; &nbsp; killed; however, this (and whether or not an
error message is<br>
&gt; &nbsp; &nbsp; &nbsp; generated) can be controlled via the MALLOC_CHECK_
environment<br>
&gt; &nbsp; &nbsp; &nbsp; variable. The following settings are supported:<br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 -- Do not generate an
error message, and do not kill the program<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 -- Generate an error message,
but do not kill the program<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2 -- Do not generate an
error message, but kill the program<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3 -- Generate an error message
and kill the program<br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; Note<br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; If MALLOC_CHECK_ is explicitly set a value other
than 0, this<br>
&gt; &nbsp; &nbsp; &nbsp; causes glibc to perform more tests that are more
extensive than<br>
&gt; &nbsp; &nbsp; &nbsp; the default, and may impact performance.<br>
&gt; <br>
&gt; &nbsp; &nbsp; &nbsp; Should you have a program from a third party
ISV that triggers<br>
&gt; &nbsp; &nbsp; &nbsp; these corruption checks and displays a message,
you should<br>
&gt; &nbsp; &nbsp; &nbsp; file a defect report with the application's vendor,
since this<br>
&gt; &nbsp; &nbsp; &nbsp; indicates a serious bug.<br>
&gt; <br>
&gt; Best regards,<br>
&gt; Umberto<br>
&gt; <br>
&gt; On 11/2/05, Benedikt Rothe &lt;umn-ms@hydrotec.de&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; Dear Mapserver-Users<br>
&gt; &gt;<br>
&gt; &gt; We developed a Tomcat/Mapserver-Site using Mapscript on<br>
&gt; &gt; Linux/SUSE 9.3.<br>
&gt; &gt;<br>
&gt; &gt; Many things run fine. On a test-machine we made successfully<br>
&gt; &gt; some stress-testing and Tomcat runs for weeks.<br>
&gt; &gt;<br>
&gt; &gt; Unfortunately Tomcat crashes on the customers production-machine<br>
&gt; &gt; approximately once a day. It runs for several hours,<br>
&gt; &gt; passes stress-tests successfully but crashes unpredictable after<br>
&gt; &gt; 12-20hours.<br>
&gt; &gt;<br>
&gt; &gt; The crash occurs in Mapserver-Code. Message in the Tomcat-log<br>
&gt; &gt; is<br>
&gt; &gt; *** glibc detected *** double free or corruption (top): 0x0xf99950&quot;<br>
&gt; &gt;<br>
&gt; &gt; Question: Can I do something to make this error-message more
helpful?<br>
&gt; &gt; I'd like to have the stack and the line-numbers in the sourcecode.<br>
&gt; &gt; (I mean the C-stack and C-linenumber and not the Java-Stack...)<br>
&gt; &gt;<br>
&gt; &gt; I looked through the gcc-man-page, but I coudn't find anything
helpful.<br>
&gt; &gt;<br>
&gt; &gt; Thanks<br>
&gt; &gt; Benedikt Rothe<br>
</tt></font>