<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Arial; font-size: 12pt; color: #000000'><span>Greetings folks,<br><br>I have recently seen some fmd crashes, basically fmd running out of memory<br>and shutting down.<br><br>Prompted me to look at the fmd code, and I am wondering if this notification <br>is the way the designer intended it:<br><br></span><pre><a class="l" name="632" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#632">2 </a><b>void</b>
<a class="l" name="633" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#633"> 633 </a><a class="d" name="fmd_module_gc"></a><a href="http://src.opensolaris.org/source/s?refs=fmd_module_gc&project=onnv" class="d">fmd_module_gc</a>(<a href="http://src.opensolaris.org/source/s?defs=fmd_module_t&project=onnv">fmd_module_t</a> *<a href="http://src.opensolaris.org/source/s?defs=mp&project=onnv">mp</a>)
<a class="l" name="634" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#634"> 634 </a>{
<a class="l" name="635" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#635"> 635 </a> <a href="http://src.opensolaris.org/source/s?defs=fmd_hdl_info_t&project=onnv">fmd_hdl_info_t</a> *<a class="d" name="info"></a><a href="http://src.opensolaris.org/source/s?refs=info&project=onnv" class="d">info</a>;
<a class="l" name="636" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#636"> 636 </a> <a href="http://src.opensolaris.org/source/s?defs=fmd_event_t&project=onnv">fmd_event_t</a> *e;
<a class="l" name="637" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#637"> 637 </a>
<a class="l" name="638" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#638"> 638 </a> <b>if</b> (<a href="http://src.opensolaris.org/source/s?defs=mp&project=onnv">mp</a>-><a href="http://src.opensolaris.org/source/s?defs=mod_error&project=onnv">mod_error</a> != <span class="n">0</span>)
<a class="l" name="639" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#639"> 639 </a> <b>return</b>; <span class="c">/* do not do anything if the module has failed */</span>
<a class="hl" name="640" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#640"> 640 </a>
<a class="l" name="641" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#641"> 641 </a> <a class="f" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#fmd_module_lock">fmd_module_lock</a>(<a href="http://src.opensolaris.org/source/s?defs=mp&project=onnv">mp</a>);
<a class="l" name="642" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#642"> 642 </a>
<a class="l" name="643" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#643"> 643 </a> <b>if</b> ((<a class="f" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#info">info</a> = <a href="http://src.opensolaris.org/source/s?defs=mp&project=onnv">mp</a>-><a href="http://src.opensolaris.org/source/s?defs=mod_info&project=onnv">mod_info</a>) != <a href="http://src.opensolaris.org/source/s?defs=NULL&project=onnv">NULL</a>) {
<a class="l" name="644" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#644"> 644 </a> <a href="http://src.opensolaris.org/source/s?defs=fmd_serd_hash_apply&project=onnv">fmd_serd_hash_apply</a>(&<a href="http://src.opensolaris.org/source/s?defs=mp&project=onnv">mp</a>-><a href="http://src.opensolaris.org/source/s?defs=mod_serds&project=onnv">mod_serds</a>,
<a class="l" name="645" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#645"> 645 </a> (<a href="http://src.opensolaris.org/source/s?defs=fmd_serd_eng_f&project=onnv">fmd_serd_eng_f</a> *)<a href="http://src.opensolaris.org/source/s?defs=fmd_serd_eng_gc&project=onnv">fmd_serd_eng_gc</a>, <a href="http://src.opensolaris.org/source/s?defs=NULL&project=onnv">NULL</a>);
<a class="l" name="646" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#646"> 646 </a> }
<a class="l" name="647" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#647"> 647 </a>
<a class="l" name="648" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#648"> 648 </a> <a class="f" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#fmd_module_unlock">fmd_module_unlock</a>(<a href="http://src.opensolaris.org/source/s?defs=mp&project=onnv">mp</a>);
<a class="l" name="649" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#649"> 649 </a><br><br>!!!!!! The question is: what this FMD_EVT_GC supposed to signify?<br>My sense is that this is just to record the fact that the <br>garbage collection was kicked off.<br>If that is the case, it clearly gets called too many times,<br>since fmd_module_gc is a callback function, and<br>it repeatedly gets called from fmd_modhash_apply() in a double <br>loop.<br>!!!!!!<br><br><a class="hl" name="650" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#650"> 650 </a> <b>if</b> (<a class="f" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#info">info</a> != <a href="http://src.opensolaris.org/source/s?defs=NULL&project=onnv">NULL</a>) {
<a class="l" name="651" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#651"> 651 </a> e = <a href="http://src.opensolaris.org/source/s?defs=fmd_event_create&project=onnv">fmd_event_create</a>(<a href="http://src.opensolaris.org/source/s?defs=FMD_EVT_GC&project=onnv">FMD_EVT_GC</a>, <a href="http://src.opensolaris.org/source/s?defs=FMD_HRT_NOW&project=onnv">FMD_HRT_NOW</a>, <a href="http://src.opensolaris.org/source/s?defs=NULL&project=onnv">NULL</a>, <a href="http://src.opensolaris.org/source/s?defs=NULL&project=onnv">NULL</a>);
<a class="l" name="652" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#652"> 652 </a> <a href="http://src.opensolaris.org/source/s?defs=fmd_eventq_insert_at_head&project=onnv">fmd_eventq_insert_at_head</a>(<a href="http://src.opensolaris.org/source/s?defs=mp&project=onnv">mp</a>-><a href="http://src.opensolaris.org/source/s?defs=mod_queue&project=onnv">mod_queue</a>, e);
<a class="l" name="653" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#653"> 653 </a> }
<a class="l" name="654" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#654"> 654 </a>}
<a class="l" name="655" href="http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/fm/fmd/common/fmd_module.c#655"> 655 </a><br></pre><br><span id="82eb4e1e-c3de-47bc-86fc-b660f5386f6d">The stack looks like:<br></span><br>debugging core file of <span class="il">fmd</span> (32-bit) from nrchbs-s1194<br>file: /usr/lib/fm/<span class="il">fmd</span>/<span class="il">fmd</span><br>initial argv: /usr/lib/fm/<span class="il">fmd</span>/<span class="il">fmd</span><br>..<br>status: process terminated by SIGABRT (Abort), pid=533 uid=0 code=-1<br>> ::stack<br>...<br>
fmd_vpanic+0x125(8086f5c, fdb4ee44, fdb4ee48, c)<br>fmd_panic+0x12(8086f5c, c, 3e8, 8070c8c)<br>fmd_alloc+0xc7(c)<br>fmd_eventq_insert_at_head+<div id=":1o1"><wbr>0x2c(8413d88, 907df18, 0, feeb9c76)<br>fmd_module_gc+0x6b(86eb440, 0, 1284885e, feec2c1f)<br>
fmd_modhash_apply+0x3c(<wbr>83f6428, 8075fe4, fdb4ef48, 85fa248)<br>fmd_gc+0x27(809d840)<br>fmd_timerq_exec+0x109(85fa240, 0, 8, fef62440)</div>...<br><br><span id="82eb4e1e-c3de-47bc-86fc-b660f5386f6d">TIA for any comments, should someone have any.<br><br>Steve<br></span><br></div></body></html>