Re: [Mono-dev] Compiling Mono on 64 bit ppc SLES 9

2006-10-30 Thread Vorobiev Maksim
IBM has offering for free remote access to Power5 hardware:
http://www-128.ibm.com/developerworks/power/library/pa-openpower1/index.
html 

So, this seems to be a solution for hardware access problem. The need
for spare time is still here. :(

I hope, this message does not breaks maillist rules, but it seems to be
useful for PPC porting.

Vorobiev Maxim.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paolo
Molaro
Sent: Monday, October 30, 2006 7:50 PM
To: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] Compiling Mono on 64 bit ppc SLES 9

On 10/26/06 Krishna Ganugapati wrote:
> I'm trying to compile Mono on 64 bit ppc SLES9 - I can build glib2, 
> libgdiplus, but when I configure mono, I get the following error
> 
> checking if inter-process shared handles are requested... yes
> 
> configure: error: No JIT or interpreter support available or selected.
> 
> Is mono not supported on 64 bit ppc SLES9?  The mono website only 
> talks about linux ppc (presumably that means only 32 bit)

We currently only support 32 bit ppc.
It should not be hard to add support for 64 bit arch if somebody has the
hardware and some spare time. You may want to contact [EMAIL PROTECTED] to
see if there are other options, like funding the port effort.

lupus

--
-
[EMAIL PROTECTED] debian/rules
[EMAIL PROTECTED] Monkeys do it better
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Mono issue with Regex

2006-04-13 Thread Vorobiev Maksim




Good 
day.
 
We have 
found the issue with Mono regular _expression_ verson 1.1.13/1.1.14. It was 
ok with previously used version 1.1.8 - so, it's some 
regression.
 
The next 
code sample:
 
   Regex rx = 
new Regex("E+(,E+)+1");   String test = 
"E,E1";   MatchesCollection mc = 
rx.Matches(test);   foreach(Match m in 
mc)   {Console.WriteLine(m.Value);   }
 
couldn't find any matches under 
13/14 versions of Mono runtime. But it correctly works with MS.NET and 
Mono 1.1.8. What's wrong and could somebody help?
 
BTW, this sample works well on 
new version (and on MS.NET and 1.18 also):
 
   Regex rx = new 
Regex("E+(,E+)+");   String test = 
"E,E1";   MatchesCollection mc = 
rx.Matches(test);   foreach(Match m in 
mc)   {Console.WriteLine(m.Value);   }
 
The difference is the 
tailing symbol in the pattern. It doesn't matter that the symbol 
exactly.
 
Is there are any ideas 
that should be fixed? Thank 
you.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


HA: [Mono-dev] System.Threading.Thread:MemoryBarrier() and XSP

2005-12-24 Thread Vorobiev Maksim
Title: HA: [Mono-dev] System.Threading.Thread:MemoryBarrier() and XSP






Hi,

I built 1.1.12 for Solaris on SPARCv9. And it works.
To compleate the build I used gcc 3.4.2, GNU make, GNU tar.

The only undocumented feature I used - it requires enviroment variable CC to be defined (for me it was CC=gcc).


-Исходное сообщение-
От: [EMAIL PROTECTED] от имени [EMAIL PROTECTED]
Отправлено: Пт, 23.12.2005 15:53
Кому: mono-devel-list@lists.ximian.com
Тема: Re: [Mono-dev] System.Threading.Thread:MemoryBarrier() and XSP

Hi,

So, you were able to build mono 1.1.12 on Solaris??? Could you please tell the steps? Are you trying on Solaris x86??

When I try to compile I still have problems with exceptions-x86.c and the like...

pablo
  - Original Message -
  From: Vorobiev Maksim
  To: mono-devel-list@lists.ximian.com
  Sent: Thursday, December 22, 2005 5:22 PM
  Subject: [Mono-dev] System.Threading.Thread:MemoryBarrier() and XSP


  Good day.

  I've built Mono 1.1.12 and XSP under Solaris, but there is a problem. Then I try to start XSP, it crashes with such message:
  Unhandled Exception: System.NotImplementedException: The requested feature is not implemented.
  in <0x0> 
  in (wrapper managed-to-native) System.Threading.Thread:MemoryBarrier ()
  in <0x0004c> System.Diagnostics.TraceImpl:InitOnce ()
  in <0x4> System.Diagnostics.TraceImpl:get_Listeners ()
  in <0x4> System.Diagnostics.Trace:get_Listeners ()
  in <0x0008c> Mono.XSP.Server:Main (System.String[] args)

  Native implementation for MemoryBarrier contains (lines numbered with cat):

    1360  void
    1361  ves_icall_System_Threading_Thread_MemoryBarrier (void)
    1362  {
    1363  /* Should be implemented as a JIT intrinsic */
    1364  mono_raise_exception (mono_get_exception_not_implemented (NULL))
  ;
    1365  }

  Listeners property implementation in TraceImpl calls this method (as in listed stack). How can I make XSP working? It seems that I need to rebuild Mono in some non-default way.

  Thank you.


--


  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
  http://lists.ximian.com/mailman/listinfo/mono-devel-list





___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-dev] System.Threading.Thread:MemoryBarrier() and XSP

2005-12-22 Thread Vorobiev Maksim
Thanks! Now it works.


Воробьев Максим, Компания "Крок"
тел. (+095) 974-22-74 (внутр. 2207)
http://www.croc.ru
[EMAIL PROTECTED]

-Original Message-
From: Zoltan Varga [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 22, 2005 9:00 PM
To: Vorobiev Maksim
Cc: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] System.Threading.Thread:MemoryBarrier() and XSP

   Hi,

  This will be fixed in SVN sortly. In the meantime, just comment out the body 
of ves_icall_System_Threading_Thread_MemoryBarrier () and things should work ok.

   Zoltan

On 12/22/05, Vorobiev Maksim <[EMAIL PROTECTED]> wrote:
>
> Good day.
>
> I've built Mono 1.1.12 and XSP under Solaris, but there is a problem. 
> Then I try to start XSP, it crashes with such message:
> Unhandled Exception: System.NotImplementedException: The requested 
> feature is not implemented.
> in <0x0> 
> in (wrapper managed-to-native)
> System.Threading.Thread:MemoryBarrier () in <0x0004c> 
> System.Diagnostics.TraceImpl:InitOnce () in <0x4> 
> System.Diagnostics.TraceImpl:get_Listeners () in <0x4> 
> System.Diagnostics.Trace:get_Listeners () in <0x0008c> 
> Mono.XSP.Server:Main (System.String[] args)
>
> Native implementation for MemoryBarrier contains (lines numbered with cat):
>
>   1360  void
>   1361  ves_icall_System_Threading_Thread_MemoryBarrier
> (void)
>   1362  {
>   1363  /* Should be implemented as a JIT intrinsic */
>   1364  mono_raise_exception
> (mono_get_exception_not_implemented (NULL)) ;
>   1365  }
>
> Listeners property implementation in TraceImpl calls this method (as 
> in listed stack). How can I make XSP working? It seems that I need to 
> rebuild Mono in some non-default way.
>
> Thank you.
> ___
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
>
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Building Mono 1.1.12 on Solaris

2005-12-20 Thread Vorobiev Maksim



Good day 
again.
 
I've got the last 
source tar (1.1.12 - is it true? No new messages about it...) from Mono web 
site and try to build it under Solaris. I've got the same problem as for 1.1.10: 
building stops with such message:
 
make[1]: *** No rule 
to make target `../class/Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs', 
needed by `../class/lib/default/mcs.exe'.  Stop.make[1]: Leaving 
directory `/opt/monohome/mono-1.1.12/mcs/mcs'
There is no 
Mono.CompillerServices.SymbolWriter/MonoSymbolFile.cs in mcs/class with source 
tar. But it present in SVN. Should it be used (in this case it's good to add it 
in source tar), or this dependance is obsolete (and should be removed from 
mcs.exe.sources)? There is symbolwriter.cs in mcs/mcs catalog. Is it the 
replacement?
 
Thank 
you.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-dev] system class

2005-10-05 Thread Vorobiev Maksim
Some of this information could be found under proc filesystem. May be
it's good to explore that of WMI knowledge present in these
pseudo-files. But it's very platform dependent. And even
kernel-dependent.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Matthijs
ter Woord
Sent: Wednesday, October 05, 2005 5:45 PM
To: Paolo Molaro; mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] system class

Are there any WMI alternatives on linux (opensource/closed source)?



- Original Message -
From: "Paolo Molaro" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, October 05, 2005 12:24 PM
Subject: Re: [Mono-dev] system class


> On 10/04/05 marcos rocha wrote:
> > does anyone knows when will System.Management class be
> > usefull ???
> 
> When someone who needs it will write and submit an implementation.
> 
> lupus
> 
> -- 
> -
> [EMAIL PROTECTED] debian/rules
> [EMAIL PROTECTED] Monkeys do it better
> ___
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Another issue with cairo in libgdiplus-1.1.9

2005-09-12 Thread Vorobiev Maksim
Title: Another issue with cairo in libgdiplus-1.1.9






Good day.

Tarball libgdiplus-1.1.9 does not contains headers for experimental backends - ps, glitz and pdf from cairo sources. So it is not possible to build cairo packed with gdiplus for ps and pdf support. It's possible to configure these backands if supply --enable-ps and --enable-pdf on configure script of libgdiplus, but during make of library sources compilation fails with error: cairo-ps.h not found (or cairo-pdf.h not found, if ps-backend was disabled). The same issue for glitz backend.

IMHO, since libgdiplus replaces cairo library (and it's not possible now to compile it with-cairo=installed option), it'll be correct to enable support for these backends even if gdiplus does not use them.

Thank you.




___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Potential problem with managed wrappers for compillers

2005-09-12 Thread Vorobiev Maksim
Title: Potential problem with managed wrappers for compillers






Good day.

Some time ago there was the post with patch for CSharpCodeCompiller.cs. It solves the rare problem in situation then long-run compillation terminates and ExitCode reads before compiller process actually ends. The solution was to change next code:
try {
    mcs.Start();
    // If there are a few kB in stdout, we might lock
    mcs_output=mcs.StandardError.ReadToEnd();
    mcs.StandardOutput.ReadToEnd ();
    mcs.WaitForExit();
} finally {
    results.NativeCompilerReturnValue = mcs.ExitCode;
    mcs.Close();
}

to this one:

try {
    mcs.Start();
    // If there are a few kB in stdout, we might lock
    mcs_output=mcs.StandardError.ReadToEnd();
    mcs.StandardOutput.ReadToEnd ();
    mcs.WaitForExit();
    results.NativeCompilerReturnValue = mcs.ExitCode;
} finally {
    mcs.Close();
}

so, the exit code reads only then no exception occurs - that is correct. This change was included with 1.1.9 version.

But I have found, that the same issue presents in VBCodeCompiller.cs and CodeCompiller.cs. This ma cause potential problem. Perhas, it'll be good to be changed in the same way as for C# compiller.

Thank you.



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Building libgdiplus-1.1.9 from sources

2005-09-12 Thread Vorobiev Maksim
Title: Building libgdiplus-1.1.9 from sources






Good day.

Just downloaded libgdiplus-1.1.9 tarball from Download page. I compile and install Cairo library 1.0.0 separatly and now try to build libgdiplus with it:

./configure --with-cairo=installed

But i got the error message: "Did not find Cairo == 0.3.0".

Does it still use the old Cairo release? I think not, since libgdiplus ships with 1.0.1 (is it true, 1.0.1 is released?) Cairo version.
IMHO there is the error in configure.in:

...
    if pkg-config --exact-version 0.3.0 cairo; then
        echo Cairo installation OK
    else
        AC_MSG_ERROR("Did not find Cairo == 0.3.0");
    fi

...

Thank you.



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] ThreadAbortException during compilation path

2005-08-18 Thread Vorobiev Maksim
Good day.
 
We have encounted an issue with CSharpCodeCompiller class. Then there is
a termination of thread, that startups compilation (and waits for
ExitCode), it gots ThreadAbortException and goes to finally block. But
the process of mcs is still running! So, it should not check for
ExitCode. In case then mcs still running, we got
InvalidOperationException, that hides ThreadAbortException.
This is the current code:
 
   try {
mcs.Start();
// If there are a few kB in stdout, we might lock
mcs_output=mcs.StandardError.ReadToEnd();
mcs.StandardOutput.ReadToEnd ();
mcs.WaitForExit();
   } finally {
results.NativeCompilerReturnValue = mcs.ExitCode; // <--
!!This line
mcs.Close();
   } 
 
May be it's better to change for this?
 
   try {
mcs.Start();
// If there are a few kB in stdout, we might lock
mcs_output=mcs.StandardError.ReadToEnd();
mcs.StandardOutput.ReadToEnd ();
mcs.WaitForExit();
results.NativeCompilerReturnValue = mcs.ExitCode; // <-- !! Goes
from finally to try block
   } finally {
mcs.Close();
   } 
 
The patch is attached. If there is no disagreement, apply this patch to
CVS.

Thank you.


CSharpCodeCompiler.diff
Description: CSharpCodeCompiler.diff
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-dev] Need help with Sockets

2005-08-16 Thread Vorobiev Maksim
 
Good day.

You can try to tune keepalive TCP parameters. These parameters can be
setted via /proc file system. You can write values directly to
pseudo-files, set them with sysctl utility, or add them to
/etc/sysctl.conf. See man page for  sysctl for details.

Keepalive parameters that could be useful for your case are these:

net.ipv4.tcp_keepalive_intvl
net.ipv4.tcp_keepalive_probes
net.ipv4.tcp_keepalive_time

For Suse Linux 9.2 they are setted as optimal for web-server:
net.ipv4.tcp_keepalive_intvl = 75 - how long to wait between to probes
for client alive (seconds)
net.ipv4.tcp_keepalive_probes = 9 - how many probes to send before idle
TCP connection force termination (units)
net.ipv4.tcp_keepalive_time = 7200 - how long to wait on idle connection
before check it for client alive (seconds)

BTW, same for Windows defaults are: 1/5/7200.

IMHO, you should change last parameter (2 hours) for something less. How
long is depend on how long your connections should be keeped idle and
how costly for you to open new connection.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bernhard
Herzog
Sent: Monday, August 15, 2005 12:45 PM
To: mono-devel-list@lists.ximian.com
Subject: [Mono-dev] Need help with Sockets

Hi!

I have a Socket Server and Clients (see attached files). When
disconnecting the clients the server does not receive exceptions on some
of the clients. I have a cleanup routine that periodically checks the
clients by sending some empty data. But this does not work for some of
the clients (232 out of 360 connections are still "alive" on the server
after closing the clients).

Actually I created this client and server programs to test this
particular
bug:
http://bugzilla.ximian.com/show_bug.cgi?id=75812

But this problem does not show in my simplified test programs, but it
does not work correctly nevertheless. The programs does work on MS .Net
(BTW: The socket client program does not work on Mono for Windows, maybe
this is the same problem that the MySql Connector is having on Windows
in 1.1.8.3 -> but this is a different bug).

Maybe someone can have a look, I would really appreciate that. I have
not posted any bug reports yet (except for the one above). This is
really a major issue for me (kind of a show stopper). Maybe I am doing
something very wrong, I don't know. I am using 1.1.8.3 on Suse Linux
9.2.

Thank you
Bernhard 
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-devel-list] problems with Syscall.syslog fot mono-1.1.8.3

2005-07-28 Thread Vorobiev Maksim
 
Good day.

Today I've upgraded mono version to 1.1.8.3 and found, that it has no
fixes for syslog support. Not in sources, not in binaries. That version
will contain these changes?

The oiginal discussion of problem listed below.

Thank you.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jonathan
Pryor
Sent: Tuesday, June 28, 2005 3:32 PM
To: Vorobiev Maksim
Cc: Mono-devel-list@lists.ximian.com
Subject: Re: [Mono-devel-list] problems with Syscall.syslog

On Mon, 2005-06-27 at 18:35 +0400, Vorobiev Maksim wrote:
> I've started using Syscall.syslog method and encounted several 
> problems. It may be errors in mono, or I just missed some details.
> Please note, that I use Suse 9.2 linux distribute.

It's nice to know someone is testing it. :-)

> 1. In Syscall.cs enumeration SyslogFacility declared with members:
> 
> LOG_UUCP = 8 << 3,
> 
> LOG_CRON = 8 << 3
> 
> But under Suse the same constants declared in 
> /usr/include/sys/syslog.h as LOG_UUCP = 8 << 3, LOG_CRON = 9 << 3

Oops, my bad.  Fixed in svn-trunk (r46637,r46638).

> 2. There is no constant LOG_USRE in syslog.h under Suse, but it's 
> LOG_USER. So, in support/map.c there is a bug (?) - no such definition

> found and error returned then code execution steps in this branch. The

> question is the same: is it mono problem, or Suse-platform specific 
> header file?

This was fixed on June 15 in svn-trunk.

> 3. It seems very strange that SyslogFacility enumeration declared with

> [Flag] attribute. Members of this enumeration are not "powers of 2", 
> so their combination via OR-mask is something incorrect. And these 
> constants should be used independantly, not in combination. Is it true

> or I missed something?

No, it's my mistake.  Fixed in svn-trunk.

Thank you for the help.

 - Jon



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-devel-list] Interactive C# prompt

2005-07-19 Thread Vorobiev Maksim
 
As I can understand, it cann't be done. C# is a language for
compilation, not for interpretaion (as far as you are not going to enter
IL-instructions at promt).

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Colin JN
Breame
Sent: Tuesday, July 19, 2005 7:54 PM
To: mono-devel-list@lists.ximian.com
Subject: [Mono-devel-list] Interactive C# prompt

Hello,

I'm wondering whether there is such a thing as an interactive C# prompt
for mono. e.g. where commands can be entered and executed one-by-one.

If not, any ideas about how I would go about writting something like
this?
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-devel-list] Limit Garbage Collection

2005-07-19 Thread Vorobiev Maksim
 
Garbage collection cann't be replaced with alloc/free model - it breaks
.NET enviroment fundamentals. But if you want to escape long-time
collections, you should design your software do not use dynamic object
creations. Create all your objects at start-up and keep references to
them, declare your types as "value" ones - so they'll be created at
stack, not in heap.
BTW, you can try to use System.WeakReference to model your "garbage
list". See details in MSDN or any .NET-books.
At last, you can have some control over GC with System.GC class.
As the last chance, you can use interop with native code...but it has
it's own pit falls.

Well, there is no silver bullet, so .NET is not the best platform for
active-grapthics game development or some types of calculations. It was
oriented for bussiness applications. So, think twice for all pro and
contras with platform selection.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Cedric Le
Dressay
Sent: Tuesday, July 19, 2005 2:23 PM
To: mono-devel-list@lists.ximian.com
Subject: [Mono-devel-list] Limit Garbage Collection

Dear all,

Please accept my apologies if a similar question has been asked, I have
not been able to find a question to it.

.Net is an incredible step in the interroperability of languages. Nearly
all software developpements can use garbage collection. Unfortunately,
some others cannot like game developpement. Typically, a game cannot be
reasonnably freezed more than 20 ms (50 frames per second). Sometimes
requirements are even higher.

Is there a way with mono to disable garbage collection and use the old
desalloc model?
Is there a way to "cheat" and instead of really desollocating an objet
of a particuliar type to put it in a garbage list. This garbage list
will be used for the next allocation of the same type...

What are your thoughts?

Thanks for your time,

Cedric


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-devel-list] EventLog and syslog

2005-06-29 Thread Vorobiev Maksim



Good 
day.
 
To the discussion of 
Syscall.syslog. Why System.Diagnostic.EventLog was not implemented for Unixes on 
top of syslog? I think it should be most common logging subsystem. Was It not 
just implemented or it's a project decision? There is a comment in code, that it 
should be some sort of XML-logging. But there is no standart XML log subsystem 
at this time for unixes. May be it's good to include syslog-based implementation 
and add to the configuration script choose for user - to use "empty" 
implementation or use syslog one? In future if it will support other logging 
services, it can be extended.
 
If it's OK, I can 
supply syslog-based implementation.
 
Perhaps, one day 
here'll be mono-based standalone logging service replacing syslog with XML 
support and other cool features. :
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-devel-list] problems with Syscall.syslog

2005-06-28 Thread Vorobiev Maksim
Good day.

But it still has a problem in map.c for function int
Mono_Posix_FromSyslogFacility (int x, int *r).
It checks for constants via &-mask: search for first occurrence. The
next code:
if ((x & Mono_Posix_SyslogFacility_LOG_USRE) ==
Mono_Posix_SyslogFacility_LOG_USRE)
#ifdef LOG_USRE
*r |= LOG_USRE;
#else /* def LOG_USRE */
{errno = EINVAL; return -1;}

will be TRUE for all constants, which ends with "8"
(Mono_Posix_SyslogFacility_LOG_DAEMON and so on - "even ones"). Here
should be another way for testing. BTW, why to look throght all possible
constants? Since these are not flags, where could be only one possible
value. So, function should return after first found. And IMHO test
should be performed like this:

if ((x & Mono_Posix_SyslogFacility_ALL) ==
Mono_Posix_SyslogFacility_LOG_USRE)
#ifdef LOG_USRE
{*r = LOG_USRE;return 0;}
#else /* def LOG_USRE */
{errno = EINVAL; return -1;}

Where Mono_Posix_SyslogFacility_ALL = Mono_Posix_SyslogFacility_LOG_KERN
| Mono_Posix_SyslogFacility_LOG_USRE | 

Thank you for your answer.


On Mon, 2005-06-27 at 18:35 +0400, Vorobiev Maksim wrote:
> I've started using Syscall.syslog method and encounted several 
> problems. It may be errors in mono, or I just missed some details.
> Please note, that I use Suse 9.2 linux distribute.

It's nice to know someone is testing it. :-)

> 1. In Syscall.cs enumeration SyslogFacility declared with members:
> 
> LOG_UUCP = 8 << 3,
> 
> LOG_CRON = 8 << 3
> 
> But under Suse the same constants declared in 
> /usr/include/sys/syslog.h as LOG_UUCP = 8 << 3, LOG_CRON = 9 << 3

Oops, my bad.  Fixed in svn-trunk (r46637,r46638).

> 2. There is no constant LOG_USRE in syslog.h under Suse, but it's 
> LOG_USER. So, in support/map.c there is a bug (?) - no such definition

> found and error returned then code execution steps in this branch. The

> question is the same: is it mono problem, or Suse-platform specific 
> header file?

This was fixed on June 15 in svn-trunk.

> 3. It seems very strange that SyslogFacility enumeration declared with

> [Flag] attribute. Members of this enumeration are not "powers of 2", 
> so their combination via OR-mask is something incorrect. And these 
> constants should be used independantly, not in combination. Is it true

> or I missed something?

No, it's my mistake.  Fixed in svn-trunk.

Thank you for the help.

 - Jon



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-devel-list] problems with Syscall.syslog

2005-06-27 Thread Vorobiev Maksim




Good day.

I've started using Syscall.syslog method and 
encounted several problems. It may be errors in mono, or I just missed some details. Please 
note, that I use Suse 9.2 linux distribute.
1. In Syscall.cs enumeration SyslogFacility declared 
with members:
LOG_UUCP = 8 << 3,
LOG_CRON = 8 << 3
But under Suse the same constants declared in 
/usr/include/sys/syslog.h as LOG_UUCP = 8 << 3, LOG_CRON = 9 << 
3
Is it bug in mono or it worked for some other 
platforms? I'm going to fix it in mono for myself...
2. There is no constant LOG_USRE in syslog.h under 
Suse, but it's LOG_USER. So, in support/map.c there is a bug (?) - no such 
definition found and error returned then code execution steps in this branch. 
The question is the same: is it mono problem, or Suse-platform specific header 
file?
3. It seems very strange that SyslogFacility 
enumeration declared with [Flag] attribute. Members of this enumeration are not 
"powers of 2", so their combination via OR-mask is something incorrect. And 
these constants should be used independantly, not in combination. Is it true or 
I missed something?
4. In Mono_Posix_FromSyslogFacility in support/map.c 
constants from SyslogFacility interpreted as flags - they checked with OR-mask. 
It's incorrect as I understand, but more then it, there is such 
branch:
if ((x & Mono_Posix_SyslogFacility_LOG_USRE) == 
Mono_Posix_SyslogFacility_LOG_USRE)
#ifdef LOG_USRE
*r |= LOG_USRE;
#else /* def LOG_USRE */
{errno = EINVAL; return -1;}
#endif /* ndef LOG_USRE */
This is combination of 2) and 3) issues. First of 
all, undefined macro LOG_USRE always runs to error return. The second one, that 
Mono_Posix_SyslogFacility_LOG_USRE declared as follows:
#define Mono_Posix_SyslogFacility_LOG_USRE 
0x0008
This means, that branch
if ((x & Mono_Posix_SyslogFacility_LOG_USRE) == 
Mono_Posix_SyslogFacility_LOG_USRE)
will becomes true for all constants like #define 
Mono_Posix_SyslogFacility_LOG_DAEMON 0x0018 #define 
Mono_Posix_SyslogFacility_LOG_SYSLOG 0x0028 ...etc
And it always will generate error for 
Suse.
I'm ready to fix these issues and supply the patch. 
Is it OK to change SyslogFacility enumeration to simple enum, not flags? Is it 
OK to assume, that LOG_USRE is LOG_USER in real for all platforms?
Is it good to change declaration of LOG_UUCP and 
LOG_CRON as LOG_UUCP = 8 << 3, LOG_CRON = 9 << 3 ?
Thank you.
 
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-devel-list] Syslog support

2005-06-22 Thread Vorobiev Maksim



Good 
day.
 
Is there are any 
possibility to work with syslog daemon from Mono without developing additional 
unmanaged code? I cann't find support for syslog in any Mono namaspaces. Does it 
exists?
 
Thank 
you.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-devel-list] StringBuilder error

2005-06-21 Thread Vorobiev Maksim
Good day.
 
I thing I found an error in StringBuilder class for Replace method:

public StringBuilder Replace( string oldValue, string newValue, int
startIndex, int count ) 

An error occurs then we replace substring and the length of result
string becomes longer then before operation. This is because is this
case the end-of-string is replaced and there is no tailing \0. The
garbage present in the result. For example, the next code shows the
problem:

StringBuilder sb = new StringBuilder ();
sb.Append ("This, is, a, list");
Console.WriteLine( sb );
sb.Replace (",", " comma-separated ", 0, 13);
Console.WriteLine( sb );

The result string in the second print will be 'This  comma-separated'
and a garbage at the tail:(
Problem was found for version 1.1.7, but the same code still present for
1.1.8. BTW, MS .NET doesn't have this bug.
We have a patch for this problem. I append it to the message. Please, if
it's ok for everyone, supply it to the common source base.


StringBuilder.diff
Description: StringBuilder.diff
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-devel-list] FolderBrowseDialog fails

2005-05-24 Thread Vorobiev Maksim



Good 
day.
 
Creation of instance 
of System.Windows.Forms.FileBrowseDialog failed for me at constructor call with 
Mono version 1.1.7. I've ran my program under "ru" locale. So, constructor 
failed at the line 532: imageList.Images.Add( (Image)Locale.GetResource( 
"monitor-planet" ) );
 
debug mode shows, 
that the problem - null reference passed to Add method. This is because 
"monitor-planet" resource is not defined in file System.Windows.Forms.resx. Then 
I copied resource "monitor-planet" definition from System.Windows.Forms.de.resx 
file and recompiled mono project (especially System.Windows.Forms.dll). 
Now everything is working file. My question is: is it correct method and 
how to fix this issue for next Mono release? Can I supply the patch and where 
should I post it?
 
Thanks.
 
 

http://www.croc.ru
[EMAIL PROTECTED]
 
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list