[Mono-dev] Failed assertion on ARM11 after compiling with -DARM_FPU_VFP

Brian Luczkiewicz brian at sooloos.com
Wed Jul 6 16:32:40 EDT 2011


It's hard to know if I've run into this specific problem or not from your
description, but I have experience with the pitfalls of building mono for
multi-core arm chips. Some things to try:

- Try starting with -O0 and adding your flags back in one by one. I've seen
evidence of buggy GCC code generation for ARM that manifests in
unpredictable stack corruption and crashes like yours. For my situation
(mono 2.10.2 + codesourcery gcc 2009q1), -O is stable, but -O2 is not.

- Since you're dual-core, make extra-special-sure that mono is using MP-safe
atomic ops--I know that it does on armv7, but unsure about armv6k. If you
configure/build for armv5te, it does not, and you end up with binaries that
do bad things on MP ARM systems but work fine on UP systems.

In case a comparison is useful, my arch/opt flags are:

-march=armv7-a -mcpu=cortex-a8 -mfloat-abi=softfp -mfpu=neon -O -ffast-math

and I am using -DARM_FPU_VFP. The CPU is an APQ8060.

I never tried with ARM_FPU_NONE, but I could totally see gcc optimizer bugs
being hidden by avoiding certain hard fp code generation.




On Sat, Jun 25, 2011 at 9:15 PM, Bill Agee <billagee at gmail.com> wrote:

> Hi all,
>
> I'm seeing an odd mono crash after cross compiling mono for a Cavium Econa
> CNS3420 (a dual-core ARM11).
>
> I'm using the mono-2.10.2 tarball.
>
> The CNS3420 appears to support VFP, but when I compile Mono with these
> CFLAGS:
>
>  CFLAGS="-DARM_FPU_VFP -O3 -march=armv6k -mcpu=mpcore -mfloat-abi=softfp
> -mfpu=vfp"
>
> ...I frequently see a crash in mono when running on my target machine.
>
> The .NET stacktrace varies, but the native stacktrace and error is always
> this failed assertion:
>
> ====
> wrong maximal instruction length of instruction r4const (expected 20, got
> 24)
> * Assertion: should not be reached at mini-arm.c:4658
>
> Native stacktrace:
>
>        mono() [0xa6928]
>        /lib/libc.so.6(__default_rt_sa_restorer_v2+0) [0x3575d660]
>        /lib/libc.so.6(gsignal+0x40) [0x3575c2fc]
>        /lib/libc.so.6(abort+0x1b0) [0x35761b14]
>        mono() [0x1ed810]
>        mono() [0x1ed854]
>        mono() [0xd8e10]
>        mono() [0x1c494]
>        mono() [0x2166c]
>        mono() [0x22b74]
>        mono() [0x2342c]
>        mono(mono_compile_method+0x18) [0x1a4560]
>        mono() [0xaab50]
>        mono() [0xab6c4]
>
>
> Aborted
> ====
>
> The problem goes away if I compile with -DARM_FPU_NONE instead of
> -DARM_FPU_VFP:
>
>  CFLAGS="-DARM_FPU_NONE -O3 -march=armv6k -mcpu=mpcore -mfloat-abi=softfp
> -mfpu=vfp"
>
>
> Does anyone have any idea what the issue might be?
>
> Here's the full build command from my makefile:
>
>
>
> CC=/usr/local/cavium/cns3xxx-sdk/tools/glibc64k/bin/arm-none-linux-gnueabi-gcc
> \
>
>
> CXX=/usr/local/cavium/cns3xxx-sdk/tools/glibc64k/bin/arm-none-linux-gnueabi-g++
> \
>          CFLAGS="-DARM_FPU_VFP -O3 -march=armv6k -mcpu=mpcore
> -mfloat-abi=softfp -mfpu=vfp" \
>          ./configure \
>          --prefix=/foo \
>          --disable-mcs-build \
>          --with-profile4=no \
>          --with-moonlight=no \
>          --host=arm-none-linux-gnueabi \
>          --with-tls=pthread \
>          --with-sigaltstack=no \
>          mono_cv_uscore=${mono_cv_uscore=no} && \
>        make
>
>
> Thanks in advance for any hints/pointers!
>
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/Failed-assertion-on-ARM11-after-compiling-with-DARM-FPU-VFP-tp3625317p3625317.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110706/6660e154/attachment-0001.html 


More information about the Mono-devel-list mailing list