<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 25, 2017 at 7:29 PM, Yubin Ruan <span dir="ltr"><<a href="mailto:ablacktshirt@gmail.com" target="_blank">ablacktshirt@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">2017-07-25 17:59 GMT+08:00 Rock Lee <<a href="mailto:rockdotlee@gmail.com">rockdotlee@gmail.com</a>>:<br>
> Hi,<br>
><br>
> I was using a program to test OOM killer, but OOM killer hung my board. The<br>
> test snippet is very simple, just malloc() without free().<br>
><br>
> 6 int i=0;<br>
> 7 char *ptrtest=NULL;<br>
> 8 while (1)<br>
> 9 {<br>
> 10 ptrtest = malloc(0x1000);<br>
> 11 if (ptrtest == NULL)<br>
> 12 printf("malloc failed.\n");<br>
> 13 }<br>
> 14 return 0;<br>
> 15<br>
><br>
> After I executed this program(a.out), there is no reaction of my shell. Only<br>
> this messege was shown:<br>
><br>
> [ 180.138188] Out of memory: Kill process 2706 (qq) score 623 or sacrifice<br>
> child<br>
> [ 180.164230] Killed process 2706 (qq) total-vm:98156kB, anon-rss:96400kB,<br>
> file-rss:4kB<br>
><br>
> I think it must be some problem with OOM killer, and tried a lot of way to<br>
> get some infomation. And I got this:<br>
><br>
> ==============================<wbr>=========================<br>
> Process: a.out, cpu: 0 pid: 1463 start: 0xd5849b00<br>
> ==============================<wbr>=======================<br>
> Task name: a.out pid: 1463 cpu: 0<br>
> state: 0x2 exit_state: 0x0 stack base: 0xd6190000<br>
> Stack:<br>
> [<c08394e4>] __schedule+0x2c8<br>
> [<c018df88>] squashfs_cache_get+0x108<br>
> [<c0191020>] squashfs_readpage_block+0x28<br>
> [<c018f648>] squashfs_readpage+0x624<br>
> [<c0090d4c>] __do_page_cache_readahead+<wbr>0x228<br>
> [<c00882f4>] filemap_fault+0x1d4<br>
> [<c00a5f10>] __do_fault+0x34<br>
> [<c00a8ab0>] do_read_fault+0x19c<br>
> [<c00a9388>] handle_mm_fault+0x468<br>
> [<c00164b0>] do_page_fault+0x11c<br>
> [<c00084a4>] do_PrefetchAbort+0x34<br>
> [<c0011c1c>] ret_from_exception+0x0<br>
><br>
> I am suprised, because a.out is in /tmp, there is no relation between a.out<br>
> and squashfs(my rootfs). Could anyone give me a hint ? Is the problem of<br>
> squashfs or OOM killer.<br>
<br>
</div></div>You say your rootfs is squashfs filesystem. Is /tmp using the same<br>
device and same filesystem (i.e., squashfs) ?</blockquote><div><br></div><div><span style="font-size:12.8px">Not exactly, /tmp uses tmpfs, but my rootfs uses squashfs. </span> </div></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cheers,<br>Rock</div>
</div></div>