[Mono-dev] Weird bug in new port
Zoltan Varga
vargaz at gmail.com
Wed Jul 19 11:40:07 EDT 2006
Hi,
If you are working on a new port, the best way to do it is to start
with the JIT
regression tests first, since they are mostly small self-contained
tests allowing
you to diagnose problems easier. Other than that, this problem looks like a
problem with boxing+unboxing as I mentioned earlier.
Zoltan
On 7/19/06, Bill Seurer <seurer at us.ibm.com> wrote:
> Now that I have trace working I looked at this further...
>
> ENTER: MainClass:xyzzy (object) [method=0x200317cc](1 parms: p#1: object
> 0x30639fe0[INT32 61438], )
> . ENTER: System.Int32:ToString () [method=0x2020a67c](this=0x30639fe00)
> ...
> . . ENTER: NumberStore:.ctor (int) [method=0x2020b62c](this=0x2ff223d8, 1
> parms: p#1: i4: 537062984 (0x2002ee48))
> ...
> . LEAVE: System.Int32:ToString (), returns string[STRING:3063fc80:'
> 537062984']
> LEAVE: MainClass:xyzzy (object), returns string[STRING:3063fc80:'537062984
> ']
>
> So it looks like the call to the NumberStore constructor is getting a bad
> value passed in (the actual number in this case was 0xEFFE). Maybe
> something to do with the virtual call that is done to ToString for the
> object? If I use an actual integer on ToString or cast the object to an
> integer then it works OK:
>
> . . ENTER: NumberStore:.ctor (int) [method=0x2020b62c](this=0x2ff223d81
> parms: p#1: i4: 61438 (0xeffe)) ip: 3061c978
> --
> Bill Seurer IBM System i5 internal compiler development Rochester, MN
> Business: seurer at us.ibm.com Home: Bill at seurer.net
> http://w3.rchland.ibm.com/~seurer/ http://www.seurer.net
>
>
> "Zoltan Varga" <vargaz at gmail.com> wrote on 07/15/2006 04:14:17 AM:
>
> > Hi,
> >
> > It might be a problem with the 'unbox trampolines' which handle
> > virtual calls to valuetypes.
> > Maybe such a trampoline is not created by mono_magic_trampoline ()
> > when it should.
> >
> > Zoltan
> >
> > On 7/15/06, Bill Seurer <seurer at us.ibm.com> wrote:
> > >
> > > We're seeing a weird bug in the port (of Mono 1.1.15) we are working on
> for
> > > PASE on i5/OS (i.e., AIX).
> > >
> > > Here's a good example. If I run this C# program (a small extract from
> > > something else):
> > >
> > > class MainClass
> > > {
> > > public static void Main(string[] args)
> > > {
> > > int i;
> > > object o;
> > > string s1;
> > >
> > > i = 12345678; // 0x00bc614e
> > > o = (object)i;
> > > s1 = o.ToString();
> > > System.Console.WriteLine(s1);
> > > }
> > > }
> > >
> > > I get something like this output:
> > >
> > > 537061256
> > >
> > > which is 0x2002E788 in hex and probably a pointer to something that
> Mono
> > > created internally (it's in the right range for memory that Mono is
> > > allocating from).
> > >
> > > Everything looks good up to the call to ToString and ToString returns a
> > > string that actually has the characters "537061256" in it. So it looks
> > > like ToString or something it calls is the culprit. Does this look
> like
> > > anything someone else may have run into?
> > >
> > > I'm going to try to trace at a machine instruction level through
> ToString
> > > as it executes but that gets tricky with multiple function calls
> through
> > > pointers that Mono makes.
> > > --
> > > Bill Seurer IBM System i5 internal compiler development
> Rochester, MN
> > > Business: seurer at us.ibm.com Home:
> Bill at seurer.net
> > > http://w3.rchland.ibm.com/~seurer/
> http://www.seurer.net
> > >
> > > _______________________________________________
> > > Mono-devel-list mailing list
> > > Mono-devel-list at lists.ximian.com
> > > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> > >
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
More information about the Mono-devel-list
mailing list