[Mono-dev] Error handling longs on Mono SPARC

Zoltan Varga vargaz at gmail.com
Mon Oct 26 08:22:07 EDT 2009


Hi,

  Is this the 2.6 prerelease, or using the code from the mono-2-6 branch ?
The latter has
some sparc fixes.

                             Zoltan

On Mon, Oct 26, 2009 at 1:11 PM, pablosantosluac at terra.es <
pablosantosluac at terra.es> wrote:

> 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!!!!!!
>
> 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);
>        Console.WriteLine(longVal);
>    }
>
>    private long GetValue(long v)
>    {
>        return v;
>    }
>
> }
>
> Does not fail.
>
>
> Any idea?
>
>
> Thanks,
>
>
> pablo
> _______________________________________________
> 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/20091026/7a5946f3/attachment.html 


More information about the Mono-devel-list mailing list