<div dir="ltr"><p style="margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:22.4px;margin-top:0px!important">> <span style="font-size:12.8px;font-family:arial,sans-serif;line-height:normal;color:rgb(34,34,34)">RPi2 is a Cortex-A7, the Chromebooks are Cortex-A15, both should<br></span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;line-height:normal">> handle unaligned access, but they can still be se to crash via flags.</span></p><p style="margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:22.4px;margin-top:0px!important">Thank you for your technical advice about this issue. In order to disable "unaligned access" on ARM core, <br>I have tried to build coreclr (.net core runtime) <span style="line-height:22.4px">with "</span><span style="line-height:22.4px;font-weight:bolder">-mno-unaligned-access</span><span style="line-height:22.4px">" compiler flag + -O3 flag <br></span><span style="line-height:22.4px">with the latest snapshot version of clang/llvm.</span></p><p style="margin-bottom:16px;font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:22.4px;margin-top:0px!important"><font color="#333333">However, I  have still got the same error even though I tried to build coreCLR </font><br><font color="#333333">with "</font><span style="color:rgb(51,51,51);font-weight:bolder">-mno-unaligned-access</span><font color="#333333">" compiler flag.  So, I am going to modify JIT compiler of the coreCLR runtime</font><br><font color="#333333">to resolve this issue (e.g., Bus Error , Unaligned Access on ARM core) in case of the compilation of the coreclr </font><br><font color="#333333">with -O2/-O3 optimization levels. </font><br><br><font color="#333333">* </font><span style="line-height:22.4px"><font color="#333333">reference:<br></font></span><a href="http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130819/086848.html" style="color:rgb(64,120,192);text-decoration:none;line-height:22.4px">http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130819/086848.html</a></p><a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0203g/Chdbiafd.html" style="color:rgb(64,120,192);text-decoration:none;font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:22.4px">http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0203g/Chdbiafd.html</a><br style="color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:22.4px"><a href="https://developer.arm.com/docs/dui0774/latest/compiler-command-line-options/-munaligned-access-mno-unaligned-access" style="color:rgb(64,120,192);text-decoration:none;font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:22.4px">https://developer.arm.com/docs/dui0774/latest/compiler-command-line-options/-munaligned-access-mno-unaligned-access</a><p style="margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:22.4px;margin-top:0px!important"><br></p><p style="margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:22.4px;margin-top:0px!important"><br></p><p style="margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:22.4px;margin-top:0px!important">BRs,<br>Geunsik Lim. </p><ul style="padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:14px;line-height:22.4px"><li style="margin-left:0px"><p style="margin-top:0px;margin-bottom:16px">reference:<br style=""><a href="http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130819/086848.html" style="color:rgb(64,120,192);text-decoration:none;background-color:transparent">http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130819/086848.html</a><br style=""><a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0203g/Chdbiafd.html" style="color:rgb(64,120,192);text-decoration:none;background-color:transparent">http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0203g/Chdbiafd.html</a><br style=""><a href="https://developer.arm.com/docs/dui0774/latest/compiler-command-line-options/-munaligned-access-mno-unaligned-access" style="color:rgb(64,120,192);text-decoration:none;background-color:transparent">https://developer.arm.com/docs/dui0774/latest/compiler-command-line-options/-munaligned-access-mno-unaligned-access</a></p></li></ul></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 7, 2016 at 5:39 PM, Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 7 July 2016 at 08:26, Geunsik Lim <<a href="mailto:leemgs@gmail.com">leemgs@gmail.com</a>> wrote:<br>
> Recently, I have got a strange phenomenon about this issue between real<br>
> target device and our own linux/arm emulator.<br>
><br>
> We cannot execute some unit tests on real target device (e.g., raspberry Pi2<br>
> board , ARM Chromebook )<br>
><br>
</span><span class="">> Bus error<br>
><br>
> Below is kernel log messages in case of the real target device.<br>
> [91909.525677] Alignment trap: not handling instruction ed940b00 at<br>
> [<b21db3d2>]<br>
> [91909.525747] Unhandled fault: alignment exception (0x011) at 0xb1f7e3e3<br>
<br>
</span>Hi Geunsik Lim,<br>
<br>
I'm not sure which emulator is this, but it's clear that it doesn't<br>
care much for unaligned access, whereas your hardware does.<br>
<br>
RPi2 is a Cortex-A7, the Chromebooks are Cortex-A15, both should<br>
handle unaligned access, but they can still be se to crash via flags.<br>
<br>
I can't see where in the function it breaks because your disassembly<br>
dump didn't have the area where the PC was, but that being in<br>
getI8LittleEndian, I'm assuming you're just iterating byte by byte.<br>
<br>
An alternative to finding the bug in the board setting, would be to<br>
*always* read a whole word (4 bytes) and re-order later, ie. instead<br>
of reading as char*, read as int* or something.<br>
<br>
Bottom line is, never trust your emulator. ;)<br>
<br>
cheers,<br>
--renato<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><a href="http://leemgs.fedorapeople.org" style="font-family:Tahoma" target="_blank">http://leemgs.fedorapeople.org</a><span style="font-family:Tahoma"> </span></div><div>Don't try to avoid pain if you fail.<br>If you decided to face the challenges in life, <br>you can gain a lot by giving your best.<br>Cheolsang Jeong's Book & life<br>--<br></div></div></div>
</div>