<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 25, 2017 at 4:59 PM, Rock Lee <span dir="ltr"><<a href="mailto:rockdotlee@gmail.com" target="_blank">rockdotlee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, <div><br></div><div>I was using a program to test OOM killer, but OOM killer hung my board. The test snippet is very simple, just malloc() without free().</div><div><br></div><div><div> 6 int i=0;</div><div> 7 char *ptrtest=NULL;</div><div> 8 while (1)</div><div> 9 {</div><div> 10 ptrtest = malloc(0x1000);</div><div> 11 if (ptrtest == NULL)</div><div> 12 printf("malloc failed.\n");</div><div> 13 }</div><div> 14 return 0;</div><div> 15 </div><div><br></div><div>After I executed this program(a.out), there is no reaction of my shell. Only this messege was shown:</div><div><div><br></div><div>[ 180.138188] Out of memory: Kill process 2706 (qq) score 623 or sacrifice child</div><div>[ 180.164230] Killed process 2706 (qq) total-vm:98156kB, anon-rss:96400kB, file-rss:4kB</div></div><div><br></div></div></div></blockquote><div><br></div><div>I think the clue is above. Could you find out what is the process with pid 2706?<br><br></div><div>I bet that is the shell that runs as the parent of your a.out program, but feel free to make sure what that is.<br><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>I think it must be some problem with OOM killer, and tried a lot of way to get some infomation. And I got this:</div><div><br></div><div><div><div>==============================<wbr>=========================</div><div>Process: a.out, cpu: 0 pid: 1463 start: 0xd5849b00</div><div>==============================<wbr>=======================</div><div> Task name: a.out pid: 1463 cpu: 0</div><div> state: 0x2 exit_state: 0x0 stack base: 0xd6190000</div><div> Stack:</div><div> [<c08394e4>] __schedule+0x2c8</div><div> [<c018df88>] squashfs_cache_get+0x108</div><div> [<c0191020>] squashfs_readpage_block+0x28</div><div> [<c018f648>] squashfs_readpage+0x624</div><div> [<c0090d4c>] __do_page_cache_readahead+<wbr>0x228</div><div> [<c00882f4>] filemap_fault+0x1d4</div><div> [<c00a5f10>] __do_fault+0x34</div><div> [<c00a8ab0>] do_read_fault+0x19c</div><div> [<c00a9388>] handle_mm_fault+0x468</div><div> [<c00164b0>] do_page_fault+0x11c</div><div> [<c00084a4>] do_PrefetchAbort+0x34</div><div> [<c0011c1c>] ret_from_exception+0x0</div></div></div><div><br></div><div>I am suprised, because a.out is in /tmp, there is no relation between a.out and squashfs(my rootfs). Could anyone give me a hint ? Is the problem of squashfs or OOM killer. </div><span class="HOEnZb"></span></div></div></blockquote><div><br></div><div>The above stack trace just mention what happened in kernel space. Very likely when it was about to be killled by OOM killer. CMIIW.<br><br></div><div>Thus, it has little or nothing to do with the fact that it called squash fs related function<br></div><div><br clear="all"></div></div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">regards,<br><br>Mulyadi Santosa<br>Freelance Linux trainer and consultant<br><br>blog: <a href="http://the-hydra.blogspot.com" target="_blank">the-hydra.blogspot.com</a><br>training: <a href="http://mulyaditraining.blogspot.com" target="_blank">mulyaditraining.blogspot.com</a></div>
</div></div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top:1px solid #d3d4de">
        <tr>
<td style="width:55px;padding-top:13px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
                <td style="width:470px;padding-top:12px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank" style="color:#4453ea">www.avast.com</a>
                </td>
        </tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>