Error handling longs on Mono SPARC

8 messages Options
Embed this post
Permalink
pablosantosluac@terra.es

Error handling longs on Mono SPARC

Reply Threaded More More options
Print post
Permalink
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
[hidden email]
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Zoltan Varga

Re: Error handling longs on Mono SPARC

Reply Threaded More More options
Print post
Permalink
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, [hidden email] <[hidden email]> 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
[hidden email]
http://lists.ximian.com/mailman/listinfo/mono-devel-list


_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/mono-devel-list
pablosantosluac@terra.es

Re: Error handling longs on Mono SPARC

Reply Threaded More More options
Print post
Permalink
Hi Zoltan,

It's the daily tarball (the date is in the version string) which I
believe is svn trunk.


pablo

Zoltan Varga wrote:

> 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, [hidden email]
> <mailto:[hidden email]> <[hidden email]
> <mailto:[hidden email]>> 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 <http://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
>     [hidden email]
>     <mailto:[hidden email]>
>     http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/mono-devel-list
pablosantosluac@terra.es

Re: Error handling longs on Mono SPARC

Reply Threaded More More options
Print post
Permalink
Hi Zoltan,

Should we file a bug on bugzilla?


pablo

[hidden email] wrote:

> Hi Zoltan,
>
> It's the daily tarball (the date is in the version string) which I
> believe is svn trunk.
>
>
> pablo
>
> Zoltan Varga wrote:
>> 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, [hidden email]
>> <mailto:[hidden email]> <[hidden email]
>> <mailto:[hidden email]>> 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 <http://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
>>     [hidden email]
>>     <mailto:[hidden email]>
>>     http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>>
> _______________________________________________
> Mono-devel-list mailing list
> [hidden email]
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Zoltan Varga

Re: Error handling longs on Mono SPARC

Reply Threaded More More options
Print post
Permalink
Hi,

  A small testcase would be very useful, it can usually be generated by taking the code
which exhibits the problem, and removing stuff from it. Also, does it happen with 2.4
too ?

                        Zoltan

On Tue, Oct 27, 2009 at 4:54 PM, [hidden email] <[hidden email]> wrote:
Hi Zoltan,

Should we file a bug on bugzilla?


pablo

[hidden email] wrote:
> Hi Zoltan,
>
> It's the daily tarball (the date is in the version string) which I
> believe is svn trunk.
>
>
> pablo
>
> Zoltan Varga wrote:
>> 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, [hidden email]
>> <mailto:[hidden email]> <[hidden email]
>> <mailto:[hidden email]>> 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 <http://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
>>     [hidden email]
>>     <mailto:[hidden email]>
>>     http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>>
> _______________________________________________
> Mono-devel-list mailing list
> [hidden email]


_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/mono-devel-list
pablosantosluac@terra.es

Re: Error handling longs on Mono SPARC

Reply Threaded More More options
Print post
Permalink


>   A small testcase would be very useful, it can usually be generated by
> taking the code
> which exhibits the problem, and removing stuff from it. Also, does it
> happen with 2.4
> too ?

Not sure we'll be able to reproduce it outside the real code. It's a big
process, in case this has something to do with it.
_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/mono-devel-list
Zoltan Varga

Re: Error handling longs on Mono SPARC

Reply Threaded More More options
Print post
Permalink
Hi,

  If you can't create a test case, could you run your app with
MONO_VERBOSE_METHOD=<caller method>
then with
MONO_VERBOSE_METHOD=<called method>

and send me the output ?

What does ' *gets fixed by building disabling the "optimize" mode*' means, is this a flag
for the c# compiler ?

                     Zoltan

On Tue, Oct 27, 2009 at 8:21 PM, [hidden email] <[hidden email]> wrote:


>   A small testcase would be very useful, it can usually be generated by
> taking the code
> which exhibits the problem, and removing stuff from it. Also, does it
> happen with 2.4
> too ?

Not sure we'll be able to reproduce it outside the real code. It's a big
process, in case this has something to do with it.


_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/mono-devel-list
pablosantosluac@terra.es

Re: Error handling longs on Mono SPARC

Reply Threaded More More options
Print post
Permalink
Hi Zoltan,

>   If you can't create a test case, could you run your app with
> MONO_VERBOSE_METHOD=<caller method>
> then with
> MONO_VERBOSE_METHOD=<called method>
>
> and send me the output ?

Sure, I'll do.

> What does ' *gets fixed by building disabling the "optimize" mode*'
> means, is this a flag
> for the c# compiler ?

Yep. I'm building with nant, I'm enabling or disabling the optimize
flag. It's the same as gmcs --optimize I think.

Also, the code's been built on .NET, but I don't think it will make a
difference.

Will try and come back to you.
_______________________________________________
Mono-devel-list mailing list
[hidden email]
http://lists.ximian.com/mailman/listinfo/mono-devel-list