Re: [Mono-dev] InterOp problems with 1.2.6pre2
Hi I am wondering whether this problem is not interesting anyone? In the meanwhile I could pinpoint the troublemaker. Basically it is a float[] field I declared in the struct Encoding context: public struct EncodingContext { public EncodingParameters EncodingParameters; public Metadata Metadata; public Status Status; public SystemParameters SystemParameters; public int Verbosity; public int Channels; public AudioCodingMode AudioCodingMode; public bool HasLfe; public int SampleRate; internal A52SampleFormat SampleFormat; public float[] InitialSamples; // the trouble maker private IntPtr m_Context; } and I have and InterOp like this: public abstract class FrameEncoder { [DllImport( aften.dll )] private static extern void aften_set_defaults( ref EncodingContext context ); public static EncodingContext GetDefaultsContext() { EncodingContext context = new EncodingContext(); aften_set_defaults( ref context ); return context; } } This causes the crash/exception in mono (see quoted mail). So it doesn't have anything to do with generics as I suspected at first. If I change the float[] to IntPtr mono seems to work. As I said VS2008beta2 doesn't have any problems. Cheers, Prakash On the day of Saturday 24 November 2007 Prakash Punnoor hast written: Hi, mono 1.2.6pre1 and pre2 on Linux x86_64 can't run some C# bindings to a C library (an ac3 encoder), which works perfectly with vs2008beta2 and .net2.0 target on x86. You can get the sources at http://sourceforge.net/projects/aften/ in svn (revision 659). Compile it using cmake. To build C# bindings, pass -DBINDINGS_CS=1 to cmake. It worked with mono with the floating point samples case before I switched the bindings to using generics to have other types of samples supported (revision 651; though there were bugs in my code at that time ;). The testing code is this (remember the bindings are the troublemaker, not this code): using System; using System.IO; using System.Runtime.InteropServices; using Aften; namespace AftenTest { class MainClass { public static int Main(string[] args) { Console.WriteLine(Aften AC3 Encoding Demo); if (args.Length != 2) { Console.WriteLine(Usage: +Path.GetFileNameWithoutExtension(Environment.CommandLine)+ input.wav output.ac3); return -1; } EncodingContext context = FrameEncoder.GetDefaultsContext(); context.Channels = 2; context.AudioCodingMode = AudioCodingMode.Stereo; context.SampleRate = 48000; context.HasLfe = false; context.SystemParameters.ThreadsCount = 1; FrameEncoderInt16 encoder = new FrameEncoderInt16(ref context); using (FileStream inputStream = new FileStream(args[0], FileMode.Open)) using (FileStream outputStream = new FileStream(args[1], FileMode.CreateNew)) { inputStream.Seek(44, SeekOrigin.Begin); //Skip WAVE header... encoder.Encode(inputStream, outputStream); } Console.WriteLine(Done); Console.ReadLine(); return 0; } } } The error I get with mono: mono AftenTest.exe ~/Projects/bill.wav encoded.ac3 Aften AC3 Encoding Demo ** ERROR **: Structure field of type Single[] can't be marshalled as LPArray aborting... Stacktrace: at AftenTest.MainClass.Main (string[]) 0x at AftenTest.MainClass.Main (string[]) 0x000b8 at (wrapper runtime-invoke) AftenTest.MainClass.runtime_invoke_int_string[] (object,intptr,intptr,intptr) 0x Native stacktrace: mono [0x51fe5d] /lib/libpthread.so.0 [0x2b86da225880] /lib/libc.so.6(gsignal+0x35) [0x2b86da6e4fa5] /lib/libc.so.6(abort+0x110) [0x2b86da6e6a00] /usr/lib/libglib-2.0.so.0 [0x2b86d9d80dec] /usr/lib/libglib-2.0.so.0(g_log+0x83) [0x2b86d9d80e73] mono [0x48ba04] mono [0x48e297] mono [0x48f449] mono [0x493642] mono [0x4942db] mono [0x500646] mono [0x50bc76] mono [0x50d3da] mono [0x43df62] [0x415b] Debug info from gdb: Using host libthread_db library /lib/libthread_db.so.1. [Thread debugging using
Re: [Mono-dev] InterOp problems with 1.2.6pre2
On the day of Friday 30 November 2007 Robert Jordan hast written: Hi, Prakash Punnoor wrote: Hi I am wondering whether this problem is not interesting anyone? In the meanwhile I could pinpoint the troublemaker. well, we'd be interested but you did not post a reproducible test case. Yes, I did, if you'd cared to fetch the sources and run the test code I mailed. Have you actually read the complete mail? Basically it is a float[] field I declared in the struct Encoding context: This doesn't look like a valid struct for p/invoke. Is this the real code? Take a look at the sources... But yes, except that I omitted the inner structs and comments. Aften's context does not declare a float array at this position. But it has a void* and to my understanding float[] can be marshalled to void*. It works with the methods, as well, which have void* as parameters. -- (°= =°) //\ Prakash Punnoor /\\ V_/ \_V signature.asc Description: This is a digitally signed message part. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] InterOp problems with 1.2.6pre2
Hi, Prakash Punnoor wrote: Hi I am wondering whether this problem is not interesting anyone? In the meanwhile I could pinpoint the troublemaker. well, we'd be interested but you did not post a reproducible test case. Basically it is a float[] field I declared in the struct Encoding context: This doesn't look like a valid struct for p/invoke. Is this the real code? Aften's context does not declare a float array at this position. Robert public struct EncodingContext { public EncodingParameters EncodingParameters; public Metadata Metadata; public Status Status; public SystemParameters SystemParameters; public int Verbosity; public int Channels; public AudioCodingMode AudioCodingMode; public bool HasLfe; public int SampleRate; internal A52SampleFormat SampleFormat; public float[] InitialSamples; // the trouble maker private IntPtr m_Context; } and I have and InterOp like this: public abstract class FrameEncoder { [DllImport( aften.dll )] private static extern void aften_set_defaults( ref EncodingContext context ); public static EncodingContext GetDefaultsContext() { EncodingContext context = new EncodingContext(); aften_set_defaults( ref context ); return context; } } This causes the crash/exception in mono (see quoted mail). So it doesn't have anything to do with generics as I suspected at first. If I change the float[] to IntPtr mono seems to work. As I said VS2008beta2 doesn't have any problems. Cheers, Prakash On the day of Saturday 24 November 2007 Prakash Punnoor hast written: Hi, mono 1.2.6pre1 and pre2 on Linux x86_64 can't run some C# bindings to a C library (an ac3 encoder), which works perfectly with vs2008beta2 and .net2.0 target on x86. You can get the sources at http://sourceforge.net/projects/aften/ in svn (revision 659). Compile it using cmake. To build C# bindings, pass -DBINDINGS_CS=1 to cmake. It worked with mono with the floating point samples case before I switched the bindings to using generics to have other types of samples supported (revision 651; though there were bugs in my code at that time ;). The testing code is this (remember the bindings are the troublemaker, not this code): using System; using System.IO; using System.Runtime.InteropServices; using Aften; namespace AftenTest { class MainClass { public static int Main(string[] args) { Console.WriteLine(Aften AC3 Encoding Demo); if (args.Length != 2) { Console.WriteLine(Usage: +Path.GetFileNameWithoutExtension(Environment.CommandLine)+ input.wav output.ac3); return -1; } EncodingContext context = FrameEncoder.GetDefaultsContext(); context.Channels = 2; context.AudioCodingMode = AudioCodingMode.Stereo; context.SampleRate = 48000; context.HasLfe = false; context.SystemParameters.ThreadsCount = 1; FrameEncoderInt16 encoder = new FrameEncoderInt16(ref context); using (FileStream inputStream = new FileStream(args[0], FileMode.Open)) using (FileStream outputStream = new FileStream(args[1], FileMode.CreateNew)) { inputStream.Seek(44, SeekOrigin.Begin); //Skip WAVE header... encoder.Encode(inputStream, outputStream); } Console.WriteLine(Done); Console.ReadLine(); return 0; } } } The error I get with mono: mono AftenTest.exe ~/Projects/bill.wav encoded.ac3 Aften AC3 Encoding Demo ** ERROR **: Structure field of type Single[] can't be marshalled as LPArray aborting... Stacktrace: at AftenTest.MainClass.Main (string[]) 0x at AftenTest.MainClass.Main (string[]) 0x000b8 at (wrapper runtime-invoke) AftenTest.MainClass.runtime_invoke_int_string[] (object,intptr,intptr,intptr) 0x Native stacktrace: mono [0x51fe5d] /lib/libpthread.so.0 [0x2b86da225880] /lib/libc.so.6(gsignal+0x35) [0x2b86da6e4fa5] /lib/libc.so.6(abort+0x110) [0x2b86da6e6a00] /usr/lib/libglib-2.0.so.0 [0x2b86d9d80dec] /usr/lib/libglib-2.0.so.0(g_log+0x83) [0x2b86d9d80e73] mono [0x48ba04] mono [0x48e297] mono [0x48f449] mono [0x493642] mono [0x4942db]
[Mono-dev] String.GetHashCode()
A thought struck me while i was dozing on the plane on the way home from the summit. Since strings are immutable, shouldn't it be possible to compute the hashcode once and store it rather than recomputing it over and over again? Is there some really obvious reason that i can't think of that would make this a bad idea? Alan. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] String.GetHashCode()
4 bytes of storage for every string on the system at all times? Dunno. Add it up I guess. On Sat, 2007-12-01 at 01:23 +, Alan McGovern wrote: A thought struck me while i was dozing on the plane on the way home from the summit. Since strings are immutable, shouldn't it be possible to compute the hashcode once and store it rather than recomputing it over and over again? Is there some really obvious reason that i can't think of that would make this a bad idea? Alan. ___ 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] String.GetHashCode()
Extra memory cost, which would hit all allocated strings, also those short ones. For some applications, which use millions of small strings this would be unacceptable hit. 2007/11/30, Alan McGovern [EMAIL PROTECTED]: A thought struck me while i was dozing on the plane on the way home from the summit. Since strings are immutable, shouldn't it be possible to compute the hashcode once and store it rather than recomputing it over and over again? Is there some really obvious reason that i can't think of that would make this a bad idea? Alan. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list -- Kamil Skalski http://nazgul.omega.pl ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] segfault on an ARM processor but not on a x86 (Linux) or .NET on Windows
We saw several seg faults when AppDomain.Unload was called in Mono on an ARM processor. The same code executed fine on x86 mono and .NET on Windows. What I think was happening, but not sure, was that we were attempting to unload the only app domain in the process. It seems like mono under x86 and .NET on windows handles this by ignoring the call and doesn't cause a seg fault. Also, when we were seeing this, it was not at the line of code, but just randomly after the call. I believe this had to do with garbage collection removing references that it shouldn't have. We could change the timing of the seg fault by introducing some more intensive logging around the area. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] compilation problem .../process.c:197: undefined reference to `VerQueryValue'
Hi: I just update my mono sources from anonymous svn to try Olive and WCF, but I get the following error: ./.libs/libmonoruntime.a(process.o): In function `process_module_string_read':/mnt/data/opt/mono/mono/metadata/process.c:197: undefined reference to `VerQueryValue' ./.libs/libmonoruntime.a(process.o): In function `process_get_fileversion':/mnt/data/opt/mono/mono/metadata/process.c:250: undefined reference to `GetFileVersionInfoSize' :/mnt/data/opt/mono/mono/metadata/process.c:253: undefined reference to `GetFileVersionInfo' :/mnt/data/opt/mono/mono/metadata/process.c:262: undefined reference to `VerQueryValue' :/mnt/data/opt/mono/mono/metadata/process.c:292: undefined reference to `VerQueryValue' :/mnt/data/opt/mono/mono/metadata/process.c:323: undefined reference to `VerLanguageName' collect2: ld returned 1 exit status make[3]: *** [pedump] Error 1 I use ./configure --with-moonlight=yes as the configuration command... sugestions? Thanks. Mauricio ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] InterOp problems with 1.2.6pre2
Am 30.11.2007 um 22:10 schrieb Prakash Punnoor: On the day of Friday 30 November 2007 Robert Jordan hast written: The layouts don't match, since declaring a field private won't magically subtract it from struct layout. It would help if you'd look at the svn version as I wrote in my mail. Reading helps, really Careful there: You are writing to the development list of Mono and you seem to want help for a problem you are encountering with some third party library. So first of all, this is actually off-topic for this list in two aspects. To get help non-the-less, file a proper bug report with a self-contained test case, best place would be in Novell's Bugzilla with a link here. Pointing people to some SVN code they have to checkout and configure etc. is definitely not a self- contained test-case. And when you do provide code then it's your responsibility to make sure it's the correct code you're talking of, not Robert's. See: http://www.mono-project.com/Bugs Andreas ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] InterOp problems with 1.2.6pre2
Prakash Punnoor wrote: Aften's context does not declare a float array at this position. But it has a void* and to my understanding float[] can be marshalled to void*. It works with the methods, as well, which have void* as parameters. Here is the end of your C# struct declaration: public int SampleRate; internal A52SampleFormat SampleFormat; public float[] InitialSamples; // the trouble maker private IntPtr m_Context; And this is the C declaration: /** * Audio sample rate in Hz */ int samplerate; /** * Audio sample format * default: A52_SAMPLE_FMT_S16 */ A52SampleFormat sample_format; /** * Used internally by the encoder. The user should leave this alone. * It is allocated in aften_encode_init and free'd in aften_encode_close. */ void *private_context; The layouts don't match, since declaring a field private won't magically subtract it from struct layout. Robert ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] [PATCH] SoapHttpClientProtocol Thread Safety fix.
Hi Arina, I'm experiencing some problems with WebService client with mono : I get some : Error thrown in application CASServer, message is : Error getting response stream (ReadDone2): ReceiveFailure Exception System.Net.WebException: Error getting response stream (ReadDone2): ReceiveFailure --- System.Exception: at System.Net.WebConnection.HandleError () at System.Net.WebConnection.ReadDone () at System.MulticastDelegate.invoke_void_IAsyncResult () at System.Net.Sockets.Socket+SocketAsyncResult.Complete () at System.Net.Sockets.Socket+Worker.Receive () at System.MulticastDelegate.invoke_void () at System.Net.WebConnection.HandleError (WebExceptionStatus st, System.Exception e, System.String where) [0x0] --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x0] at System.Net.HttpWebRequest.GetResponse () [0x0] at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse (System.Net.WebRequest request) [0x0] On our production server... but i can't reproduce this specific problem on my dev machine. Does your patch is related to this kind of problem? Had you ever get such problems? Thanks Le jeudi 15 novembre 2007 à 04:56 -0800, Arina Itkes a écrit : Hi all, Please review the attached patch. It contains synchronization fix for the class WebClientAsyncResult and light changes for the class WebClientProtocol that is a base of SoapHttpClientProtocol for thread safety purpose. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list _ Ce message et les éventuels documents joints peuvent contenir des informations confidentielles. Au cas où il ne vous serait pas destiné, nous vous remercions de bien vouloir le supprimer et en aviser immédiatement l'expéditeur. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est formellement interdite. Les communications sur internet n'étant pas sécurisées, l'intégrité de ce message n'est pas assurée et la société émettrice ne peut être tenue pour responsable de son contenu. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Profiler and coverage problem?
Hello, I simplified the problem: MinProba.cs: using System; class ParentClass { private int tval = 1; public int PValue { get { return 2*tval; } } } class ChildClass : ParentClass { public void Func() { Console.WriteLine(Child value: + PValue); } } public class MinProba { public static void Main(String[] args) { ChildClass cc = new ChildClass(); cc.Func(); } } Compiling: gmcs -debug MinProba.cs Running with trace: mono --trace MinProba.exe MinProba.exe.trace Running with Monocov: mono --debug --profile=monocov MinProba.exe It says, the ParentClass.PValue (get_PValue) is not used, but we can see its value on the screen. Why isn't it covered? I would like it to be in the COV file. Thanks in advance, Csaba ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] patch winform resource reader
Olivier, As you mention in your patch, you need unit tests to verify whether the behavior matches the MS implementation. I suggest submitting a bug report, and attaching the current patch before continueing working on it. Thay way the patch will not get lost in all the noise ... Gert - Original Message - From: olivier dufour [EMAIL PROTECTED] To: mono-devel-list@lists.ximian.com Sent: Friday, November 30, 2007 7:45 AM Subject: [Mono-dev] patch winform resource reader OK, I have done a small part at work. So I have forget to change the convention on it. I have attach the fixed patch. 2007/11/30, Jb Evain [EMAIL PROTECTED] : Hey, On 11/30/07, olivier dufour [EMAIL PROTECTED] wrote: Can someone check it before I commit. Please do not commit this as it is. The code: * doesn't respect the Mono coding conventions, * mixes spaces and tabs all over the place. -- Jb Evain [EMAIL PROTECTED] ___ 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] ASP.NET Futures ?
And silverlight :) On Nov 30, 2007 10:02 AM, Miguel de Icaza [EMAIL PROTECTED] wrote: By the way I meant ASP.NET Futures. Not Control toolkit. Is that working too ? We do not tend to implement APIs that are under development. We make a few exceptions (Work on the C# compiler 3.0 before 3.0 shipped) but this is not one of them. -- Warning: If you are reading this then this warning is for you. Every word you read of this useless fine print is another second off your life. Don't you have other things to do? Is your life so empty that you honestly can't think of a better way to spend these moments? Or are you so impressed with authority that you give respect and credence to all that claim it? Do you read everything you're supposed to read? Do you think every thing you're supposed to think? Buy what you're told to want? Get out of your apartment. Meet a member of the opposite sex. Stop the excessive shopping and masturbation.Quit your job. Start a fight. Prove you're alive. If you don't claim your humanity you will become a statistic. You have been warned - Onur ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] InterOp problems with 1.2.6pre2
On the day of Friday 30 November 2007 Robert Jordan hast written: Prakash Punnoor wrote: Aften's context does not declare a float array at this position. But it has a void* and to my understanding float[] can be marshalled to void*. It works with the methods, as well, which have void* as parameters. Here is the end of your C# struct declaration: public int SampleRate; internal A52SampleFormat SampleFormat; public float[] InitialSamples; // the trouble maker private IntPtr m_Context; And this is the C declaration: /** * Audio sample rate in Hz */ int samplerate; /** * Audio sample format * default: A52_SAMPLE_FMT_S16 */ A52SampleFormat sample_format; /** * Used internally by the encoder. The user should leave this alone. * It is allocated in aften_encode_init and free'd in aften_encode_close. */ void *private_context; The layouts don't match, since declaring a field private won't magically subtract it from struct layout. It would help if you'd look at the svn version as I wrote in my mail. Reading helps, really -- (°= =°) //\ Prakash Punnoor /\\ V_/ \_V signature.asc Description: This is a digitally signed message part. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] Debugger: Small patch
Hi Martin, attached you can find a small patch for the Mono Debugger (against SVN revision 90461). It fixes some minor issues: *) backend/server/i386-arch.c backend/server/x86_64-arch.c x86_arch_get_registers(): Store the return values everytime to result to check for errors. *) backend/server/x86-linux-ptrace.c server_ptrace_get_application(): increase size of buffer by 1 *) classes/DebuggerOptions.cs Update usage output, update Copyright information *) frontend/Command.cs Update copyright information, fix typos in command descriptions Please check the patch and apply it to the Mono repository if you're comfortable with it. Best regards, Harald Krapfenbauer diff_rev90461.patch Description: diff_rev90461.patch ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] ASP.NET Futures ?
By the way I meant ASP.NET Futures. Not Control toolkit. Is that working too ? We do not tend to implement APIs that are under development. We make a few exceptions (Work on the C# compiler 3.0 before 3.0 shipped) but this is not one of them. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] Profiler and coverage problem?
Hi, I try to check the monocov (0.2) tool for testing the code coverage. I have found something unclear. A small sample: using System; using System.Xml; public class MinProba { public static void Main(String[] args) { XmlTextReader reader = new XmlTextReader(test.xml); reader.Read(); reader.Close(); } } The test.xml is just a sample. Compiling: gmcs -debug MinProba.csormcs -debug MinProba.cs Running with monocov: mono --debug --profile=monocov MinProba.exe Result: Dumping coverage data to MinProba.exe.cov ... Done. At the point of reader.Read() we call the System.Xml.XmlTextReader Read method. Its source (from XmlTextReader.cs): public override bool Read () { ... if (Binary != null) Binary.Reset (); ... } This Binary property is from the parent class (XmlReader). There is no XmlReader.get_Binary method tag in the generated COV file, but it obviously called. Only the XmlReader .ctor call tag is there. If I use the mono --debug --trace MinProba.exe, the problem is the same. I have disassembled the System.Xml.dll, and this function call is there! What is wrong? Is it a monocov or mono profiler interface problem? Thank you in advance, Csaba ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list