[Mono-dev] Error handling longs on Mono SPARC

pablosantosluac at terra.es pablosantosluac at terra.es
Mon Oct 26 08:11:17 EDT 2009

Hi there,

This is our configuration:

-bash-3.00$ uname -a
SunOS atenea 5.11 snv_34 sun4u sparc SUNW,Sun-Blade-1000

-bash-3.00$ mono --version
Mono JIT compiler version 20091021 (tarball Wed Oct 21 19:04:28 CEST 2009)
Copyright (C) 2002-2009 Novell, Inc and Contributors. www.mono-project.com
        TLS:           normal
        GC:            Included Boehm (with typed GC and Parallel Mark)
        SIGSEGV:       normal
        Notification:  Thread + polling
        Architecture:  sparc
        Disabled:      none

We're using a Mono 2.6 compiled at our test box.

We've a code like this:

long dstBrId = GetBranchNumber(brId);

log.DebugFormat("Branch {0} -> {1}", brId, dstBrId);

Calling this method:

        private long GetBranchNumber(long brId)
            Branch br = (Branch) mFetchBranches[brId];

            if( br != null )
                return br.ObjId;

            log.DebugFormat("GetBranchNumber returning {0}", brId);

            return brId;

And that's the log it is showing:

 - GetBranchNumber returning 4
 - Branch 4 -> 17179869188

It looks like, for some reason, this 4 is "magically" becoming a

17179869188 is -> 400000004 in hex!!!!

And, it *gets fixed by building disabling the "optimize" mode*

Of course, a test app like this:

using System;

class Hello
    public static void Main()
        Hello t = new Hello();
        long myval = 4;
        long longVal = t.GetValue(myval);

    private long GetValue(long v)
        return v;


Does not fail.

Any idea?



More information about the Mono-devel-list mailing list