Fw: [Mono-dev] [PATCH]: Fix lexical block reading when UNALIGNED or big-endian

Zoltan Varga vargaz at gmail.com
Tue Mar 28 05:52:31 EST 2006


Hi,

 This issue is tracked in

http://bugzilla.ximian.com/show_bug.cgi?id=75056

which somehow got closed despite the fact that the problems are still there.

                Zoltan

On 3/28/06, David S. Miller <davem at davemloft.net> wrote:
>
> Ping? :-)
>
>
>
> ---------- Forwarded message ----------
> From: "David S. Miller" <davem at davemloft.net>
> To: mono-devel-list at lists.ximian.com
> Date: Sat, 25 Mar 2006 20:08:20 -0800 (PST)
> Subject: [Mono-dev] [PATCH]: Fix lexical block reading when UNALIGNED or big-endian
>
> minfo->lexical_blocks is a raw pointer into the symbol table metadata
> information of a *.dll file.  Therefore it may be aligned arbitrarily,
> and it's in little-endian format.
>
> Therefore the entry members must be accessed using the read*()
> interfaces.
>
> I guess "--debug" is untested on both UNALIGNED and big-endian
> platforms, because any attempt fails immediately with a SIGBUS
> or reading corrupt lexical block information due to this bug.
>
> I bet with some clever C type games, we could prevent direct
> dereferences of these values that must be accessed via the read*()
> interfaces.
>
> BTW, is there any chance to parallelize the bootstrap build of the CLI
> when building the mono tree?  31 of my Niagara cpus sit idle while
> these 120MB mono processes linearly build the code.  :) If anything,
> it should be possible to parallelize the NET_1_1 and NET_2_0 passes.
>
> I think the test case run should be parallelizable too.
>
> Thanks!
>
> 2006-03-26  David S. Miller  <davem at sunset.davemloft.net>
>
>         * mono-debug.c (mono_debug_add_method): Access minfo->lexical_blocks[]
>         entry elements using read32().
>
> --- mono/metadata/mono-debug.c.~1~      2006-02-02 02:38:34.000000000 -0800
> +++ mono/metadata/mono-debug.c  2006-03-26 03:54:52.000000000 -0800
> @@ -505,10 +505,10 @@
>         for (i = 0; i < jit->num_lexical_blocks; i ++) {
>                 MonoDebugLexicalBlockEntry *jit_lbe = &jit->lexical_blocks [i];
>                 MonoSymbolFileLexicalBlockEntry *minfo_lbe = &minfo->lexical_blocks [i];
> -               jit_lbe->il_start_offset = minfo_lbe->_start_offset;
> +               jit_lbe->il_start_offset = read32(&(minfo_lbe->_start_offset));
>                 jit_lbe->native_start_offset = _mono_debug_address_from_il_offset (jit, jit_lbe->il_start_offset);
>
> -               jit_lbe->il_end_offset = minfo_lbe->_end_offset;
> +               jit_lbe->il_end_offset = read32(&(minfo_lbe->_end_offset));
>                 jit_lbe->native_end_offset = _mono_debug_address_from_il_offset (jit, jit_lbe->il_end_offset);
>         }
>
> _______________________________________________
> 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