[Mono-list] Problem with mono_arch_local_regalloc( ) on PPC
Piyush Garyali
Piyush Garyali" <piyush_garyali@rediffmail.com
14 Nov 2003 17:22:54 -0000
This is a multipart mime message
--Next_1068830574---0-203.199.83.39-3969
Content-type: text/html;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<P>=0AHello,<BR>=0A<BR>=0ASorry for the last mail. It got all screwed by as=
my internet mailer was adding HTML tags.<BR>=0A<BR>=0AComing back to the p=
oint, I was looking at the runtime invoke code generated for Assembly.DoAss=
emblyLoad(). (which comes from mono_domain_fire_assembly_load). Now while t=
he code is being compiled using mono_method_compile-->mono_codegen()--&g=
t;mono_arch_local_regalloc() I found that the follwing instructions were lo=
oked up in the **ppcg4 array.<BR>=0A<BR>=0A372: load_membase<BR>=0A312: com=
pare_imm<BR>=0A59 : beq<BR>=0A..<BR>=0A..<BR>=0A..<BR>=0A56 : br<BR>=0A551:=
start_handler<BR>=0A ^^^^^^^^^^^^^<BR>=0A<BR>=0ANow in the &=
quot;cpu-g4.h" the value assigned to "start_handler" is &quo=
t;NULL" which makes the code inside the mono_arch_local_regalloc ..<BR=
>=0A<BR>=0Awhile(ins) {<BR>=0A spec =3D ins_spec[ins->opcode];<BR=
>=0A ..<BR>=0A if (spec[MONO_INST_SRC1]) {<BR>=0A ..<B=
R>=0A}<BR>=0A<BR>=0A.. to crash as spec becomes NULL and the if block tried=
to access a NULL pointer. After hacking the code to work around this excep=
tion, I later found the when the emitted code is run through mono_ldftn() t=
he MonoMethod *method is corrupted and it crashes again.<BR>=0A<BR>=0AIs th=
ere still some problem with the ppc emitter or I am missing something in he=
re.<BR>=0A<BR>=0Aany pointers would be appreciated.<BR>=0A<BR>=0Aregards,<B=
R>=0Agary<BR>=0A =0A</P>=0A<br><br>=0A<A target=3D"_blank" HREF=3D"http://c=
lients.rediff.com/signature/track_sig.asp"><IMG SRC=3D"http://ads.rediff.co=
m/RealMedia/ads/adstream_nx.cgi/www.rediffmail.com/inbox.htm@Bottom" BORDER=
=3D0 VSPACE=3D0 HSPACE=3D0 HEIGHT=3D74 WIDTH=3D496></a>=0A
--Next_1068830574---0-203.199.83.39-3969
Content-type: text/plain;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hello,=0A=0ASorry for the last mail. It got all screwed by as my internet m=
ailer was adding HTML tags.=0A=0AComing back to the point, I was looking at=
the runtime invoke code generated for Assembly.DoAssemblyLoad(). (which co=
mes from mono_domain_fire_assembly_load). Now while the code is being compi=
led using mono_method_compile-->mono_codegen()-->mono_arch_local_regalloc()=
I found that the follwing instructions were looked up in the **ppcg4 array=
.=0A=0A372: load_membase=0A312: compare_imm=0A59 : beq=0A..=0A..=0A..=0A56 =
: br=0A551: start_handler=0A ^^^^^^^^^^^^^=0A=0ANow in the "cpu-g4.h" t=
he value assigned to "start_handler" is "NULL" which makes the code inside =
the mono_arch_local_regalloc ..=0A=0Awhile(ins) {=0A spec =3D ins_spec[in=
s->opcode];=0A ..=0A if (spec[MONO_INST_SRC1]) {=0A ..=0A}=0A=0A.. to=
crash as spec becomes NULL and the if block tried to access a NULL pointer=
. After hacking the code to work around this exception, I later found the w=
hen the emitted code is run through mono_ldftn() the MonoMethod *method is =
corrupted and it crashes again.=0A=0AIs there still some problem with the p=
pc emitter or I am missing something in here.=0A=0Aany pointers would be ap=
preciated.=0A=0Aregards,=0Agary=0A=20
--Next_1068830574---0-203.199.83.39-3969--