[Mono-list] Once more about Mono on PowerPC

Yury Serdyuk Yury at serdyuk.botik.ru
Tue Sep 23 15:51:52 EDT 2008


Hi !

I have proceed further trying to locate a critical place where Mono is 
crashed on PowerPC
( see https://bugzilla.novell.com/show_bug.cgi?id=414845).

Critical code is ( expr3.cs file extracted from the expression.cs)

 >using System;
 >
 >        //
 >        //   Unary implements unary expressions.
 >        //
 >        public class Unary { //   : Expression {
 >
 >                void TryReduceConstant ( )
 >                {
 >                  ulong  long_constant = 9223372036854775808;
 >                }
 >
 >        }
 >
An attempt to compile given code through mono-wrapper gives

 >MONO_PATH="/home/user002/mono-112691/mcs/class/lib/monolite:$MONO_PATH"
 >/home/user002/mono-112691/runtime/mono-wrapper
 >/home/user002/mono-112691/mcs/class/lib/monolite/mcs.exe -v expr3.cs
 >** Message: Unknown errno: Success
 >
 >System.IO.IOException: Win32 IO returned ERROR_GEN_FAILURE. Path: expr3.cs
 >  at System.IO.FileStream.ReadData (IntPtr handle, System.Byte[] buf, 
Int32
 >offset, Int32 count) [0x00000]
 >  at System.IO.FileStream.ReadInternal (System.Byte[] dest, Int32 
offset, Int32
 >count) [0x00000]
 >  at System.IO.FileStream.Read (System.Byte[] array, Int32 offset, 
Int32 count)
 >[0x00000]
 >  at System.IO.StreamReader.ReadBuffer () [0x00000]
 >  at System.IO.StreamReader.Read (System.Char[] buffer, Int32 index, Int32
 >count) [0x00000]
 >  at Mono.CSharp.SeekableStreamReader.ReadBuffer () [0x00000]
 >  at Mono.CSharp.SeekableStreamReader.Read () [0x00000]
 >  at Mono.CSharp.Tokenizer.get_char () [0x00000]
 >  at Mono.CSharp.Tokenizer.xtoken () [0x00000]
 >  at Mono.CSharp.Tokenizer.token () [0x00000]
 >  at Mono.CSharp.CSharpParser.yyparse (yyInput yyLex) [0x00000]
 >  at Mono.CSharp.CSharpParser.parse () [0x00000] ** Message: Unknown 
errno:
 >Unknown error 897
 >
( I have tried Mono 2.0 RC1 and various versions from the SVN).

Further, I have found that the problem lies in the file_read function 
from the io.c module.
Particularly, after inserting debug printing as

> do {  printf ( "numbytes = %d\n", numbytes );
>         ret = read (fd, buffer, numbytes);
>         printf ( "fd = %d  ret = %d errno = %d\n", fd, ret, errno );
>     } while (ret == -1 && errno == EINTR &&
>          !_wapi_thread_cur_apc_pending());
>
>     if(ret==-1) {
>         gint err = errno;
>
> #ifdef DEBUG
>         g_message("%s: read of handle %p error: %s", __func__,
>               handle, strerror(err));
> #endif

 I got:

> [user002 at cell8i expression]$ 
> MONO_PATH="/home/user002/mono-2.0/mcs/class/lib/monolite:$MONO_PATH" 
> /home/user002/mono-2.0/runtime/mono-wrapper  
> /home/user002/mono-2.0/mcs/class/lib/monolite/mcs.exe -v expr3.cs
> numbytes = 1024
> fd = 4  ret = 640   errno =2
> numbytes = 1024
> fd = 4  ret = -1   errno =0
> ** Message: file_read: read of handle 0x4 error: No space left on device
> expr3.cs(32,1): error CS8025: Parsing error** Message: Unknown errno: 
> Identifier removed
>
> expr3.cs(32,1): error CS8025: Parsing error** Message: Unknown errno: 
> Identifier removed
>
> System.IO.IOException: Disk full. Path expr3.cs
>   at System.IO.FileStream.ReadData (IntPtr handle, System.Byte[] buf, 
> Int32 offset, Int32 count) [0x00000]
>   at System.IO.FileStream.ReadInternal (System.Byte[] dest, Int32 
> offset, Int32 count) [0x00000]

Interestingly, that for different versions of Mono the error mesages are 
different and arbitrary:

> [user002 at cell8i expression]$ 
> MONO_PATH="/home/user002/mono-113797/mcs/class/lib/monolite:$MONO_PATH" 
> /home/user002/mono-113797/runtime/mono-wrapper  
> /home/user002/mono-113797/mcs/class/lib/monolite/mcs.exe -v expr3.cs
> fd = 4   ret = 640   errno = 2
> fd = 4   ret = -1   errno = 0
> ** Message: file_read: read of handle 0x4 error: Read-only file system
> System.UnauthorizedAccessException: Access to the path "expr3.cs" is 
> denied.

Finally, on x86 architecture the above code run as follows:

> [serdyuk at skif expression]$ 
> MONO_PATH="/home/serdyuk/mono-2.0/mcs/class/lib/monolite:$MONO_PATH" 
> /home/serdyuk/mono-2.0/runtime/mono-wrapper  
> /home/serdyuk/mono-2.0/mcs/class/lib/monolite/mcs.exe -v expr3.cs
> numbytes = 1024
> fd = 7  ret = 640 errno = 2
> numbytes = 1024
> fd = 7  ret = 0 errno = 2
> numbytes = 1024
> fd = 7  ret = 0 errno = 2
> expr3.cs(23,26): warning CS0219: The variable `long_constant' is 
> assigned but its value is never used

We are in need of Mono on PowerPC very keen.
Please help.

Yury







More information about the Mono-list mailing list