Linux/ARM: Bus error with -O3 flag of clang/llvm-3.6 while running unit-test of .NET Core

Geunsik Lim via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 9 07:21:40 PDT 2016


> RPi2 is a Cortex-A7, the Chromebooks are Cortex-A15, both should
> handle unaligned access, but they can still be se to crash via flags.

BTW, What does "they can still be se to crash via flags." statement mean?

On Thu, Jul 7, 2016 at 5:49 PM, Geunsik Lim <leemgs at gmail.com> wrote:

> > RPi2 is a Cortex-A7, the Chromebooks are Cortex-A15, both should
> > handle unaligned access, but they can still be se to crash via flags.
>
> Thank you for your technical advice about this issue. In order to disable
> "unaligned access" on ARM core,
> I have tried to build coreclr (.net core runtime) with "
> -mno-unaligned-access" compiler flag + -O3 flag
> with the latest snapshot version of clang/llvm.
>
> However, I  have still got the same error even though I tried to build
> coreCLR
> with "-mno-unaligned-access" compiler flag.  So, I am going to modify JIT
> compiler of the coreCLR runtime
> to resolve this issue (e.g., Bus Error , Unaligned Access on ARM core) in
> case of the compilation of the coreclr
> with -O2/-O3 optimization levels.
>
> * reference:
>
> http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130819/086848.html
>
> http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0203g/Chdbiafd.html
>
> https://developer.arm.com/docs/dui0774/latest/compiler-command-line-options/-munaligned-access-mno-unaligned-access
>
>
>
> BRs,
> Geunsik Lim.
>
>    -
>
>    reference:
>
>    http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130819/086848.html
>
>    http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0203g/Chdbiafd.html
>
>    https://developer.arm.com/docs/dui0774/latest/compiler-command-line-options/-munaligned-access-mno-unaligned-access
>
>
> On Thu, Jul 7, 2016 at 5:39 PM, Renato Golin <renato.golin at linaro.org>
> wrote:
>
>> On 7 July 2016 at 08:26, Geunsik Lim <leemgs at gmail.com> wrote:
>> > Recently, I have got a strange phenomenon about this issue between real
>> > target device and our own linux/arm emulator.
>> >
>> > We cannot execute some unit tests on real target device (e.g.,
>> raspberry Pi2
>> > board , ARM Chromebook )
>> >
>> > Bus error
>> >
>> > Below is kernel log messages in case of the real target device.
>> > [91909.525677] Alignment trap: not handling instruction ed940b00 at
>> > [<b21db3d2>]
>> > [91909.525747] Unhandled fault: alignment exception (0x011) at
>> 0xb1f7e3e3
>>
>> Hi Geunsik Lim,
>>
>> I'm not sure which emulator is this, but it's clear that it doesn't
>> care much for unaligned access, whereas your hardware does.
>>
>> RPi2 is a Cortex-A7, the Chromebooks are Cortex-A15, both should
>> handle unaligned access, but they can still be se to crash via flags.
>>
>> I can't see where in the function it breaks because your disassembly
>> dump didn't have the area where the PC was, but that being in
>> getI8LittleEndian, I'm assuming you're just iterating byte by byte.
>>
>> An alternative to finding the bug in the board setting, would be to
>> *always* read a whole word (4 bytes) and re-order later, ie. instead
>> of reading as char*, read as int* or something.
>>
>> Bottom line is, never trust your emulator. ;)
>>
>> cheers,
>> --renato
>>
>
>
>
> --
> http://leemgs.fedorapeople.org
> Don't try to avoid pain if you fail.
> If you decided to face the challenges in life,
> you can gain a lot by giving your best.
> Cheolsang Jeong's Book & life
> --
>



-- 
http://leemgs.fedorapeople.org
Don't try to avoid pain if you fail.
If you decided to face the challenges in life,
you can gain a lot by giving your best.
Cheolsang Jeong's Book & life
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160709/6222a3b9/attachment.html>


More information about the llvm-commits mailing list