[Mono-list] Mono under XScale-IXP43

ADC Developer myrightangle at yahoo.com
Tue Feb 19 03:07:31 UTC 2013


Per the instructions, I posted this question on stack overflow first. No one
seems to able to help. I am posting here on the chance that I get some help.
I am receiving an Unknown exception when running a mono program that prints
a (long) value under an XScale processor (8410 box from www.moxa.com). 

I used the xscale-linux-gcc compiler supplied with the hardware and the
run-time seems to be installed and running correctly. A hello world and
serial program we use to identify what ports are available on the system
execute fine. The problem manifests when the System.DateTime initializer is
called in our main program. I've identified the problem with this line of
code from corlib/System/DateTime.cs:

public static readonly DateTime MaxValue = new DateTime
(3155378975999999999);

The following program causes a crash to demonstrate the issue:

 using System;
 class longtest 
 {
    static void Main()
    {
         long l1 = 3155378975999999999L;
         printLong(l1);
    }

    static void printLong(long value)
    {
        Console.WriteLine(value);
    }
 }

It generates the following exception:

Unhandled Exception: System.NullReferenceException: Object reference
not set to an instance of an object   at
System.NumberFormatter.FastToDecHex (Int32 val) [0x00000] in <filename
unknown>:0    at System.NumberFormatter.ToDecHex (Int32 val) [0x00000]
in <filename unknown>:0    at System.NumberFormatter.InitDecHexDigits
(UInt64 value) [0x00000] in <filename unknown>:0    at
System.NumberFormatter.Init (System.String format, Int64 value)
[0x00000] in <filename unknown>:0    at
System.NumberFormatter.NumberToString (System.String format, Int64
value, IFormatProvider fp) [0x00000] in <filename unknown>:0    at
System.NumberFormatter.NumberToString (Int64 value, IFormatProvider
fp) [0x00000] in <filename unknown>:0    at System.Int64.ToString
(IFormatProvider provider) [0x00000] in <filename unknown>:0    at
System.IO.TextWriter.Write (Int64 value) [0x00000] in <filename
unknown>:0    at System.IO.TextWriter.WriteLine (Int64 value)
[0x00000] in <filename unknown>:0    at
System.IO.SynchronizedWriter.WriteLine (Int64 value) [0x00000] in
<filename unknown>:0    at System.Console.WriteLine (Int64 value)
[0x00000] in <filename unknown>:0    at longtest.printLong (Int64
value) [0x00000] in <filename unknown>:0    at longtest.Main ()
[0x00000] in <filename unknown>:0

If I reduce l1 by 1 digit it runs fine. The program displays the correct
value on our embedded AM586 hardware platform.

The class libraries where built on an X86 box. I built the XScale mono
binaries using the xscale-linux-gcc cross-compiler.:

./configure --prefix=/usr/local/mono CFLAGS=-DARM_FPU_VFP
--target=arm-linux --enable-small-config --enable-nls=no --with-xen-opt=no
--with-  
moonlight=no --enable-minimal=aot,profiler,full_messages,large_code
--with-profile4=no --  
with-ikvm-native=no --with-tls=pthread --with-sigaltstack=no 
--disable-mcs-build --  
cache- file=xscale.cache --host=xscale-linux

The mono -V output on the IXP43 hardware:

Mono JIT compiler version 2.8.2 (tarball Mon Feb 11 10:44:39 EST 2013)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
TLS:           normal
SIGSEGV:       normal
Notification:  Thread + polling
Architecture:  arm,fpa
Disabled:      aot,profiler,full_messages,large_code
Misc:          smallconfig softdebug 
LLVM:          supported, not enabled.
GC:            Included Boehm (with typed GC and Parallel Mark)

This seems to be a problem with the way I've built the mono run-time. I've
tried using ARM_FPU_VFP in the build configuration but it didn't make a
difference. At this point I'm really confused. Any suggestions would be
appreciative.

Thank you.



--
View this message in context: http://mono.1490590.n4.nabble.com/Mono-under-XScale-IXP43-tp4658629.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list