[Mono-list] Binary problem

Paolo Molaro lupus@ximian.com
Wed, 19 Jun 2002 18:28:36 +0200

On 06/18/02 Dwivedi , Ajay Kumar wrote:
> The executable generated by the attached hello.cs program does not run on my
> machine. 
> It runs fine on linux though.
> 	OS:	Windows 2000 professional
> 		5.00.2195
> 		Service Pack 2
> 	Runtime: v1.0.3705
> 	Error: Unhandled exception at 0x200025ff in hello.exe: 
> 		 0xC0000005: Access violation reading location 0x200025ff.

blu@LATOP /cygdrive/g/mono
$ md5sum.exe hello.tar.gz 
ef83f6508c4bcab48c9946438188cbc9 *hello.tar.gz

blu@LATOP /cygdrive/g/mono
$ tar zxvf hello.tar.gz 

blu@LATOP /cygdrive/g/mono
$ uname

blu@LATOP /cygdrive/g/mono
$ ./hello.exe
Hello Ajay!

blu@LATOP /cygdrive/g/mono
$ mdsum5.exe hello.exe
61e2aff1be84906029b39b36e0cd7a10 *hello.exe

Your same binary works for me on Windows Xp. Your error messages are the
same reported by Dick on his win 2000 system.

The issue may be that the binary is relocated in memory in a different
place on windows 2000: the image base default is 0x400000.
Go into metadata/reflection.c, line 2279 and change

	virtual_base = 0x400000;
	virtual_base = 0x20000000;

This may as well not work: it's just a wild guess. I don't know why it
would work on a system and not on the other. You could try attaching a
debugger and try to poke inside the loading process.


lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better