Since it is OS X, did you try to enable any of the malloc debug (man malloc)? There are a whole bunch of env vars that can be set, sometimes they provide useful information.<div><br class="webkit-block-placeholder"></div><div>
Dan</div><div><br><br><div class="gmail_quote">On Feb 9, 2008 12:37 PM, Luc Heinrich &lt;<a href="mailto:luc@honk-honk.com">luc@honk-honk.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Greetings,<br><br>So my last posts about crashes in &#39;ruby_xml_xpath_object_mark&#39; turned<br>out to be a non-issue since the problem is already fixed. However,<br>I&#39;m still getting *lots* of random crashes which prevent my web<br>
application to stay up for more than 10mn, which is of course<br>unacceptable.<br><br>The strange thing is that those crashes have different code paths but<br>all end up in the system malloc. Here are four examples...<br>
<br>Example 1:<br><br>0 &nbsp; libSystem.B.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x90003cf4 szone_malloc + 956<br>1 &nbsp; libSystem.B.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x90003600 malloc + 632<br>2 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x015615e8 xmlXPathNodeSetCreate + 56<br>3 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x01561764 xmlXPathNewNodeSet + 116<br>
4 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x01572b14 xmlXPathRunStreamEval + 148<br>5 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x01572f28 xmlXPathRunEval + 248<br>6 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x015737fc xmlXPathCompiledEvalInternal<br>+ 364<br>
7 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x01573950 xmlXPathCompiledEval + 32<br>8 &nbsp; libxml_so.bundle &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x01132c38 ruby_xml_xpath_find + 472<br>9 &nbsp; libxml_so.bundle &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x01132d58 ruby_xml_xpath_find2 + 56<br>10 &nbsp;libxml_so.bundle &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x0112978c ruby_xml_node_find + 96<br>
11 &nbsp;libxml_so.bundle &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x011297b0 ruby_xml_node_find_first + 16<br>12 &nbsp;libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x002254dc call_cfunc + 256<br>13 &nbsp;libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00224b20 rb_call0 + 1168<br>....<br><br>Example 2:<br>
<br>0 &nbsp; libSystem.B.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x90003cf4 szone_malloc + 956<br>1 &nbsp; libSystem.B.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x90003600 malloc + 632<br>2 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x01561728 xmlXPathNewNodeSet + 56<br>3 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x01570b54 xmlXPathCompOpEvalPredicate +<br>
260<br>4 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x015719c4 xmlXPathNodeCollectAndTest +<br>3380<br>5 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0156fa28 xmlXPathCompOpEval + 2072<br>6 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x015703a0 xmlXPathCompOpEval + 4496<br>
7 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x01572fe8 xmlXPathRunEval + 440<br>8 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x015737fc xmlXPathCompiledEvalInternal<br>+ 364<br>9 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x01573950 xmlXPathCompiledEval + 32<br>
10 &nbsp;libxml_so.bundle &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x01132c38 ruby_xml_xpath_find + 472<br>11 &nbsp;libxml_so.bundle &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x01132d58 ruby_xml_xpath_find2 + 56<br>12 &nbsp;libxml_so.bundle &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x0112978c ruby_xml_node_find + 96<br>13 &nbsp;libxml_so.bundle &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x011297b0 ruby_xml_node_find_first + 16<br>
14 &nbsp;libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x002254dc call_cfunc + 256<br>15 &nbsp;libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00224b20 rb_call0 + 1168<br>....<br><br>Example 3:<br><br>0 &nbsp; libSystem.B.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x90003cf4 szone_malloc + 956<br>1 &nbsp; libSystem.B.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x90003600 malloc + 632<br>
2 &nbsp; libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x002379d8 ruby_xmalloc + 136<br>3 &nbsp; libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0021f268 rb_eval + 6780<br>4 &nbsp; libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0021dd44 rb_eval + 1368<br>5 &nbsp; libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00225148 rb_call0 + 2744<br>
6 &nbsp; libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00225b18 rb_call + 600<br>7 &nbsp; libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0021f41c rb_eval + 7216<br>8 &nbsp; libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0021dd44 rb_eval + 1368<br>9 &nbsp; libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0021f220 rb_eval + 6708<br>
10 &nbsp;libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0021f298 rb_eval + 6828<br>11 &nbsp;libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00222c24 rb_yield_0 + 1368<br>12 &nbsp;libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00223070 rb_yield_values + 180<br>13 &nbsp;libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x00215b2c each_with_index_i + 48<br>
....<br><br>Example 4:<br><br>0 &nbsp; libSystem.B.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x90003cf4 szone_malloc + 956<br>1 &nbsp; libSystem.B.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x90003600 malloc + 632<br>2 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0158a918 xmlStrndup + 72<br>3 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x01530fc4 xmlNewPropInternal + 340<br>
4 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x015e2fbc xmlSAX2StartElementNs + 1468<br>5 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0151bbbc xmlParseStartTag2 + 3612<br>6 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x015282cc xmlParseElement + 220<br>7 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x01526ae8 xmlParseContent + 312<br>
8 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x015284d8 xmlParseElement + 744<br>9 &nbsp; libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x01526ae8 xmlParseContent + 312<br>10 &nbsp;libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x015284d8 xmlParseElement + 744<br>11 &nbsp;libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x01526ae8 xmlParseContent + 312<br>
12 &nbsp;libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x015284d8 xmlParseElement + 744<br>13 &nbsp;libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x01526ae8 xmlParseContent + 312<br>14 &nbsp;libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x015284d8 xmlParseElement + 744<br>15 &nbsp;libxml2.2.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x01528c38 xmlParseDocument + 1096<br>
16 &nbsp;libxml_so.bundle &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x0112de60 ruby_xml_parser_parse + 96<br>17 &nbsp;libruby.dylib &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x002254f0 call_cfunc + 276<br>....<br><br>I have a bad feeling about these problems, I don&#39;t see why malloc<br>
would crash.<br><br>Anyone have an idea ? This is on OS X by the way.<br><font color="#888888"><br>--<br>Luc Heinrich<br><br><br>_______________________________________________<br>libxml-devel mailing list<br><a href="mailto:libxml-devel@rubyforge.org">libxml-devel@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/libxml-devel" target="_blank">http://rubyforge.org/mailman/listinfo/libxml-devel</a><br></font></blockquote></div><br></div>