Re: [Mono-dev] Configuration.HasFile returning wrong value in Mono

2016-06-10 Thread Greg Young
Looks like its appending the .config (note it takes an exeFile parameter).

On Fri, Jun 10, 2016 at 2:20 PM, MarLOne  wrote:
> Hi,
>
> I am using C# in Mono in Mint17 - Mono JIT compiler version 4.2.3 (Stable
> 4.2.3.4/832de4b Wed Mar 16 13:19:08 UTC 2016)
>  and come across this problem picked up by my NUnit code when I am moving
> code from Windows/CLR to Mono.
>
> I obtain the *Configuration* object by using
> *ConfigurationManager.OpenExeConfiguration( string exePath )*. When I pass
> to it a path like this: /home/testapp/MyApp.exe.config, the method returns a
> non-null object, same as in CLR.
>
> However the Config.FilePath becomes /home/testapp/MyApp.exe.config.config
> which clearly is not a conventional config file name for an executable.
> File.Exists() with this path returning false, as expected.
>
> However, Config.HasFile returning true in Mono while it is false in CLR.
> Clearly this value should be false in view of File.Exists() returning false.
>
> Can someone explains why this anomaly between CLR and Mono?
>
> Here is my Unit test code:
>
>
> L5 fails in Mono while it does not fail in Windows/CLR. Why?
>
> MarLOne
>
>
>
> --
> View this message in context: 
> http://mono.1490590.n4.nabble.com/Configuration-HasFile-returning-wrong-value-in-Mono-tp4667959.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> ___
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Profiler: ThreadStart/ThreadEnd

2016-05-29 Thread Greg Young
>From running and testing it seems that Start/End are called on the
thread in question. Can I assume this to be the case in the future?
Basically I have some thread clean up work I would like to do in
ThreadEnd and would prefer to just be able to do it here. Are there
some situations where ThreadStart/ThreadEnd might be called on from a
thread that is not the target thread?
-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Mono crashes on copying of running profiler

2016-05-29 Thread Greg Young
Mono JIT compiler version 4.2.3 (Stable 4.2.3.4/832de4b Wed Mar 16
13:19:08 UTC 2016)

~/src/EventStore on  release-v3.6.0! ⌚ 11:09:02
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily


When running mono with a profiler running and I copy a new version of
the profiler over the old version it immediately crashes the mono
process.

I can't see anything at all in my code which would cause this (but I
don't rule out that its a possibility).

Any ideas?

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] TCP connects

2016-05-27 Thread Greg Young
OK I spent some more time looking through this. There is a ton of not
really async stuff happening in async methods also
cancellations/timeouts/etc don't work properly. Moral of the story for
people searching this in the future etc, use the PCL version which
seems to work thus far.



On Thu, May 26, 2016 at 5:36 PM, Greg Young <gregoryyou...@gmail.com> wrote:
> In looking through a recent issue, when a node disappears we end up with:
>
> "Threadpool worker" at  <0x>
> at (wrapper managed-to-native)
> System.Net.Sockets.Socket.Connect_internal
> (intptr,System.Net.SocketAddress,int&) <0x>
> at System.Net.Sockets.Socket.Connect (System.Net.EndPoint) <0x00135>
> at System.Net.WebConnection.Connect (System.Net.HttpWebRequest) <0x00615>
> at System.Net.WebConnection.InitConnection (object) <0x0031a>
> at System.Net.WebConnection.m__0 (object) <0x00024>
> at (wrapper runtime-invoke)
> .runtime_invoke_void__this___object
> (object,intptr,intptr,intptr) <0x>
>
> "Threadpool worker" at  <0x>
> at (wrapper managed-to-native)
> System.Net.Sockets.Socket.Connect_internal
> (intptr,System.Net.SocketAddress,int&) <0x>
> at System.Net.Sockets.Socket.Connect (System.Net.EndPoint) <0x00135>
> at System.Net.WebConnection.Connect (System.Net.HttpWebRequest) <0x00615>
> at System.Net.WebConnection.InitConnection (object) <0x0031a>
> at System.Net.WebConnection.m__0 (object) <0x00024>
> at (wrapper runtime-invoke)
> .runtime_invoke_void__this___object
> (object,intptr,intptr,intptr) <0x>
>
> On every thread from our async code. As the connection is timing out
> the entire ThreadPool very quickly blocks.
>
> https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/WebConnection.cs#L195
>
> I am guessing the right fix here would be to use async connect?
>
> Cheers,
>
> Greg
>
>
> --
> Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] TCP connects

2016-05-26 Thread Greg Young
In looking through a recent issue, when a node disappears we end up with:

"Threadpool worker" at  <0x>
at (wrapper managed-to-native)
System.Net.Sockets.Socket.Connect_internal
(intptr,System.Net.SocketAddress,int&) <0x>
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint) <0x00135>
at System.Net.WebConnection.Connect (System.Net.HttpWebRequest) <0x00615>
at System.Net.WebConnection.InitConnection (object) <0x0031a>
at System.Net.WebConnection.m__0 (object) <0x00024>
at (wrapper runtime-invoke)
.runtime_invoke_void__this___object
(object,intptr,intptr,intptr) <0x>

"Threadpool worker" at  <0x>
at (wrapper managed-to-native)
System.Net.Sockets.Socket.Connect_internal
(intptr,System.Net.SocketAddress,int&) <0x>
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint) <0x00135>
at System.Net.WebConnection.Connect (System.Net.HttpWebRequest) <0x00615>
at System.Net.WebConnection.InitConnection (object) <0x0031a>
at System.Net.WebConnection.m__0 (object) <0x00024>
at (wrapper runtime-invoke)
.runtime_invoke_void__this___object
(object,intptr,intptr,intptr) <0x>

On every thread from our async code. As the connection is timing out
the entire ThreadPool very quickly blocks.

https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/WebConnection.cs#L195

I am guessing the right fix here would be to use async connect?

Cheers,

Greg


-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Cross Platform on Linux/Windows with Mono.Posix reference on Linux

2016-04-07 Thread Greg Young
"I thought Greg's reply would be useful to tell MonoDevelop on Linux
not to even reference the nuget package, but I didn't get that
working."

Mine was for VS / msbuild / xbuild. I don't know about MonoDevelop.

On Wed, Apr 6, 2016 at 9:01 PM, Jason Curl <jcurln...@arcor.de> wrote:
> Thanks all for your ideas.
>
> My project (github.com/jcurl/serialportstream) ended up including Mono.Posix
> via nuget to allow it to compile on Windows. I found an option that doesn't
> copy the assembly to the target path. I thought Greg's reply would be useful
> to tell MonoDevelop on Linux not to even reference the nuget package, but I
> didn't get that working. The IDE would still parse the entries and download
> from NuGet. So i assume when I compile on Linux, it's linking against the
> nuget version and not the OS version, but when running, it must be using the
> OS version and the library isn't copied to the destination.
>
> I had already implemented a factory OO model, which I use to instantiate
> either WinNativeSerial or UnixNativeSerial on knowing the environment
> platform ID that's in use.
>
> If "the JIT compiler can or will or might in the future, eagerly link
> assemblies at runtime" were sometime to become true, then I've got a problem
> - I certainly don't want to distribute Mono.Posix.
>
> Could I expect problems when compiling against a different version (nuget)
> that is being used at run-time (os)?
>
> Thankyou!
>
>
> On 29/03/2016 17:58, Chris Swiedler wrote:
>>
>> Why not just include references to Mono.Posix.dll in the Windows build?
>> You don't have to install the full framework. We have a similar issue with
>> server apps that are developed on Windows and run on Linux. We just put a
>> win32 build of Mono into our source tree and added Mono.Posix as a
>> reference. Everywhere we invoke any Posix code, we just wrap the statements
>> in something like "if  (Environment.OSVersion.Platform == PlatformID.Unix)".
>>
>> chris
>>
>> -Original Message-
>> From: mono-devel-list-boun...@lists.ximian.com
>> [mailto:mono-devel-list-boun...@lists.ximian.com] On Behalf Of Edward Ned
>> Harvey (mono)
>> Sent: Tuesday, March 29, 2016 5:49 AM
>> To: Greg Young <gregoryyou...@gmail.com>; Jason Curl <jcurln...@arcor.de>
>> Cc: mono-devel-list@lists.ximian.com
>> Subject: Re: [Mono-dev] Cross Platform on Linux/Windows with Mono.Posix
>> reference on Linux
>>
>>> From: mono-devel-list-boun...@lists.ximian.com
>>> [mailto:mono-devel-list- boun...@lists.ximian.com] On Behalf Of Greg
>>> Young
>>>
>>> >> />
>>
>> (for clarification of my previous response, because I was asked for
>> clarification off-list)
>>
>> If you have some code that calls Mono.Posix.Something(), and you have a
>> conditional reference to Mono.Posix in the project, then you're able to
>> build on Mono, but on windows, without the reference, your call to
>> Mono.Posix.Something() will not compile, which prevents you from building,
>> even though at runtime you might never make that call. In order to compile
>> on windows, you'll need to comment-out your Mono.Posix.Something() line, via
>> #if or [Conditional], which means you need a compiler symbol to indicate
>> whether you're building on mono or windows. This could be either separate
>> project files, or multiple build configurations. (Or dynamically generated
>> project files).
>>
>> Maybe you can have a conditional reference to Mono.Posix on mono, and have
>> a separate conditional reference to ../../ExtraClassLibraries/Mono.Posix.dll
>> on windows, with copy-to-destination, so you can get the same code to build
>> on both mono and windows, resulting in an effectively identical
>> cross-platform binary... But I'm almost certain I recall somebody on this
>> list telling me, that the JIT compiler can or will or might in the future,
>> eagerly link assemblies at runtime (or just before runtime), so the
>> Mono.Posix.dll file must be present on windows at runtime in order to avoid
>> runtime exceptions, even though the runtime code execution will never
>> execute that path.
>>
>> You avoid all these problems by abstracting the functionality you want
>> into an interface or abstract class, and using a factory to perform a
>> runtime dynamic load of a mono-specific or windows-specific assembly with a
>> derivative class. You can build the mono-specific assembly on mono, or maybe
>> you can use the double-conditional described above and get the mono-specific
>> assembly to also be buildable on windows. No need 

Re: [Mono-dev] Regressions on 3.13.0-46-generic -> 3.13.0-48-generic

2016-04-06 Thread Greg Young
So we have just seen an issue that looks oddly familiar to this in kernel 4.4.5

On Mon, Sep 21, 2015 at 10:03 PM, Greg Young <gregoryyou...@gmail.com> wrote:
> I am surprised to see no one else post on this.
>
> I would think a massive regression that prevents mono from running
> multi-threaded code on a multi-cpu system (including in the future on
> any v4 kernel) might be an issue that people would be concerned
> about?!
>
>
>
> On Thu, Sep 17, 2015 at 4:03 PM, Greg Young <gregoryyou...@gmail.com> wrote:
>> So to follow up on this.
>>
>> The fix that was put in for this has since been reverted as mentioned
>> in the bug above.
>>
>> https://github.com/torvalds/linux/commit/73459e2a1ada09a68c02cc5b73f3116fc8194b3d
>>
>> So all 4 kernels will have this issue. I'm not really sure what needs
>> to be done on the mono side here to avoid this issue but it would seem
>> to affect any multi-threaded code running on multiple cpu linux
>> systems (which I would imagine would be a vast majority of mono
>> installations).
>>
>> Greg
>>
>> On Thu, Sep 17, 2015 at 1:05 PM, Greg Young <gregoryyou...@gmail.com> wrote:
>>> I was just actually writing that this seems to be discussed here:
>>> https://bugzilla.xamarin.com/show_bug.cgi?id=29692 :) Thanks for the
>>> additional information.
>>>
>>>
>>>
>>> On Thu, Sep 17, 2015 at 1:01 PM, Taloth Saldono <talothsald...@gmail.com> 
>>> wrote:
>>>> This Ubuntu bug discusses the issue for 3.13.
>>>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1450584
>>>>
>>>> Please note that later kernel 4.0 versions exhibit similar issues, search
>>>> this mailinglist for specifics on that new regression. I gave up on
>>>> investigating further due to other obligations and the complexity of the
>>>> subject matter.
>>>>
>>>> Op 17 sep. 2015 11:49 schreef "Greg Young" <gregoryyou...@gmail.com>:
>>>>>
>>>>> 3.13.0-63-generic does not have the issue as well.
>>>>>
>>>>> I guess our mitigation will just be to know about the issue and
>>>>> suggest downgrade/upgrade. This may however be useful for others in
>>>>> the future. Mono 3.12.1 on 3.13.0-46-generic #77-Ubuntu SMP appears to
>>>>> not be stable. We will also test mono4 now.
>>>>>
>>>>> Greg
>>>>>
>>>>> On Thu, Sep 17, 2015 at 11:38 AM, Greg Young <gregoryyou...@gmail.com>
>>>>> wrote:
>>>>> > We are running into some interesting regressions with mono. We are
>>>>> > seeing many failures such as:
>>>>> >
>>>>> > Mono v3.12.1 (we have considered moving up to 4.1 or 4.2 but the last
>>>>> > time we tested it didn't seem safe to move).
>>>>> >
>>>>> > Native stacktrace:
>>>>> >
>>>>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x609a4f]
>>>>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x5bdecf]
>>>>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x453b19]
>>>>> > /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7fd9709b7340]
>>>>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x4e6145]
>>>>> > [0x40e21ceb]
>>>>> >
>>>>> >
>>>>> > [03041,21,13:43:11.379] Global Unhandled Exception occurred.
>>>>> > Object reference not set to an instance of an object
>>>>> > [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException:
>>>>> > Object reference not set to an instance of an object
>>>>> >   at EventStore.Core.Bus.QueuedHandlerAutoReset.ReadFromQueue
>>>>> > (System.Object o) [0x0] in :0
>>>>> >   at System.Threading.Thread.StartInternal () [0x0] in >>>> > unknown>:0
>>>>> >
>>>>> > note that this isn't a real nre
>>>>> >
>>>>> > We do not see these regressions in Linux ip-172-31-37-60
>>>>> > 3.13.0-46-generic #77-Ubuntu SMP
>>>>> >
>>>>> > We do see them in Linux ip-172-31-40-115 3.13.0-48-generic #80-Ubuntu
>>>>> > SMP
>>>>> >
>>>>> > Anyone have any ideas how to debug this further? These are not
>>>>> > deterministic issues.
>>>>> >
>>>>> > Cheers,
>>>>> >
>>>>> > Greg
>>>>> >
>>>>> > --
>>>>> > Studying for the Turing test
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Studying for the Turing test
>>>>> ___
>>>>> Mono-devel-list mailing list
>>>>> Mono-devel-list@lists.ximian.com
>>>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>>
>>>
>>>
>>> --
>>> Studying for the Turing test
>>
>>
>>
>> --
>> Studying for the Turing test
>
>
>
> --
> Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Cross Platform on Linux/Windows with Mono.Posix reference on Linux

2016-03-28 Thread Greg Young


On Mon, Mar 28, 2016 at 2:05 PM, Jason Curl  wrote:
> Hello,
>
> How can I reference Mono.Posix on Linux and still allow compilation on
> Windows without installation of Mono or extra Linux specific assemblies?
>
> I'm afraid of referencing via NuGet as I want the Mono runtime on the Linux
> installation to take preference over NuGet binaries on Linux. The Windows
> code path won't ever execute the code that's failing to compile, but I do
> not wish to use #define's as I need one binary that works cross-platform -
> in principle possible with Mono.
>
> Reflection is not suitable to convert compile-time to run-time due to the
> performance cost.
>
> My library needs to reference Mono.Posix under Linux to convert errno
> to/from system values and possibly other features in the future.
> ___
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Build Broken?

2016-03-02 Thread Greg Young
Ubuntu ubuntu 15.10 Following instructions from
http://www.mono-project.com/docs/compiling-mono/linux/

autogen fails:

runtime/Makefile.am:2: error: support for Cygnus-style trees has been removed



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] HttpListener stops accepting requests

2016-03-02 Thread Greg Young
I have to research a bit more and get a local build of mono building
but there are definitely some places here:

https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/EndPointListener.cs#L85

That can break the async loop causing the entire lsitener to stop
accepting requests until its restarted.

Cheers,

Greg

On Wed, Mar 2, 2016 at 4:58 PM, Greg Young <gregoryyou...@gmail.com> wrote:
> We have found a situation where HttpListener on mono (reproduced in
> linux/OSX) will permanently stop accepting requests.
>
> The issue involves ulimit. Basically if you get a connection flood
> greater than ulimit the server will stop accepting all requests until
> it is restarted.
>
> After the connection flood you can see the connections were all
> properly killed (I won't put all the ones that were there during the
> flood!):
>
> greg@clown:~$ lsof -p 16651
> lsof: WARNING: can't stat() tracefs file system /sys/kernel/debug/tracing
>   Output information may be incomplete.
> COMMAND PID USER   FD   TYPE DEVICE  SIZE/OFF NODE NAME
> eventstor 16651 greg  cwdDIR8,2  4096  2105316
> /home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0
> eventstor 16651 greg  rtdDIR8,2  40962 /
> eventstor 16651 greg  txtREG8,2  37443029  2105361
> /home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/eventstored
> eventstor 16651 greg  memREG8,2 92504 12849525
> /lib/x86_64-linux-gnu/libgcc_s.so.1
> eventstor 16651 greg  memREG8,2 51736 12845148
> /lib/x86_64-linux-gnu/libnss_files-2.21.so
> eventstor 16651 greg  memREG8,2 47616 12845159
> /lib/x86_64-linux-gnu/libnss_nis-2.21.so
> eventstor 16651 greg  memREG8,2 97224 12845153
> /lib/x86_64-linux-gnu/libnsl-2.21.so
> eventstor 16651 greg  memREG8,2 35688 12845149
> /lib/x86_64-linux-gnu/libnss_compat-2.21.so
> eventstor 16651 greg  memREG8,2   8464208  9444549
> /usr/lib/locale/locale-archive
> eventstor 16651 greg  memREG8,2   1869392 12845162
> /lib/x86_64-linux-gnu/libc-2.21.so
> eventstor 16651 greg  memREG8,2142080 12845083
> /lib/x86_64-linux-gnu/libpthread-2.21.so
> eventstor 16651 greg  memREG8,2 14592 12845158
> /lib/x86_64-linux-gnu/libdl-2.21.so
> eventstor 16651 greg  memREG8,2 31680 12845075
> /lib/x86_64-linux-gnu/librt-2.21.so
> eventstor 16651 greg  memREG8,2   1084840 12845161
> /lib/x86_64-linux-gnu/libm-2.21.so
> eventstor 16651 greg  memREG8,2154376 12845156
> /lib/x86_64-linux-gnu/ld-2.21.so
> eventstor 16651 greg  memREG   0,21  4096   88 /dev/shm/mono.16651
> eventstor 16651 greg0u   CHR  136,1   0t04 /dev/pts/1
> eventstor 16651 greg1u   CHR  136,1   0t04 /dev/pts/1
> eventstor 16651 greg2u   CHR  136,1   0t04 /dev/pts/1
> eventstor 16651 greg3r     0,11 0 7966 anon_inode
> eventstor 16651 greg4u   REG8,2 8  2624038
> /home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/writer.chk
> eventstor 16651 greg5u   REG8,2 8  2624039
> /home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/chaser.chk
> eventstor 16651 greg6u   REG8,2 8  2624040
> /home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/epoch.chk
> eventstor 16651 greg7u   REG8,2 8  2624041
> /home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/truncate.chk
> eventstor 16651 greg8r   CHR1,9   0t0   11 /dev/urandom
> eventstor 16651 greg9u   REG8,2 268435712  2624042
> /home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/chunk-00.00
> eventstor 16651 greg   10r   REG8,2 268435712  2624042
> /home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/chunk-00.00
> eventstor 16651 greg   11r   REG8,2 268435712  2624042
> /home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/chunk-00.00
> eventstor 16651 greg   12r   REG8,2 268435712  2624042
> /home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/chunk-00.00
> eventstor 16651 greg   13r   REG8,2 268435712  2624042
> /home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/chunk-00.00
> eventstor 16651 greg   14r   REG8,2 268435712  2624042
> /home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/chunk-00.00
> eventstor 16651 greg   15u  IPv4 279150   0t0  TCP
> localhost:1113 (LISTEN)
> eventstor 16651 greg   16u     0,11 0 7966 anon_inode
> eventstor 16651 greg   17u  IPv4 278173   0t0  TCP
> localhost:2113 (LISTEN)
>
>
> My guess is that the too many 

[Mono-dev] HttpListener stops accepting requests

2016-03-02 Thread Greg Young
We have found a situation where HttpListener on mono (reproduced in
linux/OSX) will permanently stop accepting requests.

The issue involves ulimit. Basically if you get a connection flood
greater than ulimit the server will stop accepting all requests until
it is restarted.

After the connection flood you can see the connections were all
properly killed (I won't put all the ones that were there during the
flood!):

greg@clown:~$ lsof -p 16651
lsof: WARNING: can't stat() tracefs file system /sys/kernel/debug/tracing
  Output information may be incomplete.
COMMAND PID USER   FD   TYPE DEVICE  SIZE/OFF NODE NAME
eventstor 16651 greg  cwdDIR8,2  4096  2105316
/home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0
eventstor 16651 greg  rtdDIR8,2  40962 /
eventstor 16651 greg  txtREG8,2  37443029  2105361
/home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/eventstored
eventstor 16651 greg  memREG8,2 92504 12849525
/lib/x86_64-linux-gnu/libgcc_s.so.1
eventstor 16651 greg  memREG8,2 51736 12845148
/lib/x86_64-linux-gnu/libnss_files-2.21.so
eventstor 16651 greg  memREG8,2 47616 12845159
/lib/x86_64-linux-gnu/libnss_nis-2.21.so
eventstor 16651 greg  memREG8,2 97224 12845153
/lib/x86_64-linux-gnu/libnsl-2.21.so
eventstor 16651 greg  memREG8,2 35688 12845149
/lib/x86_64-linux-gnu/libnss_compat-2.21.so
eventstor 16651 greg  memREG8,2   8464208  9444549
/usr/lib/locale/locale-archive
eventstor 16651 greg  memREG8,2   1869392 12845162
/lib/x86_64-linux-gnu/libc-2.21.so
eventstor 16651 greg  memREG8,2142080 12845083
/lib/x86_64-linux-gnu/libpthread-2.21.so
eventstor 16651 greg  memREG8,2 14592 12845158
/lib/x86_64-linux-gnu/libdl-2.21.so
eventstor 16651 greg  memREG8,2 31680 12845075
/lib/x86_64-linux-gnu/librt-2.21.so
eventstor 16651 greg  memREG8,2   1084840 12845161
/lib/x86_64-linux-gnu/libm-2.21.so
eventstor 16651 greg  memREG8,2154376 12845156
/lib/x86_64-linux-gnu/ld-2.21.so
eventstor 16651 greg  memREG   0,21  4096   88 /dev/shm/mono.16651
eventstor 16651 greg0u   CHR  136,1   0t04 /dev/pts/1
eventstor 16651 greg1u   CHR  136,1   0t04 /dev/pts/1
eventstor 16651 greg2u   CHR  136,1   0t04 /dev/pts/1
eventstor 16651 greg3r     0,11 0 7966 anon_inode
eventstor 16651 greg4u   REG8,2 8  2624038
/home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/writer.chk
eventstor 16651 greg5u   REG8,2 8  2624039
/home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/chaser.chk
eventstor 16651 greg6u   REG8,2 8  2624040
/home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/epoch.chk
eventstor 16651 greg7u   REG8,2 8  2624041
/home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/truncate.chk
eventstor 16651 greg8r   CHR1,9   0t0   11 /dev/urandom
eventstor 16651 greg9u   REG8,2 268435712  2624042
/home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/chunk-00.00
eventstor 16651 greg   10r   REG8,2 268435712  2624042
/home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/chunk-00.00
eventstor 16651 greg   11r   REG8,2 268435712  2624042
/home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/chunk-00.00
eventstor 16651 greg   12r   REG8,2 268435712  2624042
/home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/chunk-00.00
eventstor 16651 greg   13r   REG8,2 268435712  2624042
/home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/chunk-00.00
eventstor 16651 greg   14r   REG8,2 268435712  2624042
/home/greg/Downloads/EventStore-OSS-Ubuntu-14.04-v3.5.0/data/chunk-00.00
eventstor 16651 greg   15u  IPv4 279150   0t0  TCP
localhost:1113 (LISTEN)
eventstor 16651 greg   16u     0,11 0 7966 anon_inode
eventstor 16651 greg   17u  IPv4 278173   0t0  TCP
localhost:2113 (LISTEN)


My guess is that the too many files kills the asynchronous loop around
the accept in the httplistener code and will take a look there.
Perhaps someone else has some ideas.

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Profile with optimizations

2016-01-08 Thread Greg Young
Hmm I have yet to see in any test runs the behaviour of optimizations
like inlining enabled. I would assume a simple test case should
produce it? If optimizations are enabled (and I can reproduce it) is
there any way to disable them as a profiler?

On Fri, Jan 8, 2016 at 8:47 PM, Alex Rønne Petersen <a...@alexrp.com> wrote:
> Hey Greg,
>
> Do you have a test case that demonstrates what you're seeing? From
> what I can see, the runtime should not be disabling optimizations just
> because the profiler is attached. However, if you're running with
> --debug or some such option, all optimizations will be off.
>
> Regards,
> Alex
>
> On Fri, Jan 8, 2016 at 1:25 PM, Greg Young <gregoryyou...@gmail.com> wrote:
>> It may be in the new profiling API changes that are there but I can't
>> seem to find it in the older profiling api. Is there a way to enable
>> JIT optimizations such as inlining and profile? It seems enabling
>> profiler always disables optimizations.
>>
>> Cheers,
>>
>> Greg
>>
>> --
>> Studying for the Turing test
>> ___
>> Mono-devel-list mailing list
>> Mono-devel-list@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Profile with optimizations

2016-01-08 Thread Greg Young
It may be in the new profiling API changes that are there but I can't
seem to find it in the older profiling api. Is there a way to enable
JIT optimizations such as inlining and profile? It seems enabling
profiler always disables optimizations.

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Profiling API selective registration

2016-01-05 Thread Greg Young
disregard email.

Thanks,

Greg

On Tue, Jan 5, 2016 at 5:28 PM, Greg Young <gregoryyou...@gmail.com> wrote:
> In dealing with very tight code and measuring mono we have found that
> even registering empty handlers from a profiler can cost about 50% of
> performance. Is there (or are there plans) for allowing a profiler to
> selectively register to allow for better performance? From
> benchmarking here a key one would be "no properties" as they tend to
> be the ones where overhead is largest proportionally (and there are
> tons of them).
>
> For most application scenarios we have tested there is no problem...
>
> Cheers,
>
> Greg
>
> --
> Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Profiling API selective registration

2016-01-05 Thread Greg Young
In dealing with very tight code and measuring mono we have found that
even registering empty handlers from a profiler can cost about 50% of
performance. Is there (or are there plans) for allowing a profiler to
selectively register to allow for better performance? From
benchmarking here a key one would be "no properties" as they tend to
be the ones where overhead is largest proportionally (and there are
tons of them).

For most application scenarios we have tested there is no problem...

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Is property?

2016-01-04 Thread Greg Young
Maybe explaining the use case a bit more is worthwhile. I am running
in the context of the profiling API. In many bits of code it is
prohibitively expensive (and not at all valuable) to look at
getters/setters. Even doing a hash lookup in them adds significant
overhead (think code that tends to use getters/setters for all field
access or code doing bunches of serialization).

I am looking for a way to fail fast on them, getting the name and
checking would be more expensive than the hash lookup.

On Mon, Jan 4, 2016 at 5:52 PM, Greg Young <gregoryyou...@gmail.com> wrote:
> Is there an easy way to test METHOD_ATTRIBUTE_SPECIAL_NAME for a MonoMethod *?
>
> On Mon, Jan 4, 2016 at 5:50 PM, Jb Evain <jbev...@gmail.com> wrote:
>> Hi Greg,
>>
>> I'm afraid there's no exact flag for that. The best approximation
>> would be to test that it is flagged METHOD_ATTRIBUTE_SPECIAL_NAME, and
>> that its name starts with "set_" or "get_".
>>
>> Short of that, you'll need to iterate over the properties of the class
>> and check that one of its methods points to your MonoMethod.
>>
>> Jb
>>
>>
>>
>> On Mon, Jan 4, 2016 at 4:36 AM, Greg Young <gregoryyou...@gmail.com> wrote:
>>> How can you figure out if a method is a property from a MonoMethod *?
>>>
>>> I have poked around looking for this for an hour or so and can't find it.
>>>
>>> Cheers,
>>>
>>> Greg
>>>
>>> --
>>> Studying for the Turing test
>>> ___
>>> Mono-devel-list mailing list
>>> Mono-devel-list@lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
>
> --
> Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Is property?

2016-01-04 Thread Greg Young
How can you figure out if a method is a property from a MonoMethod *?

I have poked around looking for this for an hour or so and can't find it.

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Is property?

2016-01-04 Thread Greg Young
Is there an easy way to test METHOD_ATTRIBUTE_SPECIAL_NAME for a MonoMethod *?

On Mon, Jan 4, 2016 at 5:50 PM, Jb Evain <jbev...@gmail.com> wrote:
> Hi Greg,
>
> I'm afraid there's no exact flag for that. The best approximation
> would be to test that it is flagged METHOD_ATTRIBUTE_SPECIAL_NAME, and
> that its name starts with "set_" or "get_".
>
> Short of that, you'll need to iterate over the properties of the class
> and check that one of its methods points to your MonoMethod.
>
> Jb
>
>
>
> On Mon, Jan 4, 2016 at 4:36 AM, Greg Young <gregoryyou...@gmail.com> wrote:
>> How can you figure out if a method is a property from a MonoMethod *?
>>
>> I have poked around looking for this for an hour or so and can't find it.
>>
>> Cheers,
>>
>> Greg
>>
>> --
>> Studying for the Turing test
>> ___
>> Mono-devel-list mailing list
>> Mono-devel-list@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Profiler Locations

2015-11-13 Thread Greg Young
In OSX Capitan you can't install something to /usr/lib. I figured mono
installation/lib would work for installing a profiler but still not
found. Where is the correct place to install a profiler?

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Profiler Loading Issues

2015-11-10 Thread Greg Young
I would expect --verbose to give me information like this.

On Mon, Nov 2, 2015 at 8:13 AM, Alex Rønne Petersen <a...@alexrp.com> wrote:
> IIRC we just use dlopen(3) to load the profiler. So as far as Mono is
> concerned, the best you'll get is the dlerror(3) output. You might be
> able to get more detailed information with tools like strace(1),
> file(1), etc, though.
>
> Regards,
> Alex
>
> On Mon, Nov 2, 2015 at 8:13 AM, Greg Young <gregoryyou...@gmail.com> wrote:
>> Just in general. As an example if someone copies over a 64 bit build
>> for a 32 bit installation.
>>
>> Or if someone has copied files into a bad location. Or if a profiler
>> is just not being loaded for some unknown reason.
>>
>> Crashes have been pretty easy to debug so far.
>>
>> On Mon, Nov 2, 2015 at 7:51 AM, Alex Rønne Petersen <a...@alexrp.com> wrote:
>>> Hi,
>>>
>>> Can you be a bit more specific about the issue? Is it a crash or something 
>>> else?
>>>
>>> Regards,
>>> Alex
>>>
>>> On Sun, Nov 1, 2015 at 12:41 PM, Greg Young <gregoryyou...@gmail.com> wrote:
>>>> Is there any good way of debugging profiler loading issues?
>>>>
>>>> Greg
>>>>
>>>> --
>>>> Studying for the Turing test
>>>> ___
>>>> Mono-devel-list mailing list
>>>> Mono-devel-list@lists.ximian.com
>>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>>
>>
>> --
>> Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Profiler Loading Issues

2015-11-01 Thread Greg Young
Is there any good way of debugging profiler loading issues?

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Profiler Loading Issues

2015-11-01 Thread Greg Young
Just in general. As an example if someone copies over a 64 bit build
for a 32 bit installation.

Or if someone has copied files into a bad location. Or if a profiler
is just not being loaded for some unknown reason.

Crashes have been pretty easy to debug so far.

On Mon, Nov 2, 2015 at 7:51 AM, Alex Rønne Petersen <a...@alexrp.com> wrote:
> Hi,
>
> Can you be a bit more specific about the issue? Is it a crash or something 
> else?
>
> Regards,
> Alex
>
> On Sun, Nov 1, 2015 at 12:41 PM, Greg Young <gregoryyou...@gmail.com> wrote:
>> Is there any good way of debugging profiler loading issues?
>>
>> Greg
>>
>> --
>> Studying for the Turing test
>> ___
>> Mono-devel-list mailing list
>> Mono-devel-list@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] 100ms pauses

2015-10-31 Thread Greg Young
I have been looking into this passively for months but just saw others
having it as well so I am thinking it might be in mono itself. When
doing latency measurements we always are +-3-5 with a tail latency
(say 99.9-99.99% of almost exactly 100ms). I have tried to sort out
what may be causing it...

Just saw someone else having it. I was thinking it was somewhere in
the TCP code but they mentioned they get it with libuv as well.

Anyone have any thoughts where could be good to look? I have profiled
and its not GC.

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] malloc error executing OBS-built mono

2015-10-23 Thread Greg Young
You will need to grab the valgrind suppression file as well.

https://github.com/mono/mono/blob/master/data/mono.supp

http://www.mono-project.com/docs/debug+profile/debug/

HTH,

Greg

On Thu, Oct 22, 2015 at 7:08 PM, Miguel de Icaza  wrote:
> Hello,
>
> Well, the great news is that this happens without involving the JIT or GC -
> it happens just at startup, so this is a plain-old C bug.
>
> Your best bet is now to run this with Valgrind and see what it tells you.
>
> On Thu, Oct 22, 2015 at 12:04 PM, Miguel González
>  wrote:
>>
>> I executed a sample command (gacutils.exe -l) under gdb to see the trace
>> at the time of the crash.
>>
>>
>>
>> This is the backtrace as returned by gdb:
>>
>>
>>
>> Program received signal SIGABRT, Aborted.
>>
>> 0xf7e1b245 in raise () from /lib/libc.so.6
>>
>> #0  0xf7e1b245 in raise () from /lib/libc.so.6
>>
>> #1  0xf7e1cac3 in abort () from /lib/libc.so.6
>>
>> #2  0xf7e635cb in malloc_printerr () from /lib/libc.so.6
>>
>> #3  0xf7e63aec in top_check () from /lib/libc.so.6
>>
>> #4  0xf7e65b13 in malloc_check () from /lib/libc.so.6
>>
>> #5  0xf7e66c45 in malloc () from /lib/libc.so.6
>>
>> #6  0xf7e6b071 in strdup () from /lib/libc.so.6
>>
>> #7  0x0827d54c in monoeg_g_strsplit ()
>>
>> #8  0x081b70a5 in arch_matches ()
>>
>> #9  0x081b70fa in arch_matches ()
>>
>> #10 0x081b7770 in dllmap_start ()
>>
>> #11 0x08283f42 in monoeg_g_markup_parse_context_parse ()
>>
>> #12 0x081b6e38 in mono_config_parse_xml_with_context ()
>>
>> #13 0x081b6f6d in mono_config_parse_file_with_context ()
>>
>> #14 0x081b6fd7 in mono_config_parse_file ()
>>
>> #15 0x081b808c in mono_config_parse ()
>>
>> #16 0x080c1449 in mono_main ()
>>
>> #17 0x08065e52 in main ()
>>
>>
>>
>> It seems to be failing when the /etc/mono/config file is loaded. This is
>> the config file contents. The zlib line has been manually added to the code
>> retrieved from GitHub.
>>
>> 
>>
>>
>>
>>
>>
>>
>>
>>> os="solaris"/>
>>
>>> os="solaris"/>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>> target="$mono_libdir/libMonoPosixHelper.so" os="!windows" />
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>> os="!windows"/>
>>
>>> os="!windows"/>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>> target="mono_win32_compat_CopyMemory"/>
>>
>>> target="mono_win32_compat_FillMemory"/>
>>
>>> target="mono_win32_compat_MoveMemory"/>
>>
>>> target="mono_win32_compat_ZeroMemory"/>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> 
>>
>>
>>
>> Anyway, as I mentioned, we’re putting the openSUSE 12.3 build aside. We’ve
>> noticed that openSUSE 12.3, 13.1 and 13.2 can work with our openSUSE 12.2
>> repository.
>>
>>
>>
>> Miguel
>>
>>
>>
>> From: mono-devel-list-boun...@lists.ximian.com
>> [mailto:mono-devel-list-boun...@lists.ximian.com] On Behalf Of Miguel
>> González
>> Sent: 22 October 2015 10:49
>> To: Miguel de Icaza 
>>
>>
>> Cc: mono-devel-list@lists.ximian.com
>> Subject: Re: [Mono-dev] malloc error executing OBS-built mono
>>
>>
>>
>> Hi Miguel,
>>
>>
>>
>> Thanks for the update :-) I had also an e-mail from Zoltan Varga yesterday
>> telling me that the change had been applied. I updated my code accordingly
>> to see if that could be the fix for my issue, too… But it didn’t :-(
>>
>>
>>
>> I’ll try using gdb as you suggested. I hadn’t considered it before since
>> this crash only happens inside the automated build of the OBS worker virtual
>> machine and I’ve not been able to reproduce in any other environment.
>> However, any additional info is always appreciated! There are also chances
>> of ditching this build and relying on other distros to build our packages,
>> since our OpenSUSE packages seem to be highly compatible between versions.
>>
>>
>>
>> Thank you,
>>
>>
>>
>> Miguel
>>
>>
>>
>> From: Miguel de Icaza [mailto:mig...@xamarin.com]
>> Sent: 21 October 2015 20:44
>> To: Miguel González 
>> Cc: mono-devel-list@lists.ximian.com
>> Subject: Re: [Mono-dev] malloc error executing OBS-built mono
>>
>>
>>
>> Hello Miguel,
>>
>>
>>
>> I also had to apply this change in order to avoid an unallowed warning
>> message:
>>
>> I: Statement might be overflowing a buffer in strncat. Common mistake:
>>
>>BAD: strncat(buffer,charptr,sizeof(buffer)) is wrong, it takes the
>>
>>left over size as 3rd argument
>>
>>GOOD: strncat(buffer,charptr,sizeof(buffer)-strlen(buffer)-1)
>>
>>
>>
>> We replaced that code with the glib string operations just yesterday:
>>
>>
>>
>> 042ddd504c09977682bb48010c5642390826d1da
>>
>>
>>
>> But thanks for sharing.
>>
>>
>>
>> At this point I’m able to build mono RPM packages and they’re working as I
>> install them using a test OpenSUSE 12.3 virtual machine. However, when the
>> GTK# builds are started –which use the mono packages as build requirement–,
>> the worker is 

[Mono-dev] Profiling: Tail calls

2015-10-16 Thread Greg Young
Is there anything to let you know that a tail call was made in the
profiling api? I haven't see anything so far but figured I might have
missed it.

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] 32 bit mono

2015-10-10 Thread Greg Young
Is there a timeframe on this? Trying to do a CBA on setting up the
automation for doing 32 bit mono compiles/tests/etc

On Sat, Oct 10, 2015 at 3:22 PM, Miguel de Icaza <mig...@xamarin.com> wrote:
> Hello,
>
> Yes, we are planning on shipping the 64 bit release.
>
> It is necessary for Roslyn, because Roslyn consumes so much more memory that
> large projects need to run on 64.
>
> On Sat, Oct 10, 2015 at 6:23 AM, Greg Young <gregoryyou...@gmail.com> wrote:
>>
>> As of now 32 bit mono is still being shipped with xamarin studio as I
>> understand for osx. Are there plans to start shipping 64 bit? Just
>> trying to figure out if its worth supporting a 32 bit build of our
>> profiler backend for mono.
>>
>> Cheers,
>>
>> Greg
>>
>> --
>> Studying for the Turing test
>> ___
>> Mono-devel-list mailing list
>> Mono-devel-list@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] 32 bit mono

2015-10-10 Thread Greg Young
As of now 32 bit mono is still being shipped with xamarin studio as I
understand for osx. Are there plans to start shipping 64 bit? Just
trying to figure out if its worth supporting a 32 bit build of our
profiler backend for mono.

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Regressions on 3.13.0-46-generic -> 3.13.0-48-generic

2015-09-21 Thread Greg Young
I am surprised to see no one else post on this.

I would think a massive regression that prevents mono from running
multi-threaded code on a multi-cpu system (including in the future on
any v4 kernel) might be an issue that people would be concerned
about?!



On Thu, Sep 17, 2015 at 4:03 PM, Greg Young <gregoryyou...@gmail.com> wrote:
> So to follow up on this.
>
> The fix that was put in for this has since been reverted as mentioned
> in the bug above.
>
> https://github.com/torvalds/linux/commit/73459e2a1ada09a68c02cc5b73f3116fc8194b3d
>
> So all 4 kernels will have this issue. I'm not really sure what needs
> to be done on the mono side here to avoid this issue but it would seem
> to affect any multi-threaded code running on multiple cpu linux
> systems (which I would imagine would be a vast majority of mono
> installations).
>
> Greg
>
> On Thu, Sep 17, 2015 at 1:05 PM, Greg Young <gregoryyou...@gmail.com> wrote:
>> I was just actually writing that this seems to be discussed here:
>> https://bugzilla.xamarin.com/show_bug.cgi?id=29692 :) Thanks for the
>> additional information.
>>
>>
>>
>> On Thu, Sep 17, 2015 at 1:01 PM, Taloth Saldono <talothsald...@gmail.com> 
>> wrote:
>>> This Ubuntu bug discusses the issue for 3.13.
>>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1450584
>>>
>>> Please note that later kernel 4.0 versions exhibit similar issues, search
>>> this mailinglist for specifics on that new regression. I gave up on
>>> investigating further due to other obligations and the complexity of the
>>> subject matter.
>>>
>>> Op 17 sep. 2015 11:49 schreef "Greg Young" <gregoryyou...@gmail.com>:
>>>>
>>>> 3.13.0-63-generic does not have the issue as well.
>>>>
>>>> I guess our mitigation will just be to know about the issue and
>>>> suggest downgrade/upgrade. This may however be useful for others in
>>>> the future. Mono 3.12.1 on 3.13.0-46-generic #77-Ubuntu SMP appears to
>>>> not be stable. We will also test mono4 now.
>>>>
>>>> Greg
>>>>
>>>> On Thu, Sep 17, 2015 at 11:38 AM, Greg Young <gregoryyou...@gmail.com>
>>>> wrote:
>>>> > We are running into some interesting regressions with mono. We are
>>>> > seeing many failures such as:
>>>> >
>>>> > Mono v3.12.1 (we have considered moving up to 4.1 or 4.2 but the last
>>>> > time we tested it didn't seem safe to move).
>>>> >
>>>> > Native stacktrace:
>>>> >
>>>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x609a4f]
>>>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x5bdecf]
>>>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x453b19]
>>>> > /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7fd9709b7340]
>>>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x4e6145]
>>>> > [0x40e21ceb]
>>>> >
>>>> >
>>>> > [03041,21,13:43:11.379] Global Unhandled Exception occurred.
>>>> > Object reference not set to an instance of an object
>>>> > [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException:
>>>> > Object reference not set to an instance of an object
>>>> >   at EventStore.Core.Bus.QueuedHandlerAutoReset.ReadFromQueue
>>>> > (System.Object o) [0x0] in :0
>>>> >   at System.Threading.Thread.StartInternal () [0x0] in >>> > unknown>:0
>>>> >
>>>> > note that this isn't a real nre
>>>> >
>>>> > We do not see these regressions in Linux ip-172-31-37-60
>>>> > 3.13.0-46-generic #77-Ubuntu SMP
>>>> >
>>>> > We do see them in Linux ip-172-31-40-115 3.13.0-48-generic #80-Ubuntu
>>>> > SMP
>>>> >
>>>> > Anyone have any ideas how to debug this further? These are not
>>>> > deterministic issues.
>>>> >
>>>> > Cheers,
>>>> >
>>>> > Greg
>>>> >
>>>> > --
>>>> > Studying for the Turing test
>>>>
>>>>
>>>>
>>>> --
>>>> Studying for the Turing test
>>>> ___
>>>> Mono-devel-list mailing list
>>>> Mono-devel-list@lists.ximian.com
>>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>>
>>
>> --
>> Studying for the Turing test
>
>
>
> --
> Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Regressions on 3.13.0-46-generic -> 3.13.0-48-generic

2015-09-17 Thread Greg Young
We are running into some interesting regressions with mono. We are
seeing many failures such as:

Mono v3.12.1 (we have considered moving up to 4.1 or 4.2 but the last
time we tested it didn't seem safe to move).

Native stacktrace:

/home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x609a4f]
/home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x5bdecf]
/home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x453b19]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7fd9709b7340]
/home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x4e6145]
[0x40e21ceb]


[03041,21,13:43:11.379] Global Unhandled Exception occurred.
Object reference not set to an instance of an object
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException:
Object reference not set to an instance of an object
  at EventStore.Core.Bus.QueuedHandlerAutoReset.ReadFromQueue
(System.Object o) [0x0] in :0
  at System.Threading.Thread.StartInternal () [0x0] in :0

note that this isn't a real nre

We do not see these regressions in Linux ip-172-31-37-60
3.13.0-46-generic #77-Ubuntu SMP

We do see them in Linux ip-172-31-40-115 3.13.0-48-generic #80-Ubuntu SMP

Anyone have any ideas how to debug this further? These are not
deterministic issues.

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Regressions on 3.13.0-46-generic -> 3.13.0-48-generic

2015-09-17 Thread Greg Young
I was just actually writing that this seems to be discussed here:
https://bugzilla.xamarin.com/show_bug.cgi?id=29692 :) Thanks for the
additional information.



On Thu, Sep 17, 2015 at 1:01 PM, Taloth Saldono <talothsald...@gmail.com> wrote:
> This Ubuntu bug discusses the issue for 3.13.
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1450584
>
> Please note that later kernel 4.0 versions exhibit similar issues, search
> this mailinglist for specifics on that new regression. I gave up on
> investigating further due to other obligations and the complexity of the
> subject matter.
>
> Op 17 sep. 2015 11:49 schreef "Greg Young" <gregoryyou...@gmail.com>:
>>
>> 3.13.0-63-generic does not have the issue as well.
>>
>> I guess our mitigation will just be to know about the issue and
>> suggest downgrade/upgrade. This may however be useful for others in
>> the future. Mono 3.12.1 on 3.13.0-46-generic #77-Ubuntu SMP appears to
>> not be stable. We will also test mono4 now.
>>
>> Greg
>>
>> On Thu, Sep 17, 2015 at 11:38 AM, Greg Young <gregoryyou...@gmail.com>
>> wrote:
>> > We are running into some interesting regressions with mono. We are
>> > seeing many failures such as:
>> >
>> > Mono v3.12.1 (we have considered moving up to 4.1 or 4.2 but the last
>> > time we tested it didn't seem safe to move).
>> >
>> > Native stacktrace:
>> >
>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x609a4f]
>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x5bdecf]
>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x453b19]
>> > /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7fd9709b7340]
>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x4e6145]
>> > [0x40e21ceb]
>> >
>> >
>> > [03041,21,13:43:11.379] Global Unhandled Exception occurred.
>> > Object reference not set to an instance of an object
>> > [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException:
>> > Object reference not set to an instance of an object
>> >   at EventStore.Core.Bus.QueuedHandlerAutoReset.ReadFromQueue
>> > (System.Object o) [0x0] in :0
>> >   at System.Threading.Thread.StartInternal () [0x0] in > > unknown>:0
>> >
>> > note that this isn't a real nre
>> >
>> > We do not see these regressions in Linux ip-172-31-37-60
>> > 3.13.0-46-generic #77-Ubuntu SMP
>> >
>> > We do see them in Linux ip-172-31-40-115 3.13.0-48-generic #80-Ubuntu
>> > SMP
>> >
>> > Anyone have any ideas how to debug this further? These are not
>> > deterministic issues.
>> >
>> > Cheers,
>> >
>> > Greg
>> >
>> > --
>> > Studying for the Turing test
>>
>>
>>
>> --
>> Studying for the Turing test
>> ___
>> Mono-devel-list mailing list
>> Mono-devel-list@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Regressions on 3.13.0-46-generic -> 3.13.0-48-generic

2015-09-17 Thread Greg Young
3.13.0-63-generic does not have the issue as well.

I guess our mitigation will just be to know about the issue and
suggest downgrade/upgrade. This may however be useful for others in
the future. Mono 3.12.1 on 3.13.0-46-generic #77-Ubuntu SMP appears to
not be stable. We will also test mono4 now.

Greg

On Thu, Sep 17, 2015 at 11:38 AM, Greg Young <gregoryyou...@gmail.com> wrote:
> We are running into some interesting regressions with mono. We are
> seeing many failures such as:
>
> Mono v3.12.1 (we have considered moving up to 4.1 or 4.2 but the last
> time we tested it didn't seem safe to move).
>
> Native stacktrace:
>
> /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x609a4f]
> /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x5bdecf]
> /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x453b19]
> /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7fd9709b7340]
> /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x4e6145]
> [0x40e21ceb]
>
>
> [03041,21,13:43:11.379] Global Unhandled Exception occurred.
> Object reference not set to an instance of an object
> [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException:
> Object reference not set to an instance of an object
>   at EventStore.Core.Bus.QueuedHandlerAutoReset.ReadFromQueue
> (System.Object o) [0x0] in :0
>   at System.Threading.Thread.StartInternal () [0x0] in  unknown>:0
>
> note that this isn't a real nre
>
> We do not see these regressions in Linux ip-172-31-37-60
> 3.13.0-46-generic #77-Ubuntu SMP
>
> We do see them in Linux ip-172-31-40-115 3.13.0-48-generic #80-Ubuntu SMP
>
> Anyone have any ideas how to debug this further? These are not
> deterministic issues.
>
> Cheers,
>
> Greg
>
> --
> Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Regressions on 3.13.0-46-generic -> 3.13.0-48-generic

2015-09-17 Thread Greg Young
So to follow up on this.

The fix that was put in for this has since been reverted as mentioned
in the bug above.

https://github.com/torvalds/linux/commit/73459e2a1ada09a68c02cc5b73f3116fc8194b3d

So all 4 kernels will have this issue. I'm not really sure what needs
to be done on the mono side here to avoid this issue but it would seem
to affect any multi-threaded code running on multiple cpu linux
systems (which I would imagine would be a vast majority of mono
installations).

Greg

On Thu, Sep 17, 2015 at 1:05 PM, Greg Young <gregoryyou...@gmail.com> wrote:
> I was just actually writing that this seems to be discussed here:
> https://bugzilla.xamarin.com/show_bug.cgi?id=29692 :) Thanks for the
> additional information.
>
>
>
> On Thu, Sep 17, 2015 at 1:01 PM, Taloth Saldono <talothsald...@gmail.com> 
> wrote:
>> This Ubuntu bug discusses the issue for 3.13.
>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1450584
>>
>> Please note that later kernel 4.0 versions exhibit similar issues, search
>> this mailinglist for specifics on that new regression. I gave up on
>> investigating further due to other obligations and the complexity of the
>> subject matter.
>>
>> Op 17 sep. 2015 11:49 schreef "Greg Young" <gregoryyou...@gmail.com>:
>>>
>>> 3.13.0-63-generic does not have the issue as well.
>>>
>>> I guess our mitigation will just be to know about the issue and
>>> suggest downgrade/upgrade. This may however be useful for others in
>>> the future. Mono 3.12.1 on 3.13.0-46-generic #77-Ubuntu SMP appears to
>>> not be stable. We will also test mono4 now.
>>>
>>> Greg
>>>
>>> On Thu, Sep 17, 2015 at 11:38 AM, Greg Young <gregoryyou...@gmail.com>
>>> wrote:
>>> > We are running into some interesting regressions with mono. We are
>>> > seeing many failures such as:
>>> >
>>> > Mono v3.12.1 (we have considered moving up to 4.1 or 4.2 but the last
>>> > time we tested it didn't seem safe to move).
>>> >
>>> > Native stacktrace:
>>> >
>>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x609a4f]
>>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x5bdecf]
>>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x453b19]
>>> > /lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7fd9709b7340]
>>> > /home/ubuntu/EventStore-OSS-Ubuntu-v3.2.1/eventstored() [0x4e6145]
>>> > [0x40e21ceb]
>>> >
>>> >
>>> > [03041,21,13:43:11.379] Global Unhandled Exception occurred.
>>> > Object reference not set to an instance of an object
>>> > [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException:
>>> > Object reference not set to an instance of an object
>>> >   at EventStore.Core.Bus.QueuedHandlerAutoReset.ReadFromQueue
>>> > (System.Object o) [0x0] in :0
>>> >   at System.Threading.Thread.StartInternal () [0x0] in >> > unknown>:0
>>> >
>>> > note that this isn't a real nre
>>> >
>>> > We do not see these regressions in Linux ip-172-31-37-60
>>> > 3.13.0-46-generic #77-Ubuntu SMP
>>> >
>>> > We do see them in Linux ip-172-31-40-115 3.13.0-48-generic #80-Ubuntu
>>> > SMP
>>> >
>>> > Anyone have any ideas how to debug this further? These are not
>>> > deterministic issues.
>>> >
>>> > Cheers,
>>> >
>>> > Greg
>>> >
>>> > --
>>> > Studying for the Turing test
>>>
>>>
>>>
>>> --
>>> Studying for the Turing test
>>> ___
>>> Mono-devel-list mailing list
>>> Mono-devel-list@lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
>
> --
> Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] mono log profiler

2015-09-15 Thread Greg Young
Thanks for the update I will check out the recent changes. I have been
looking at 3.12.0 and have found some issues. Mostly I was curious if
I could rely on many of the assumptions that are being made in it.

Cheers,

Greg

On Tue, Sep 15, 2015 at 6:37 PM, Alex Rønne Petersen <a...@alexrp.com> wrote:
> Yes, certainly. A lot of work has gone into it lately. It should be
> more reliable than ever.
>
> Regards,
> Alex
>
> On Sun, Sep 13, 2015 at 1:18 AM, Greg Young <gregoryyou...@gmail.com> wrote:
>> Is this supposed to be considered as working code at this point?
>> https://github.com/mono/mono/blob/master/mono/profiler/proflog.c
>>
>> --
>> Studying for the Turing test
>> ___
>> Mono-devel-list mailing list
>> Mono-devel-list@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] mono log profiler

2015-09-12 Thread Greg Young
Is this supposed to be considered as working code at this point?
https://github.com/mono/mono/blob/master/mono/profiler/proflog.c

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Class built by mono throws FileNotFoundException when run on windows

2015-09-03 Thread Greg Young
Sorry it double posted as it was queued and didn't send and I sent it
again. Later my iPad apparently got wifi :) That's fair that you are
trying to avoid it but there are circumstances where it can be a good
idea. As an example if I wanted to start looking at your dependencies
with an analysis tool such as ndepend the dependency on mono.posix
might be an issue.

On Wed, Sep 2, 2015 at 11:12 PM, Edward Ned Harvey (mono)
<edward.harvey.m...@clevertrove.com> wrote:
>> From: Greg Young [mailto:gregoryyou...@gmail.com]
>>
>> Use conditional compilation.
>
> Unless I've somehow missed your point? You said that twice, so I want to make 
> sure we're on the same page - You're talking about defining a compiler 
> symbol, and then using [Conditonal] or #if, right? The end result would be 
> different binaries for different platforms. But you can see in my original 
> post, I got my ego bruised and I got taken down a notch by Miguel and others 
> here for doing it - I am *specifically* looking to avoid conditional 
> compilation. That was the point of the original question. The folks who 
> maintain the mono source consider it incorrect enough to reject any pull 
> request that does it, except for compiler code. I'm here to learn a new 
> pattern that is better and more flexible, although not trivial to learn for 
> the first time. That's exactly what I've gotten from Alex and Robert: Use a 
> factory and two assemblies.
>



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Class built by mono throws FileNotFoundException when run on windows

2015-09-02 Thread Greg Young
Use conditional compilation.

On Tuesday, September 1, 2015, Edward Ned Harvey (mono) <
edward.harvey.m...@clevertrove.com> wrote:

> I've always used separate project files on windows and linux, in order to
> include different compiler symbols, in order to make projects build with
> different dependencies. I've been chastised here for doing it, so I'd like
> to find a better way. (Miguel and others tore apart a pull request, saying
> I should never check __MONO__, if I need behavior to be different on
> windows and non-windows, I need to use a runtime check. The problem is, as
> described below, the runtime check can't build or run on windows, so I'd
> like to figure out how it should be done).
>
> Right now, I have a class, which is using Mono.Unix.Native, because of a
> method that does this:
> if (Type.GetType("Mono.Runtime") != null) {
> Syscall.chmod(...);
> }
>
> When built and run on mono, works great. The problem is building and
> running on windows. In order to make it build, I copied Mono.Posix.dll into
> the project and referenced it, with CopyLocal = False. This way,
> Mono.Posix.dll doesn't get copied to the build directory, which is good
> because it's already present on mono systems, and not needed on windows
> systems - the only reason for it to exist in the project is because windows
> can't build without it.
>
> So it builds. But unfortunately, it won't run on windows. It throws
> FileNotFoundException "Mono.Posix.dll" before evaluating the if-clause.
>
> The workaround I've found is to create a wrapper class MonoSpecific, so
> the if-clause and the Mono.Posix call are not in the same file. But this is
> clearly a hack. Is there a better way?
>
> Hello.cs:
> using System;
> namespace helloProject
> {
> static class Hello
> {
> static void ChangePermsIfNecessary()
> {
> if (Type.GetType("Mono.Runtime") != null) {
> MonoSpecific.DoChmod();
> }
> }
> }
> }
>
> MonoSpecific.cs:
> using System;
> using Mono.Unix.Native;
> namespace helloProject
> {
> static class MonoSpecific
> {
> static void DoChmod()
> {
> Syscall.chmod(...);
> }
> }
> }
>
> ___
> 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] Class built by mono throws FileNotFoundException when run on windows

2015-09-02 Thread Greg Young
Use conditional compilation.

On Tuesday, September 1, 2015, Edward Ned Harvey (mono) <
edward.harvey.m...@clevertrove.com> wrote:

> I've always used separate project files on windows and linux, in order to
> include different compiler symbols, in order to make projects build with
> different dependencies. I've been chastised here for doing it, so I'd like
> to find a better way. (Miguel and others tore apart a pull request, saying
> I should never check __MONO__, if I need behavior to be different on
> windows and non-windows, I need to use a runtime check. The problem is, as
> described below, the runtime check can't build or run on windows, so I'd
> like to figure out how it should be done).
>
> Right now, I have a class, which is using Mono.Unix.Native, because of a
> method that does this:
> if (Type.GetType("Mono.Runtime") != null) {
> Syscall.chmod(...);
> }
>
> When built and run on mono, works great. The problem is building and
> running on windows. In order to make it build, I copied Mono.Posix.dll into
> the project and referenced it, with CopyLocal = False. This way,
> Mono.Posix.dll doesn't get copied to the build directory, which is good
> because it's already present on mono systems, and not needed on windows
> systems - the only reason for it to exist in the project is because windows
> can't build without it.
>
> So it builds. But unfortunately, it won't run on windows. It throws
> FileNotFoundException "Mono.Posix.dll" before evaluating the if-clause.
>
> The workaround I've found is to create a wrapper class MonoSpecific, so
> the if-clause and the Mono.Posix call are not in the same file. But this is
> clearly a hack. Is there a better way?
>
> Hello.cs:
> using System;
> namespace helloProject
> {
> static class Hello
> {
> static void ChangePermsIfNecessary()
> {
> if (Type.GetType("Mono.Runtime") != null) {
> MonoSpecific.DoChmod();
> }
> }
> }
> }
>
> MonoSpecific.cs:
> using System;
> using Mono.Unix.Native;
> namespace helloProject
> {
> static class MonoSpecific
> {
> static void DoChmod()
> {
> Syscall.chmod(...);
> }
> }
> }
>
> ___
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com 
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>


-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Exception in a background thread

2015-08-30 Thread Greg Young
Thanks!

Greg

On Sun, Aug 30, 2015 at 10:51 PM, Alexis Christoforides
le...@xamarin.com wrote:
 Hi Greg, the issue you're seeing is fixed in this commit:
 https://github.com/mono/mono/commit/a1828a2aa92eb66bb4d0b8c1fc814a928c5d8fec

 It's included in the latest 4.0 and 4.2 packages.

 Thanks!

 - Alexis

 On Sun, Aug 30, 2015 at 11:18 AM, Greg Young gregoryyou...@gmail.com
 wrote:

 OSX

 Mono JIT compiler version 4.1.0 (master/48d64eb Sat Mar 21 03:42:51 EET
 2015)

 [ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentOutOfRangeException:
 Argument is out of range.
 Parameter name: startIndex
  at System.String.Substring (Int32 startIndex)0x111eb2e60 + 0x0006d
 in filename unknown:0
  at System.IO.KqueueMonitor.PostEvent (FileAction action,
 System.String path, System.String newPath)0x129432350 + 0x0007f in
 filename unknown:0
  at System.IO.KqueueMonitor.Remove (System.IO.PathData
 pathData)0x129431f70 + 0x00074 in filename unknown:0
  at System.Collections.Generic.List`1[System.IO.PathData].ForEach
 (System.Action`1 action)0x111b95770 + 0x0007e in filename
 unknown:0
  at System.IO.KqueueMonitor.Monitor ()0x114c14ff0 + 0x005ef in
 filename unknown:0
  at System.IO.KqueueMonitor.DoMonitor ()0x114c10be0 + 0x001e7 in
 filename unknown:0

 Has anyone seen this before?

 --
 Studying for the Turing test
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list





-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Exception in a background thread

2015-08-30 Thread Greg Young
OSX

Mono JIT compiler version 4.1.0 (master/48d64eb Sat Mar 21 03:42:51 EET 2015)

[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentOutOfRangeException:
Argument is out of range.
Parameter name: startIndex
 at System.String.Substring (Int32 startIndex)0x111eb2e60 + 0x0006d
in filename unknown:0
 at System.IO.KqueueMonitor.PostEvent (FileAction action,
System.String path, System.String newPath)0x129432350 + 0x0007f in
filename unknown:0
 at System.IO.KqueueMonitor.Remove (System.IO.PathData
pathData)0x129431f70 + 0x00074 in filename unknown:0
 at System.Collections.Generic.List`1[System.IO.PathData].ForEach
(System.Action`1 action)0x111b95770 + 0x0007e in filename
unknown:0
 at System.IO.KqueueMonitor.Monitor ()0x114c14ff0 + 0x005ef in
filename unknown:0
 at System.IO.KqueueMonitor.DoMonitor ()0x114c10be0 + 0x001e7 in
filename unknown:0

Has anyone seen this before?

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Investigating mono crashes on linux 4.1

2015-07-23 Thread Greg Young
We have seen some similar crashes of mono in linux (ubuntu and amazon linux).

One thing we have done that greatly reduces the frequency of the
crashes so far (removed 95%+ of them) is. MONO_GC_DEBUG=clear-at-gc

There is an issue here as well
https://bugzilla.xamarin.com/show_bug.cgi?id=18151 that is likely
related.

On Thu, Jul 23, 2015 at 3:03 PM, Taloth Saldono talothsald...@gmail.com wrote:
 Hey guys,

 (Initially I incorrectly posted this to the mono-list, so for those
 receiving this message twice, my apologies.)

 I'm looking for a mono expert on the managed threading system, hopefully you
 can give me a pointer to where to look.

 The problem a couple of my users experience is that since linux kernel 4.1
 mono crashes in a reproducible manner. (Using test case bug-18026 in a loop,
 which is a threadpool stress-test)

 A similar problem occurred in 3.13.0 but that was fixed by backporting some
 commits in the ubuntu kernel. (See
 https://bugzilla.xamarin.com/show_bug.cgi?id=29212)

 Initially I believed that in 4.1 those commits were reverted, but tests
 indicated that wasn't the cause.
 So I did a full bisect on linux 4.0-4.1 on a 64-bit Ubuntu 14.04.2
 Virtualbox. (~13 compiles of the kernel, took a couple of days)
 And it ended up on
 https://github.com/torvalds/linux/commit/c70e1b475f37f07ab7181ad28458666d59aae634.

 The problem seems to cause NullReferenceException and possibly native
 SIGSEGVs in a variety of places. (I can dump some stacktraces if desired,
 but I suspect that won't be helpful coz the corruption is likely caused
 elsewhere.)

 To me it seems impossible that reading the tsc in any way could result in
 the nullrefs. So my guess would it a side-effect of the memory barrier. From
 what I understand from the commit, the 'mfence+lfence' changed to 'mfence or
 lfence' (depending on what the cpu supports) and mfrence=lfence+sfence (not
 entirely true, but close), so I have no idea what the heck is going on
 there.
 But if I would venture a guess that somewhere, indirectly, mono unknowingly
 relies on that barrier to be there.
 Theoretically it still means other native apps could experience the same
 problem, but I would've expected reports about that already.

 My experience in these matters is pretty much non-existent. But dumping
 issues on devs is the least productive way to get them fixed, so I try to
 investigate as far as I can. Especially since it involves an issue that
 could be caused by either mono or the kernel.

 So my question is: Is there a likely candidate in mono where it uses the tsc
 (possibly for profiling) where the changed barrier could cause this odd
 behavior? And obviously, is there anything in particular I could try to
 narrow this down further?

 Almost forgot, but I did the bisect using mono 4.0.2.5, but I tested the
 nightly version as well.

 Thank you for your time.

 Taloth

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




-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Profiling / Memory Management tools

2015-05-31 Thread Greg Young
THIS!! https://github.com/mono/mono/blob/master/data/mono.supp

+1

On Sun, May 31, 2015 at 8:31 PM, Greg Young gregoryyou...@gmail.com wrote:
 Will read through but I am interested in the unmanaged side (part of
 what I am working on is actually an injected profiler)

 Cheers,

 Greg

 On Sun, May 31, 2015 at 8:29 PM, Dan Liew d...@su-root.co.uk wrote:
 On 31 May 2015 at 17:35, Greg Young gregoryyou...@gmail.com wrote:
 What tools are people using with mono? I have tried as an example
 using valgrind to verify the stuff I am working on is reasonable but
 the listings of problems that come out are massive.

 Checking the memory usage via valgrind will be pretty useless to you
 unless you know the mono internals. If you do want to continue down
 that route look at [1].

 You're more likely to be interested in memory use at the level of your
 C#/F# code. To do this I've used mono's built-in memory profiling [2],
 e.g.

 $ mono --profile=log:heapshot my_program.exe

 You can specify how frequently shots of the heap are taken. You can
 view the result using mprof or heapshot [3].

 [1] 
 http://www.mono-project.com/docs/debug+profile/debug/#using-valgrind-on-mono
 [2] 
 http://www.mono-project.com/docs/debug+profile/profile/profiler/#profiler-option-documentation
 [3] https://github.com/mono/heap-shot



 --
 Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Profiling / Memory Management tools

2015-05-31 Thread Greg Young
What tools are people using with mono? I have tried as an example
using valgrind to verify the stuff I am working on is reasonable but
the listings of problems that come out are massive.

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] HttpListener

2015-05-19 Thread Greg Young
Yes exactly my intention. The problem is I am only given http prefixes
in that code.

Consider the case I have an interface 192.168.1.1 and an interface 10.114.1.112

Given a http prefix of http://my.elasticip:8080 which interface should it pick?

As you can see here the prefixes are being used for both:
https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/EndPointManager.cs#L77
as well as some odd error conditions which I imagine are to match MS
implementation but would need to verify that.

If there was a separation between which interface to pick vs which
http prefixes to use this would solve the problem and is essentially
what I was talking about putting in as an overload. I know mono is as
a whole a bit reluctant to add mono specific overloads (which is
completely understandable). I just find kind any other reasonable way
here of handling the windows/mono differences.

https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/HttpListener.cs#L269
leads to
https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/EndPointManager.cs#L48

I could do this in a couple of ways (add state to HttpListener is an
obvious one + an overload that only changes behaviour if its used).

Greg

On Wed, May 20, 2015 at 12:18 AM, Miguel de Icaza mig...@xamarin.com wrote:
 Shouldn't we bind on the interface based on the IP address?

 Would that not solve the problem?

 miguel

 On Tue, May 19, 2015 at 4:00 PM, Greg Young gregoryyou...@gmail.com wrote:

 I was thinking a basic code api that allowed the specification of
 interface to bind to separately from which prefixes to accept to start
 with. The biggest issue here is that the ms api is basically using
 httpprefix to mean two very different things.

 On Tue, May 19, 2015 at 10:58 PM, Miguel de Icaza mig...@xamarin.com
 wrote:
  Well, it might be best if you explain what you have in mind, before we
  waste
  time with a pull request.
 
  But either way works.
 
  On Tue, May 19, 2015 at 3:50 PM, Greg Young gregoryyou...@gmail.com
  wrote:
 
  Miguel,
 
  Would it be best to just take a stab at an alternative interface and
  send a PR for discussion?
 
  Greg
 
  On Sun, Apr 26, 2015 at 4:43 PM, Greg Young gregoryyou...@gmail.com
  wrote:
   This is the code handling the prefixes its here
  
  
   https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/EndPointManager.cs#L43
  
   There is quite a bit of odd code around this in general. I understand
   much of it is trying to reach compliance with MS but ...
  
   On Sun, Apr 26, 2015 at 4:40 PM, Miguel de Icaza mig...@xamarin.com
   wrote:
   Hello Greg,
  
   Is that in HttpListener, or somewhere else?
  
   Miguel
  
   On Fri, Apr 24, 2015 at 12:41 PM, Greg Young
   gregoryyou...@gmail.com
   wrote:
  
   Here is some of the code in question:
  
   IPAddress addr;
   if (host == *)
   addr = IPAddress.Any;
   else if (IPAddress.TryParse(host, out addr) == false){
   try {
   IPHostEntry iphost = Dns.GetHostByName(host);
  if (iphost != null)
   addr = iphost.AddressList[0];
  else
   addr = IPAddress.Any;
  } catch {
   addr = IPAddress.Any;
  }
   }
  
   On Fri, Apr 24, 2015 at 7:29 PM, Greg Young
   gregoryyou...@gmail.com
   wrote:
I have been going through a bunch of this code lately after
seeing
many ... interesting behaviours. I understand that much of the
derp
in
this code is due to not having IIS and MS having an IIS centric
API
but wow. Some gems I have found...
   
1) synchronous dns calls being made...
2) I want to listen on 192.168.0.1:1234 but I want to support a
host
header of whateverdomain can't resolve whatever domain then bind
listeners to all ips on machine.
3) Same as above but dns entry has multiple ips it resovles to
[0]
doesnt match see #2
4) Anything at all to do with elastic ips
5) Exceptions thrown to calling code with http status codes in
them
(I
think this is ms legacy but is a pretty biog wtf)
6) failure parsing ip address says bind all interfaces on machine
(huh?)
   
Perhaps it makes sense to expose a Microsoft Http Compatibility
Layer and then have a Sane API if you want to use it
   
I dont mind putting some time in on these but is this even
worthwhile
or is the plan to just burn this code with fire and move to
something
sane in general?
   
Cheers,
   
Greg
--
Studying for the Turing test
  
  
  
   --
   Studying for the Turing test
   ___
   Mono-devel-list mailing list
   Mono-devel-list@lists.ximian.com
   http://lists.ximian.com/mailman/listinfo/mono-devel-list
  
  
  
  
  
   --
   Studying for the Turing test
 
 
 
  --
  Studying for the Turing test
 
 



 --
 Studying for the Turing test





-- 
Studying for the Turing test

Re: [Mono-dev] HttpListener

2015-05-19 Thread Greg Young
Miguel,

Would it be best to just take a stab at an alternative interface and
send a PR for discussion?

Greg

On Sun, Apr 26, 2015 at 4:43 PM, Greg Young gregoryyou...@gmail.com wrote:
 This is the code handling the prefixes its here
 https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/EndPointManager.cs#L43

 There is quite a bit of odd code around this in general. I understand
 much of it is trying to reach compliance with MS but ...

 On Sun, Apr 26, 2015 at 4:40 PM, Miguel de Icaza mig...@xamarin.com wrote:
 Hello Greg,

 Is that in HttpListener, or somewhere else?

 Miguel

 On Fri, Apr 24, 2015 at 12:41 PM, Greg Young gregoryyou...@gmail.com
 wrote:

 Here is some of the code in question:

 IPAddress addr;
 if (host == *)
 addr = IPAddress.Any;
 else if (IPAddress.TryParse(host, out addr) == false){
 try {
 IPHostEntry iphost = Dns.GetHostByName(host);
if (iphost != null)
 addr = iphost.AddressList[0];
else
 addr = IPAddress.Any;
} catch {
 addr = IPAddress.Any;
}
 }

 On Fri, Apr 24, 2015 at 7:29 PM, Greg Young gregoryyou...@gmail.com
 wrote:
  I have been going through a bunch of this code lately after seeing
  many ... interesting behaviours. I understand that much of the derp in
  this code is due to not having IIS and MS having an IIS centric API
  but wow. Some gems I have found...
 
  1) synchronous dns calls being made...
  2) I want to listen on 192.168.0.1:1234 but I want to support a host
  header of whateverdomain can't resolve whatever domain then bind
  listeners to all ips on machine.
  3) Same as above but dns entry has multiple ips it resovles to [0]
  doesnt match see #2
  4) Anything at all to do with elastic ips
  5) Exceptions thrown to calling code with http status codes in them (I
  think this is ms legacy but is a pretty biog wtf)
  6) failure parsing ip address says bind all interfaces on machine (huh?)
 
  Perhaps it makes sense to expose a Microsoft Http Compatibility
  Layer and then have a Sane API if you want to use it
 
  I dont mind putting some time in on these but is this even worthwhile
  or is the plan to just burn this code with fire and move to something
  sane in general?
 
  Cheers,
 
  Greg
  --
  Studying for the Turing test



 --
 Studying for the Turing test
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list





 --
 Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] HttpListener

2015-05-19 Thread Greg Young
I was thinking a basic code api that allowed the specification of
interface to bind to separately from which prefixes to accept to start
with. The biggest issue here is that the ms api is basically using
httpprefix to mean two very different things.

On Tue, May 19, 2015 at 10:58 PM, Miguel de Icaza mig...@xamarin.com wrote:
 Well, it might be best if you explain what you have in mind, before we waste
 time with a pull request.

 But either way works.

 On Tue, May 19, 2015 at 3:50 PM, Greg Young gregoryyou...@gmail.com wrote:

 Miguel,

 Would it be best to just take a stab at an alternative interface and
 send a PR for discussion?

 Greg

 On Sun, Apr 26, 2015 at 4:43 PM, Greg Young gregoryyou...@gmail.com
 wrote:
  This is the code handling the prefixes its here
 
  https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/EndPointManager.cs#L43
 
  There is quite a bit of odd code around this in general. I understand
  much of it is trying to reach compliance with MS but ...
 
  On Sun, Apr 26, 2015 at 4:40 PM, Miguel de Icaza mig...@xamarin.com
  wrote:
  Hello Greg,
 
  Is that in HttpListener, or somewhere else?
 
  Miguel
 
  On Fri, Apr 24, 2015 at 12:41 PM, Greg Young gregoryyou...@gmail.com
  wrote:
 
  Here is some of the code in question:
 
  IPAddress addr;
  if (host == *)
  addr = IPAddress.Any;
  else if (IPAddress.TryParse(host, out addr) == false){
  try {
  IPHostEntry iphost = Dns.GetHostByName(host);
 if (iphost != null)
  addr = iphost.AddressList[0];
 else
  addr = IPAddress.Any;
 } catch {
  addr = IPAddress.Any;
 }
  }
 
  On Fri, Apr 24, 2015 at 7:29 PM, Greg Young gregoryyou...@gmail.com
  wrote:
   I have been going through a bunch of this code lately after seeing
   many ... interesting behaviours. I understand that much of the derp
   in
   this code is due to not having IIS and MS having an IIS centric API
   but wow. Some gems I have found...
  
   1) synchronous dns calls being made...
   2) I want to listen on 192.168.0.1:1234 but I want to support a host
   header of whateverdomain can't resolve whatever domain then bind
   listeners to all ips on machine.
   3) Same as above but dns entry has multiple ips it resovles to [0]
   doesnt match see #2
   4) Anything at all to do with elastic ips
   5) Exceptions thrown to calling code with http status codes in them
   (I
   think this is ms legacy but is a pretty biog wtf)
   6) failure parsing ip address says bind all interfaces on machine
   (huh?)
  
   Perhaps it makes sense to expose a Microsoft Http Compatibility
   Layer and then have a Sane API if you want to use it
  
   I dont mind putting some time in on these but is this even
   worthwhile
   or is the plan to just burn this code with fire and move to
   something
   sane in general?
  
   Cheers,
  
   Greg
   --
   Studying for the Turing test
 
 
 
  --
  Studying for the Turing test
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
  http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 
 
 
 
  --
  Studying for the Turing test



 --
 Studying for the Turing test





-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] HttpListener

2015-04-26 Thread Greg Young
This is the code handling the prefixes its here
https://github.com/mono/mono/blob/master/mcs/class/System/System.Net/EndPointManager.cs#L43

There is quite a bit of odd code around this in general. I understand
much of it is trying to reach compliance with MS but ...

On Sun, Apr 26, 2015 at 4:40 PM, Miguel de Icaza mig...@xamarin.com wrote:
 Hello Greg,

 Is that in HttpListener, or somewhere else?

 Miguel

 On Fri, Apr 24, 2015 at 12:41 PM, Greg Young gregoryyou...@gmail.com
 wrote:

 Here is some of the code in question:

 IPAddress addr;
 if (host == *)
 addr = IPAddress.Any;
 else if (IPAddress.TryParse(host, out addr) == false){
 try {
 IPHostEntry iphost = Dns.GetHostByName(host);
if (iphost != null)
 addr = iphost.AddressList[0];
else
 addr = IPAddress.Any;
} catch {
 addr = IPAddress.Any;
}
 }

 On Fri, Apr 24, 2015 at 7:29 PM, Greg Young gregoryyou...@gmail.com
 wrote:
  I have been going through a bunch of this code lately after seeing
  many ... interesting behaviours. I understand that much of the derp in
  this code is due to not having IIS and MS having an IIS centric API
  but wow. Some gems I have found...
 
  1) synchronous dns calls being made...
  2) I want to listen on 192.168.0.1:1234 but I want to support a host
  header of whateverdomain can't resolve whatever domain then bind
  listeners to all ips on machine.
  3) Same as above but dns entry has multiple ips it resovles to [0]
  doesnt match see #2
  4) Anything at all to do with elastic ips
  5) Exceptions thrown to calling code with http status codes in them (I
  think this is ms legacy but is a pretty biog wtf)
  6) failure parsing ip address says bind all interfaces on machine (huh?)
 
  Perhaps it makes sense to expose a Microsoft Http Compatibility
  Layer and then have a Sane API if you want to use it
 
  I dont mind putting some time in on these but is this even worthwhile
  or is the plan to just burn this code with fire and move to something
  sane in general?
 
  Cheers,
 
  Greg
  --
  Studying for the Turing test



 --
 Studying for the Turing test
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list





-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] HttpListener

2015-04-24 Thread Greg Young
I have been going through a bunch of this code lately after seeing
many ... interesting behaviours. I understand that much of the derp in
this code is due to not having IIS and MS having an IIS centric API
but wow. Some gems I have found...

1) synchronous dns calls being made...
2) I want to listen on 192.168.0.1:1234 but I want to support a host
header of whateverdomain can't resolve whatever domain then bind
listeners to all ips on machine.
3) Same as above but dns entry has multiple ips it resovles to [0]
doesnt match see #2
4) Anything at all to do with elastic ips
5) Exceptions thrown to calling code with http status codes in them (I
think this is ms legacy but is a pretty biog wtf)
6) failure parsing ip address says bind all interfaces on machine (huh?)

Perhaps it makes sense to expose a Microsoft Http Compatibility
Layer and then have a Sane API if you want to use it

I dont mind putting some time in on these but is this even worthwhile
or is the plan to just burn this code with fire and move to something
sane in general?

Cheers,

Greg
-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] HttpListener

2015-04-24 Thread Greg Young
Here is some of the code in question:

IPAddress addr;
if (host == *)
addr = IPAddress.Any;
else if (IPAddress.TryParse(host, out addr) == false){
try {
IPHostEntry iphost = Dns.GetHostByName(host);
   if (iphost != null)
addr = iphost.AddressList[0];
   else
addr = IPAddress.Any;
   } catch {
addr = IPAddress.Any;
   }
}

On Fri, Apr 24, 2015 at 7:29 PM, Greg Young gregoryyou...@gmail.com wrote:
 I have been going through a bunch of this code lately after seeing
 many ... interesting behaviours. I understand that much of the derp in
 this code is due to not having IIS and MS having an IIS centric API
 but wow. Some gems I have found...

 1) synchronous dns calls being made...
 2) I want to listen on 192.168.0.1:1234 but I want to support a host
 header of whateverdomain can't resolve whatever domain then bind
 listeners to all ips on machine.
 3) Same as above but dns entry has multiple ips it resovles to [0]
 doesnt match see #2
 4) Anything at all to do with elastic ips
 5) Exceptions thrown to calling code with http status codes in them (I
 think this is ms legacy but is a pretty biog wtf)
 6) failure parsing ip address says bind all interfaces on machine (huh?)

 Perhaps it makes sense to expose a Microsoft Http Compatibility
 Layer and then have a Sane API if you want to use it

 I dont mind putting some time in on these but is this even worthwhile
 or is the plan to just burn this code with fire and move to something
 sane in general?

 Cheers,

 Greg
 --
 Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] LLVM + mac deploys

2015-04-16 Thread Greg Young
I was looking through an issue from a mac user today.

Apparently when they brought down mono from home brew there were two
odds things.

1) It was 32bit. That's not really for this list though
2) It was using LLVM by default. Is LLVM ready for being the default
at this point? I haven't been following it much.

What is the current best practice for a mac user to be installing? I
run builds myself but figure there is a better way

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] LLVM + mac deploys

2015-04-16 Thread Greg Young
See twitter ... adding you there so you get link + user


On Thu, Apr 16, 2015 at 5:31 PM, Miguel de Icaza mig...@xamarin.com wrote:
 That is most definitely not the version that xamarin is shipping.

 On Thu, Apr 16, 2015 at 10:30 AM, Greg Young gregoryyou...@gmail.com
 wrote:

 Did something like just change with this? I just asked if anyone could
 do a fresh install and got

 mono --version
 Mono JIT compiler version 3.12.1 (tarball Tue Mar 17 15:03:14 GMT 2015)
 Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors.
 www.mono-project.com
 TLS:   normal
 SIGSEGV:   altstack
 Notification:  kqueue
 Architecture:  amd64
 Disabled:  none
 Misc:  softdebug
 LLVM:  supported, not enabled.
 GC:sgen

 On Thu, Apr 16, 2015 at 5:17 PM, Miguel de Icaza mig...@xamarin.com
 wrote:
  Right, Mono on Mac is currently 32 bits, and we ship LLVM with it.
 
  But we do not default to LLVM, that is something that you can use when
  you
  pass the --llvm option.
 
  I believe we are just about to release a Mono that includes both 32 and
  64
  bit binaries.
 
  Miguel
 
  On Thu, Apr 16, 2015 at 10:15 AM, Greg Young gregoryyou...@gmail.com
  wrote:
 
  Some others are saying the xamarin package is also 32bit + llvm
 
  I don't have it installed here to test
 
  On Thu, Apr 16, 2015 at 5:13 PM, Miguel de Icaza mig...@xamarin.com
  wrote:
   Hello,
  
   LLVM is never the default for JIT configurations, it is something
   that
   you
   must manually opt-into.
  
   Did homebrew default to it?   Because LLVM as a JIT is *very slow*
  
   Miguel
  
   On Thu, Apr 16, 2015 at 8:35 AM, Greg Young gregoryyou...@gmail.com
   wrote:
  
   I was looking through an issue from a mac user today.
  
   Apparently when they brought down mono from home brew there were two
   odds things.
  
   1) It was 32bit. That's not really for this list though
   2) It was using LLVM by default. Is LLVM ready for being the default
   at this point? I haven't been following it much.
  
   What is the current best practice for a mac user to be installing?
   I
   run builds myself but figure there is a better way
  
   Cheers,
  
   Greg
  
   --
   Studying for the Turing test
   ___
   Mono-devel-list mailing list
   Mono-devel-list@lists.ximian.com
   http://lists.ximian.com/mailman/listinfo/mono-devel-list
  
  
 
 
 
  --
  Studying for the Turing test
 
 



 --
 Studying for the Turing test





-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] LLVM + mac deploys

2015-04-16 Thread Greg Young
Did something like just change with this? I just asked if anyone could
do a fresh install and got

mono --version
Mono JIT compiler version 3.12.1 (tarball Tue Mar 17 15:03:14 GMT 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors.
www.mono-project.com
TLS:   normal
SIGSEGV:   altstack
Notification:  kqueue
Architecture:  amd64
Disabled:  none
Misc:  softdebug
LLVM:  supported, not enabled.
GC:sgen

On Thu, Apr 16, 2015 at 5:17 PM, Miguel de Icaza mig...@xamarin.com wrote:
 Right, Mono on Mac is currently 32 bits, and we ship LLVM with it.

 But we do not default to LLVM, that is something that you can use when you
 pass the --llvm option.

 I believe we are just about to release a Mono that includes both 32 and 64
 bit binaries.

 Miguel

 On Thu, Apr 16, 2015 at 10:15 AM, Greg Young gregoryyou...@gmail.com
 wrote:

 Some others are saying the xamarin package is also 32bit + llvm

 I don't have it installed here to test

 On Thu, Apr 16, 2015 at 5:13 PM, Miguel de Icaza mig...@xamarin.com
 wrote:
  Hello,
 
  LLVM is never the default for JIT configurations, it is something that
  you
  must manually opt-into.
 
  Did homebrew default to it?   Because LLVM as a JIT is *very slow*
 
  Miguel
 
  On Thu, Apr 16, 2015 at 8:35 AM, Greg Young gregoryyou...@gmail.com
  wrote:
 
  I was looking through an issue from a mac user today.
 
  Apparently when they brought down mono from home brew there were two
  odds things.
 
  1) It was 32bit. That's not really for this list though
  2) It was using LLVM by default. Is LLVM ready for being the default
  at this point? I haven't been following it much.
 
  What is the current best practice for a mac user to be installing? I
  run builds myself but figure there is a better way
 
  Cheers,
 
  Greg
 
  --
  Studying for the Turing test
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
  http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 



 --
 Studying for the Turing test





-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Is mono ready for backend deployment?

2015-03-27 Thread Greg Young
As an aside I was perf and stability testing some code last night and mono
used less memory and was faster than the equivalent clr tests. Good job
everyone :)

On Thursday, March 26, 2015, Gelin Yan dynami...@gmail.com wrote:

 Hi All

A few years ago, I tried to port one of our server from .net to mono.
 At the time. Mono 2.8 was just out. My server use socket (tcp almost) 
 thread pools heavily.

 I noticed several crash reports during the tests and some of them were
 related to mono's gc  threadpool, so finally I gave up.

Now We are in 2015 and mono has improved quite a bit. I want to know
 whether it is ready for backend? I founded many successful cases with mono
 but most of them are about mobile development.  Could you share some
 experience on server side?

   Thanks.

 Regards

 gelin yan



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Build Broken?

2015-03-27 Thread Greg Young
I am running into this on a build ubuntu 14.14 box bootstrapped with
3.12.1 (first pull down of sources)

MCS [net_4_5] mono-symbolicate.exe
MDOC[net_4_5] cs-errors.tree
Error destroying handle 0x40d mutex due to 16

Stacktrace:

  at unknown 0x
  at (wrapper managed-to-native)
System.Threading.InternalThread.Thread_free_internal
(System.Threading.InternalThread,intptr) 0x
  at System.Threading.InternalThread.Finalize () 0x0001b
  at (wrapper runtime-invoke)
object.runtime_invoke_virtual_void__this__
(object,intptr,intptr,intptr) 0x

Native stacktrace:

/home/greg/mono/mono/mini/mono(mono_handle_native_sigsegv+0xf0) [0x4d0280]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfc90) [0x7f24022e7c90]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7f2401f4ae37]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7f2401f4c528]
/home/greg/mono/mono/mini/mono() [0x668389]
/home/greg/mono/mono/mini/mono(monoeg_g_logv+0x4c) [0x6685fc]
/home/greg/mono/mono/mini/mono(monoeg_g_log+0x8f) [0x6686cf]
/home/greg/mono/mono/mini/mono() [0x63739d]
/home/greg/mono/mono/mini/mono(wapi_CloseHandle+0x14) [0x638d54]
/home/greg/mono/mono/mini/mono(ves_icall_System_Threading_InternalThread_Thread_free_internal+0x16)
[0x5b9956]
[0x41f899f1]

Debug info from gdb:

[New LWP 27840]
[New LWP 27839]
[Thread debugging using libthread_db enabled]
Using host libthread_db library /lib/x86_64-linux-gnu/libthread_db.so.1.
0x7f24022e7839 in __libc_waitpid (pid=pid@entry=27867,
stat_loc=stat_loc@entry=0x7fffbe0c497c, options=options@entry=0) at
../sysdeps/unix/sysv/linux/waitpid.c:40
40 ../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
  Id   Target Id Frame
  3Thread 0x7f23ff0f7700 (LWP 27839) Finalizer sem_wait () at
../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
  2Thread 0x7f23fe39f700 (LWP 27840) Threadpool moni
__clock_nanosleep (clock_id=1, flags=1, req=0x7f23fe39ed00,
rem=0x) at
../sysdeps/unix/sysv/linux/clock_nanosleep.c:49
* 1Thread 0x7f2402e0a7c0 (LWP 27824) mono 0x7f24022e7839 in
__libc_waitpid (pid=pid@entry=27867,
stat_loc=stat_loc@entry=0x7fffbe0c497c, options=options@entry=0) at
../sysdeps/unix/sysv/linux/waitpid.c:40

Thread 3 (Thread 0x7f23ff0f7700 (LWP 27839)):
#0  sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:85
#1  0x0065b386 in mono_sem_wait (sem=sem@entry=0x990040
finalizer_sem, alertable=alertable@entry=1) at mono-semaphore.c:101
#2  0x005dc842 in finalizer_thread (unused=optimised out) at gc.c:1093
#3  0x005bc014 in start_wrapper_internal (data=optimised
out) at threads.c:664
#4  start_wrapper (data=optimised out) at threads.c:711
#5  0x00661a65 in inner_start_thread (arg=0x7fffbe0c5b90) at
mono-threads-posix.c:93
#6  0x7f24022e00a5 in start_thread (arg=0x7f23ff0f7700) at
pthread_create.c:309
#7  0x7f240200dcfd in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 2 (Thread 0x7f23fe39f700 (LWP 27840)):
#0  __clock_nanosleep (clock_id=1, flags=1, req=0x7f23fe39ed00,
rem=0x) at
../sysdeps/unix/sysv/linux/clock_nanosleep.c:49
#1  0x0064e410 in wapi_SleepEx (ms=ms@entry=500,
alertable=alertable@entry=1) at wthreads.c:272
#2  0x005bf15d in monitor_thread (unused=optimised out) at
threadpool.c:917
#3  0x005bc014 in start_wrapper_internal (data=optimised
out) at threads.c:664
#4  start_wrapper (data=optimised out) at threads.c:711
#5  0x00661a65 in inner_start_thread (arg=0x7fffbe0c5190) at
mono-threads-posix.c:93
#6  0x7f24022e00a5 in start_thread (arg=0x7f23fe39f700) at
pthread_create.c:309
#7  0x7f240200dcfd in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7f2402e0a7c0 (LWP 27824)):
#0  0x7f24022e7839 in __libc_waitpid (pid=pid@entry=27867,
stat_loc=stat_loc@entry=0x7fffbe0c497c, options=options@entry=0) at
../sysdeps/unix/sysv/linux/waitpid.c:40
#1  0x004d0317 in mono_handle_native_sigsegv
(signal=optimised out, ctx=optimised out, info=optimised out) at
mini-exceptions.c:2348
#2  signal handler called
#3  0x7f2401f4ae37 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#4  0x7f2401f4c528 in __GI_abort () at abort.c:89
#5  0x00668389 in monoeg_log_default_handler
(log_domain=optimised out, log_level=G_LOG_LEVEL_ERROR,
message=optimised out, unused_data=optimised out) at goutput.c:233
#6  0x006685fc in monoeg_g_logv (log_domain=0x0,
log_level=G_LOG_LEVEL_ERROR, format=optimised out,
args=args@entry=0x7fffbe0c5900) at goutput.c:113
#7  0x006686cf in monoeg_g_log
(log_domain=log_domain@entry=0x0,
log_level=log_level@entry=G_LOG_LEVEL_ERROR,
format=format@entry=0x719990 Error destroying handle %p mutex due to
%d\n) at goutput.c:123
#8  0x0063739d in _wapi_handle_unref_full (handle=0x40d,
ignore_private_busy_handles=ignore_private_busy_handles@entry=0) at
handles.c:1123
#9  0x00638787 in 

Re: [Mono-dev] Profiler Name

2015-03-20 Thread Greg Young
more specific:

greg@orc ~/src/PrivateI/bridges/mono ±master⚡ » sudo cp
libmono-profiler-privateeye.so /usr/lib/libmono-profiler-privateeye.so
greg@orc ~/src/PrivateI/bridges/mono ±master⚡ » mono
--profile=privateeye ~/src/crap/crap.exe
The 'privateeye' profiler wasn't found in the main executable nor
could it be loaded from 'mono-profiler-privateeye'.

greg@orc ~/src/PrivateI/bridges/mono ±master⚡ » sudo cp
libmono-profiler-privateeye.so /usr/lib/libmono-profiler-bar.so
greg@orc ~/src/PrivateI/bridges/mono ±master⚡ » mono --profile=bar
~/src/crap/crap.exe
thread data not found, creating



On Sat, Mar 21, 2015 at 2:17 AM, Greg Young gregoryyou...@gmail.com wrote:
 Am I going totally nuts or is there a max length on profiler name of about 8?

 Just wasted a lot of time about why it couldn't find my renamed profiler.

 Renamed it eventually to foo and the same .so is now found and works.

 If so this could probably be worth a doc.

 Cheers,

 Greg

 --
 Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Profiler Name

2015-03-20 Thread Greg Young
Am I going totally nuts or is there a max length on profiler name of about 8?

Just wasted a lot of time about why it couldn't find my renamed profiler.

Renamed it eventually to foo and the same .so is now found and works.

If so this could probably be worth a doc.

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Snapshot of stack

2015-03-17 Thread Greg Young
Oo I didn't know that trick thats quite useful.

However it won't fix the scenario I am looking for.

1) I can't assure I have stdout of process.
2) I want to do this say 1000 times a second :)

There is stuff for doing this with the CLR and I know I can do it with
the profiler API it would just be nice to not have to do it through
the profiler api.

Cheers,

Greg

On Tue, Mar 17, 2015 at 5:17 PM, Rodrigo Kumpera kump...@gmail.com wrote:
 kill -QUIT the target process

 On Mon, Mar 16, 2015 at 8:10 PM, Greg Young gregoryyou...@gmail.com wrote:

 To be clear I know I can do if installed as a profiler but would
 prefer to do it from the outside

 On Tue, Mar 17, 2015 at 2:07 AM, Greg Young gregoryyou...@gmail.com
 wrote:
  I generally know how to snapshot the stack from outside code in C but
  I am not quite sure how to translate mono methods like can be done in
  a few ways (like this
  http://blogs.msdn.com/b/jmstall/archive/2005/11/28/snapshot.aspx) on
  the clr. Is there any equivalent way of getting this information in
  mono?
 
  Cheers,
 
  Greg
 
  --
  Studying for the Turing test



 --
 Studying for the Turing test
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list





-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Snapshot of stack

2015-03-16 Thread Greg Young
I generally know how to snapshot the stack from outside code in C but
I am not quite sure how to translate mono methods like can be done in
a few ways (like this
http://blogs.msdn.com/b/jmstall/archive/2005/11/28/snapshot.aspx) on
the clr. Is there any equivalent way of getting this information in
mono?

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Snapshot of stack

2015-03-16 Thread Greg Young
To be clear I know I can do if installed as a profiler but would
prefer to do it from the outside

On Tue, Mar 17, 2015 at 2:07 AM, Greg Young gregoryyou...@gmail.com wrote:
 I generally know how to snapshot the stack from outside code in C but
 I am not quite sure how to translate mono methods like can be done in
 a few ways (like this
 http://blogs.msdn.com/b/jmstall/archive/2005/11/28/snapshot.aspx) on
 the clr. Is there any equivalent way of getting this information in
 mono?

 Cheers,

 Greg

 --
 Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Compiling Profiler Sample on OSX

2015-02-19 Thread Greg Young
I will be doing a talk about the profiler code I have been working on
this evening and it would be great if I could tell people that they
can use it on OSX. As of now I can't get the profiler sample to work
on OSX though if anyone knows how to get that working I can probably
handle it from there (no issues getting anything working in linux).

The behavior is that I can compile it just fine its just that none of
the callbacks ever get hit in OSX.

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] MonoMethod-MethodInfo

2015-02-15 Thread Greg Young
That is totally acceptable.

Anyone with an idea where the Module identifier sits on monoclass?

On Sun, Feb 15, 2015 at 10:52 AM, Konrad Kruczynski
kkruczyn...@antmicro.com wrote:
 Note however, that resolution via metadata token can only give you an open
 type, that is information about bound generic type is lost during MethodInfo
 - MetadataToken - MethodInfo (since, naturally, only open types are
 present in the assembly).

 --
 BR,
  Konrad

 2015-02-15 9:15 GMT+01:00 Greg Young gregoryyou...@gmail.com:

 Now to get module on the unmanaged side. I figured it might be in
 MonoClass but have yet to find it there. Maybe I should be looking
 under the referenced MonoImage (though that doesn't seem quite right)

 On Sun, Feb 15, 2015 at 9:00 AM, Jeroen Frijters jer...@sumatra.nl
 wrote:
  If you know the module on the managed side, Module.ResolveMethod() can
  be used to get a MethodInfo from a token.
 
  Regards,
  Jeroen
 
  -Original Message-
  From: mono-devel-list-boun...@lists.ximian.com [mailto:mono-devel-list-
  boun...@lists.ximian.com] On Behalf Of Greg Young
  Sent: Saturday, February 14, 2015 21:56
  To: mono-devel-list@lists.ximian.com
  Subject: [Mono-dev] MonoMethod-MethodInfo
 
  Let's say I have a MonoMethod in unmanaged code. I want to pass some
  data out of that code back into managed code (using some identifiers of
  the monomethod) so that the managed code can obtain a MethodInfo via
  reflection.
 
  At first I thought about passing the token(s). I cannot however find
  anyway of looking up a MethodInfo based on its token (nor a type ...).
  I could get the type and then iterate over the methods but this seems
  like a bad idea.
 
  1) Am I missing something with tokens on the managed side?
  2) Is there some other way of doing this that I am missing?
 
  Cheers,
 
  Greg
 
  --
  Studying for the Turing test
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
  http://lists.ximian.com/mailman/listinfo/mono-devel-list



 --
 Studying for the Turing test
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list





-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] MonoMethod-MethodInfo

2015-02-15 Thread Greg Young
Now to get module on the unmanaged side. I figured it might be in
MonoClass but have yet to find it there. Maybe I should be looking
under the referenced MonoImage (though that doesn't seem quite right)

On Sun, Feb 15, 2015 at 9:00 AM, Jeroen Frijters jer...@sumatra.nl wrote:
 If you know the module on the managed side, Module.ResolveMethod() can be 
 used to get a MethodInfo from a token.

 Regards,
 Jeroen

 -Original Message-
 From: mono-devel-list-boun...@lists.ximian.com [mailto:mono-devel-list-
 boun...@lists.ximian.com] On Behalf Of Greg Young
 Sent: Saturday, February 14, 2015 21:56
 To: mono-devel-list@lists.ximian.com
 Subject: [Mono-dev] MonoMethod-MethodInfo

 Let's say I have a MonoMethod in unmanaged code. I want to pass some
 data out of that code back into managed code (using some identifiers of
 the monomethod) so that the managed code can obtain a MethodInfo via
 reflection.

 At first I thought about passing the token(s). I cannot however find
 anyway of looking up a MethodInfo based on its token (nor a type ...).
 I could get the type and then iterate over the methods but this seems
 like a bad idea.

 1) Am I missing something with tokens on the managed side?
 2) Is there some other way of doing this that I am missing?

 Cheers,

 Greg

 --
 Studying for the Turing test
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] MonoMethod-MethodInfo

2015-02-14 Thread Greg Young
Let's say I have a MonoMethod in unmanaged code. I want to pass some
data out of that code back into managed code (using some identifiers
of the monomethod) so that the managed code can obtain a MethodInfo
via reflection.

At first I thought about passing the token(s). I cannot however find
anyway of looking up a MethodInfo based on its token (nor a type ...).
I could get the type and then iterate over the methods but this seems
like a bad idea.

1) Am I missing something with tokens on the managed side?
2) Is there some other way of doing this that I am missing?

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] MonoMethod-MethodInfo

2015-02-14 Thread Greg Young
I have to pass by lookup values. My unmanaged is running in the context of
a profiler.

On Saturday, February 14, 2015, Jonathan Chambers jonc...@gmail.com wrote:

 You could pass the manged MethodInfo* object directly into managed,
 retrieving it in native code by calling: mono_method_get_object

 Alternatively, you could pass a System.RuntimeMethodHandle struct into
 managed code (with the MonoMethod* as the value in that structure) and
 call MethodBase.GetMethodFromHandle to retrieve the method from that handle
 when needed.

 - Jonathan

 On Sat, Feb 14, 2015 at 3:56 PM, Greg Young gregoryyou...@gmail.com
 javascript:_e(%7B%7D,'cvml','gregoryyou...@gmail.com'); wrote:

 Let's say I have a MonoMethod in unmanaged code. I want to pass some
 data out of that code back into managed code (using some identifiers
 of the monomethod) so that the managed code can obtain a MethodInfo
 via reflection.

 At first I thought about passing the token(s). I cannot however find
 anyway of looking up a MethodInfo based on its token (nor a type ...).
 I could get the type and then iterate over the methods but this seems
 like a bad idea.

 1) Am I missing something with tokens on the managed side?
 2) Is there some other way of doing this that I am missing?

 Cheers,

 Greg

 --
 Studying for the Turing test
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 javascript:_e(%7B%7D,'cvml','Mono-devel-list@lists.ximian.com');
 http://lists.ximian.com/mailman/listinfo/mono-devel-list




-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Profiler Sample on Mac

2015-02-03 Thread Greg Young
The profiler is pretty straight forward to get up and running in linux
but I have been unsuccessful in getting it to work on a mac. When run
the initializer is called and it sets up its hooks, no hooks are
however called in the future.

Is there something I need to enable in mono that the profiler would
work that perhaps is getting defaulted out on my build? Or perhaps
someone has actually gotten it working in the past?

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] mono_signature_get_desc segfaults

2015-01-24 Thread Greg Young
  0 static char *
  1 get_method_name(MonoProfiler *profiler, MonoMethod *method) {
  2 MonoClass *klass = mono_method_get_class (method);
  3 if(klass == NULL) return NULL;
  4 char *signature = (char*) mono_signature_get_desc
(mono_method_signature (method), 0);
  5 if(signature == NULL) return NULL;
  6 const char *namespace = mono_class_get_namespace (klass);
  7 const char *klassname = mono_class_get_name (klass);
  8 const char *methodname = mono_method_get_class (method);
  9 //g_free (signature);
 10 char *name = g_strdup_printf (%s.%s:%s (%s),
 11  mono_class_get_namespace (klass),
 12  mono_class_get_name (klass),
 13  mono_method_get_name (method),
 14  signature);
 15 return name;
 16 }

I have been able to get it to happen rather reliably that I appear to
get back something that is a bad pointer from mono_signature_get_desc.
I am not seeing anything obviously wrong in how I am calling it but
will get a segv occasionally on the strdup_printf here. Not using the
signature makes issue go away but isnt much help:)

Am I missing something in how I should be calling get_desc? The
MonoMethod was handed to me by the runtime...

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] profile allocations

2015-01-21 Thread Greg Young
mono_profiler_set_events MONO_PROFILE_ALLOCATIONS

On Wed, Jan 21, 2015 at 8:20 PM, Greg Young gregoryyou...@gmail.com wrote:
 Is there something beyond

  mono_profiler_install_allocation (object_allocated);

 I need to do to profile allocations? I am setting up allocation
 callbacks but never receiving them.

 Cheers,

 Greg

 --
 Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] profile allocations

2015-01-21 Thread Greg Young
Is there something beyond

 mono_profiler_install_allocation (object_allocated);

I need to do to profile allocations? I am setting up allocation
callbacks but never receiving them.

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] mono_class_get_name and generics

2015-01-21 Thread Greg Young
Is there a helper method in mono to get class/method names including
generics information as opposed to the canon `1

Cheers,

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] mono_class_get_name and generics

2015-01-21 Thread Greg Young
Cheers will try it out

On Wed, Jan 21, 2015 at 11:19 PM, Rodrigo Kumpera kump...@gmail.com wrote:
 For class: mono_type_get_name (mono_class_get_type (class))

 For method: mono_method_full_name

 On Wed, Jan 21, 2015 at 11:39 AM, Greg Young gregoryyou...@gmail.com
 wrote:

 Is there a helper method in mono to get class/method names including
 generics information as opposed to the canon `1

 Cheers,

 Greg

 --
 Studying for the Turing test
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list





-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Building Profiler Example

2015-01-20 Thread Greg Young
Was trying to build the profiler example in the source tree it
mentions to build with

gcc -shared -o mono-profiler-sample.so profile.c `pkg-config --cflags
--libs mono`

I am guessing I also need a -I /mymono/includes/mono-2.0

I am still getting build errors though.

 ~/Code/profiletest  gcc -shared -o mono-profiler-sample.so profile.c
`pkg-config --cflags --libs mono` -I /opt/mono/include/mono-2.0
profile.c:19:9: warning: implicit declaration of function 'g_print' is
invalid in C99 [-Wimplicit-function-declaration]
g_print (total number of calls: %d\n, prof-ncalls);
^
profile.c:39:16: warning: implicit declaration of function 'g_new0' is
invalid in C99 [-Wimplicit-function-declaration]
prof = g_new0 (MonoProfiler, 1);
   ^
profile.c:39:24: error: unexpected type name 'MonoProfiler': expected expression
prof = g_new0 (MonoProfiler, 1);
   ^
2 warnings and 1 error generated.

What am I missing to get this to build?

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Building Profiler Example

2015-01-20 Thread Greg Young
from looking:

greg@orc ~/src/shit » pkg-config --cflags --libs mono

greg@orc ~/src/shit »

I'd guess this should be returning something? I am running with mono
in /opt/mono built from source.

Is there some step I am missing here in getting setup?

On Tue, Jan 20, 2015 at 4:18 PM, Greg Young gregoryyou...@gmail.com wrote:
 Was trying to build the profiler example in the source tree it
 mentions to build with

 gcc -shared -o mono-profiler-sample.so profile.c `pkg-config --cflags
 --libs mono`

 I am guessing I also need a -I /mymono/includes/mono-2.0

 I am still getting build errors though.

  ~/Code/profiletest  gcc -shared -o mono-profiler-sample.so profile.c
 `pkg-config --cflags --libs mono` -I /opt/mono/include/mono-2.0
 profile.c:19:9: warning: implicit declaration of function 'g_print' is
 invalid in C99 [-Wimplicit-function-declaration]
 g_print (total number of calls: %d\n, prof-ncalls);
 ^
 profile.c:39:16: warning: implicit declaration of function 'g_new0' is
 invalid in C99 [-Wimplicit-function-declaration]
 prof = g_new0 (MonoProfiler, 1);
^
 profile.c:39:24: error: unexpected type name 'MonoProfiler': expected 
 expression
 prof = g_new0 (MonoProfiler, 1);
^
 2 warnings and 1 error generated.

 What am I missing to get this to build?

 --
 Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Building Profiler Example

2015-01-20 Thread Greg Young
greg@orc ~/src/shit » export PKG_CONFIG_PATH=/usr/lib/pkgconfig

  1 ↵
greg@orc ~/src/shit » pkg-config --cflags --libs mono

greg@orc ~/src/shit »

I have a mono.pc in /usr/lib/pkgconfig

On Tue, Jan 20, 2015 at 8:54 PM, Greg Young gregoryyou...@gmail.com wrote:
 from looking:

 greg@orc ~/src/shit » pkg-config --cflags --libs mono

 greg@orc ~/src/shit »

 I'd guess this should be returning something? I am running with mono
 in /opt/mono built from source.

 Is there some step I am missing here in getting setup?

 On Tue, Jan 20, 2015 at 4:18 PM, Greg Young gregoryyou...@gmail.com wrote:
 Was trying to build the profiler example in the source tree it
 mentions to build with

 gcc -shared -o mono-profiler-sample.so profile.c `pkg-config --cflags
 --libs mono`

 I am guessing I also need a -I /mymono/includes/mono-2.0

 I am still getting build errors though.

  ~/Code/profiletest  gcc -shared -o mono-profiler-sample.so profile.c
 `pkg-config --cflags --libs mono` -I /opt/mono/include/mono-2.0
 profile.c:19:9: warning: implicit declaration of function 'g_print' is
 invalid in C99 [-Wimplicit-function-declaration]
 g_print (total number of calls: %d\n, prof-ncalls);
 ^
 profile.c:39:16: warning: implicit declaration of function 'g_new0' is
 invalid in C99 [-Wimplicit-function-declaration]
 prof = g_new0 (MonoProfiler, 1);
^
 profile.c:39:24: error: unexpected type name 'MonoProfiler': expected 
 expression
 prof = g_new0 (MonoProfiler, 1);
^
 2 warnings and 1 error generated.

 What am I missing to get this to build?

 --
 Studying for the Turing test



 --
 Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Building Profiler Example

2015-01-20 Thread Greg Young
Have it building now but after dumping gnew for malloc

have tried things like
gcc -shared -o mono-profiler-sample.so profiler.c
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
-lglib-2.0 -fPIC

with malloc it can compile with
gcc -shared -o mono-profiler-sample.so profiler.c  -fPIC

On Tue, Jan 20, 2015 at 11:48 PM, Greg Young gregoryyou...@gmail.com wrote:
 So after some work I am back to where I was.

 [mono] \w @ pkg-config --cflags --libs mono

   1 ↵

 [mono] \w @ pkg-config --cflags --libs dotnet
  -r:Accessibility.dll -r:cscompmgd.dll -r:Microsoft.VisualC.dll
 -r:System.Configuration.Install.dll -r:System.Data.dll
 -r:System.Data.OracleClient.dll -r:System.Design.dll
 -r:System.DirectoryServices.dll -r:System.dll
 -r:System.Drawing.Design.dll -r:System.Drawing.dll
 -r:System.EnterpriseServices.dll -r:System.Management.dll
 -r:System.Messaging.dll -r:System.Runtime.Remoting.dll
 -r:System.Runtime.Serialization.Formatters.Soap.dll
 -r:System.Security.dll -r:System.ServiceProcess.dll -r:System.Web.dll
 -r:System.Web.Services.dll -r:System.Windows.Forms.dll
 -r:System.Xml.dll

 I am guessing I need to go through the task of installing gnome to
 /opt/gnome but keep thinking there must be an easier way (the bit
 missing is from gnome though I am a bit surprised that I get nothing
 at all on --libs mono

 I am curious can you actually build the sample with your parallel
 build? I have been able to most everything else so far

 On Tue, Jan 20, 2015 at 9:44 PM, Greg Young gregoryyou...@gmail.com wrote:


 On Tuesday, January 20, 2015, Andres G. Aragoneses kno...@gmail.com wrote:

 On 20/01/15 20:19, Greg Young wrote:

 This is roughly what our scripts do.

 https://github.com/EventStore/EventStore/blob/dev/src/Scripts/get-mono


 So, are you running your pkg-config test inside the `[mono]` shell?


 Have pkg config paths set to include /opt/mono/lib/pkgconfig

 Pkg-config for dotnet gives back things but not mono.

 I have most of the paths there setup except for the gnome ones. I am
 guessing I have to build gnome to /opt/gnome is this part of what you are
 doing? The gnew function is gnome iirc



 We don't rebuild all the dependencies from source as specified but


 Rebuild dependencies of mono from sources? I don't do that either, I don't
 think the URL I gave you recommends this.


  Hmm they have like 5 things to build from source



 mono is definitely done this way also it being that documentation is
 from Mono 1.1.9.1 I can only imagine the shear amount of yak shaving
 in trying to get it to work with current sources.


 I've been using a mono parallel environment for years in order to run two
 mono installations in the same computer at the same time (especially to test
 master branch). I don't think the wiki page I pointed you is obsolete at
 all.


 On Tue, Jan 20, 2015 at 9:06 PM, Andres G. Aragoneses kno...@gmail.com
 wrote:

 Are you using a parallel mono environment[1] for your /opt/mono
 installation?

 If not, then I'm not surprised that you're having pkg-config problems
 and
 the like.

 [1]

 http://www.mono-project.com/docs/compiling-mono/parallel-mono-environments/


 On 20/01/15 19:54, Greg Young wrote:


 from looking:

 greg@orc ~/src/shit » pkg-config --cflags --libs mono

 greg@orc ~/src/shit »

 I'd guess this should be returning something? I am running with mono
 in /opt/mono built from source.

 Is there some step I am missing here in getting setup?

 On Tue, Jan 20, 2015 at 4:18 PM, Greg Young gregoryyou...@gmail.com
 wrote:


 Was trying to build the profiler example in the source tree it
 mentions to build with

 gcc -shared -o mono-profiler-sample.so profile.c `pkg-config --cflags
 --libs mono`

 I am guessing I also need a -I /mymono/includes/mono-2.0

 I am still getting build errors though.

~/Code/profiletest  gcc -shared -o mono-profiler-sample.so
 profile.c
 `pkg-config --cflags --libs mono` -I /opt/mono/include/mono-2.0
 profile.c:19:9: warning: implicit declaration of function 'g_print' is
 invalid in C99 [-Wimplicit-function-declaration]
   g_print (total number of calls: %d\n, prof-ncalls);
   ^
 profile.c:39:16: warning: implicit declaration of function 'g_new0' is
 invalid in C99 [-Wimplicit-function-declaration]
   prof = g_new0 (MonoProfiler, 1);
  ^
 profile.c:39:24: error: unexpected type name 'MonoProfiler': expected
 expression
   prof = g_new0 (MonoProfiler, 1);
  ^
 2 warnings and 1 error generated.

 What am I missing to get this to build?

 --
 Studying for the Turing test







 ___
 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] Building Profiler Example

2015-01-20 Thread Greg Young
So after some work I am back to where I was.

[mono] \w @ pkg-config --cflags --libs mono

  1 ↵

[mono] \w @ pkg-config --cflags --libs dotnet
 -r:Accessibility.dll -r:cscompmgd.dll -r:Microsoft.VisualC.dll
-r:System.Configuration.Install.dll -r:System.Data.dll
-r:System.Data.OracleClient.dll -r:System.Design.dll
-r:System.DirectoryServices.dll -r:System.dll
-r:System.Drawing.Design.dll -r:System.Drawing.dll
-r:System.EnterpriseServices.dll -r:System.Management.dll
-r:System.Messaging.dll -r:System.Runtime.Remoting.dll
-r:System.Runtime.Serialization.Formatters.Soap.dll
-r:System.Security.dll -r:System.ServiceProcess.dll -r:System.Web.dll
-r:System.Web.Services.dll -r:System.Windows.Forms.dll
-r:System.Xml.dll

I am guessing I need to go through the task of installing gnome to
/opt/gnome but keep thinking there must be an easier way (the bit
missing is from gnome though I am a bit surprised that I get nothing
at all on --libs mono

I am curious can you actually build the sample with your parallel
build? I have been able to most everything else so far

On Tue, Jan 20, 2015 at 9:44 PM, Greg Young gregoryyou...@gmail.com wrote:


 On Tuesday, January 20, 2015, Andres G. Aragoneses kno...@gmail.com wrote:

 On 20/01/15 20:19, Greg Young wrote:

 This is roughly what our scripts do.

 https://github.com/EventStore/EventStore/blob/dev/src/Scripts/get-mono


 So, are you running your pkg-config test inside the `[mono]` shell?


 Have pkg config paths set to include /opt/mono/lib/pkgconfig

 Pkg-config for dotnet gives back things but not mono.

 I have most of the paths there setup except for the gnome ones. I am
 guessing I have to build gnome to /opt/gnome is this part of what you are
 doing? The gnew function is gnome iirc



 We don't rebuild all the dependencies from source as specified but


 Rebuild dependencies of mono from sources? I don't do that either, I don't
 think the URL I gave you recommends this.


  Hmm they have like 5 things to build from source



 mono is definitely done this way also it being that documentation is
 from Mono 1.1.9.1 I can only imagine the shear amount of yak shaving
 in trying to get it to work with current sources.


 I've been using a mono parallel environment for years in order to run two
 mono installations in the same computer at the same time (especially to test
 master branch). I don't think the wiki page I pointed you is obsolete at
 all.


 On Tue, Jan 20, 2015 at 9:06 PM, Andres G. Aragoneses kno...@gmail.com
 wrote:

 Are you using a parallel mono environment[1] for your /opt/mono
 installation?

 If not, then I'm not surprised that you're having pkg-config problems
 and
 the like.

 [1]

 http://www.mono-project.com/docs/compiling-mono/parallel-mono-environments/


 On 20/01/15 19:54, Greg Young wrote:


 from looking:

 greg@orc ~/src/shit » pkg-config --cflags --libs mono

 greg@orc ~/src/shit »

 I'd guess this should be returning something? I am running with mono
 in /opt/mono built from source.

 Is there some step I am missing here in getting setup?

 On Tue, Jan 20, 2015 at 4:18 PM, Greg Young gregoryyou...@gmail.com
 wrote:


 Was trying to build the profiler example in the source tree it
 mentions to build with

 gcc -shared -o mono-profiler-sample.so profile.c `pkg-config --cflags
 --libs mono`

 I am guessing I also need a -I /mymono/includes/mono-2.0

 I am still getting build errors though.

~/Code/profiletest  gcc -shared -o mono-profiler-sample.so
 profile.c
 `pkg-config --cflags --libs mono` -I /opt/mono/include/mono-2.0
 profile.c:19:9: warning: implicit declaration of function 'g_print' is
 invalid in C99 [-Wimplicit-function-declaration]
   g_print (total number of calls: %d\n, prof-ncalls);
   ^
 profile.c:39:16: warning: implicit declaration of function 'g_new0' is
 invalid in C99 [-Wimplicit-function-declaration]
   prof = g_new0 (MonoProfiler, 1);
  ^
 profile.c:39:24: error: unexpected type name 'MonoProfiler': expected
 expression
   prof = g_new0 (MonoProfiler, 1);
  ^
 2 warnings and 1 error generated.

 What am I missing to get this to build?

 --
 Studying for the Turing test







 ___
 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



 --
 Studying for the Turing test




-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Building Profiler Example

2015-01-20 Thread Greg Young
And I got it working (with malloc) and pkg-config

[mono] \w @ gcc -shared -o mono-profiler-sample.so profiler.c
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
-lglib-2.0 `pkg-config --cflags --libs mono-2` -fPIC

its mono-2 or mono0-sgen2 not mono.

On Wed, Jan 21, 2015 at 3:04 AM, Greg Young gregoryyou...@gmail.com wrote:
 Have it building now but after dumping gnew for malloc

 have tried things like
 gcc -shared -o mono-profiler-sample.so profiler.c
 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
 -lglib-2.0 -fPIC

 with malloc it can compile with
 gcc -shared -o mono-profiler-sample.so profiler.c  -fPIC

 On Tue, Jan 20, 2015 at 11:48 PM, Greg Young gregoryyou...@gmail.com wrote:
 So after some work I am back to where I was.

 [mono] \w @ pkg-config --cflags --libs mono

   1 ↵

 [mono] \w @ pkg-config --cflags --libs dotnet
  -r:Accessibility.dll -r:cscompmgd.dll -r:Microsoft.VisualC.dll
 -r:System.Configuration.Install.dll -r:System.Data.dll
 -r:System.Data.OracleClient.dll -r:System.Design.dll
 -r:System.DirectoryServices.dll -r:System.dll
 -r:System.Drawing.Design.dll -r:System.Drawing.dll
 -r:System.EnterpriseServices.dll -r:System.Management.dll
 -r:System.Messaging.dll -r:System.Runtime.Remoting.dll
 -r:System.Runtime.Serialization.Formatters.Soap.dll
 -r:System.Security.dll -r:System.ServiceProcess.dll -r:System.Web.dll
 -r:System.Web.Services.dll -r:System.Windows.Forms.dll
 -r:System.Xml.dll

 I am guessing I need to go through the task of installing gnome to
 /opt/gnome but keep thinking there must be an easier way (the bit
 missing is from gnome though I am a bit surprised that I get nothing
 at all on --libs mono

 I am curious can you actually build the sample with your parallel
 build? I have been able to most everything else so far

 On Tue, Jan 20, 2015 at 9:44 PM, Greg Young gregoryyou...@gmail.com wrote:


 On Tuesday, January 20, 2015, Andres G. Aragoneses kno...@gmail.com wrote:

 On 20/01/15 20:19, Greg Young wrote:

 This is roughly what our scripts do.

 https://github.com/EventStore/EventStore/blob/dev/src/Scripts/get-mono


 So, are you running your pkg-config test inside the `[mono]` shell?


 Have pkg config paths set to include /opt/mono/lib/pkgconfig

 Pkg-config for dotnet gives back things but not mono.

 I have most of the paths there setup except for the gnome ones. I am
 guessing I have to build gnome to /opt/gnome is this part of what you are
 doing? The gnew function is gnome iirc



 We don't rebuild all the dependencies from source as specified but


 Rebuild dependencies of mono from sources? I don't do that either, I don't
 think the URL I gave you recommends this.


  Hmm they have like 5 things to build from source



 mono is definitely done this way also it being that documentation is
 from Mono 1.1.9.1 I can only imagine the shear amount of yak shaving
 in trying to get it to work with current sources.


 I've been using a mono parallel environment for years in order to run two
 mono installations in the same computer at the same time (especially to 
 test
 master branch). I don't think the wiki page I pointed you is obsolete at
 all.


 On Tue, Jan 20, 2015 at 9:06 PM, Andres G. Aragoneses kno...@gmail.com
 wrote:

 Are you using a parallel mono environment[1] for your /opt/mono
 installation?

 If not, then I'm not surprised that you're having pkg-config problems
 and
 the like.

 [1]

 http://www.mono-project.com/docs/compiling-mono/parallel-mono-environments/


 On 20/01/15 19:54, Greg Young wrote:


 from looking:

 greg@orc ~/src/shit » pkg-config --cflags --libs mono

 greg@orc ~/src/shit »

 I'd guess this should be returning something? I am running with mono
 in /opt/mono built from source.

 Is there some step I am missing here in getting setup?

 On Tue, Jan 20, 2015 at 4:18 PM, Greg Young gregoryyou...@gmail.com
 wrote:


 Was trying to build the profiler example in the source tree it
 mentions to build with

 gcc -shared -o mono-profiler-sample.so profile.c `pkg-config --cflags
 --libs mono`

 I am guessing I also need a -I /mymono/includes/mono-2.0

 I am still getting build errors though.

~/Code/profiletest  gcc -shared -o mono-profiler-sample.so
 profile.c
 `pkg-config --cflags --libs mono` -I /opt/mono/include/mono-2.0
 profile.c:19:9: warning: implicit declaration of function 'g_print' is
 invalid in C99 [-Wimplicit-function-declaration]
   g_print (total number of calls: %d\n, prof-ncalls);
   ^
 profile.c:39:16: warning: implicit declaration of function 'g_new0' is
 invalid in C99 [-Wimplicit-function-declaration]
   prof = g_new0 (MonoProfiler, 1);
  ^
 profile.c:39:24: error: unexpected type name 'MonoProfiler': expected
 expression
   prof = g_new0 (MonoProfiler, 1);
  ^
 2 warnings and 1 error generated.

 What am I missing to get this to build?

 --
 Studying for the Turing test

Re: [Mono-dev] Building Profiler Example

2015-01-20 Thread Greg Young
This is roughly what our scripts do.

https://github.com/EventStore/EventStore/blob/dev/src/Scripts/get-mono
We don't rebuild all the dependencies from source as specified but
mono is definitely done this way also it being that documentation is
from Mono 1.1.9.1 I can only imagine the shear amount of yak shaving
in trying to get it to work with current sources.



On Tue, Jan 20, 2015 at 9:06 PM, Andres G. Aragoneses kno...@gmail.com wrote:
 Are you using a parallel mono environment[1] for your /opt/mono
 installation?

 If not, then I'm not surprised that you're having pkg-config problems and
 the like.

 [1]
 http://www.mono-project.com/docs/compiling-mono/parallel-mono-environments/


 On 20/01/15 19:54, Greg Young wrote:

 from looking:

 greg@orc ~/src/shit » pkg-config --cflags --libs mono

 greg@orc ~/src/shit »

 I'd guess this should be returning something? I am running with mono
 in /opt/mono built from source.

 Is there some step I am missing here in getting setup?

 On Tue, Jan 20, 2015 at 4:18 PM, Greg Young gregoryyou...@gmail.com
 wrote:

 Was trying to build the profiler example in the source tree it
 mentions to build with

 gcc -shared -o mono-profiler-sample.so profile.c `pkg-config --cflags
 --libs mono`

 I am guessing I also need a -I /mymono/includes/mono-2.0

 I am still getting build errors though.

   ~/Code/profiletest  gcc -shared -o mono-profiler-sample.so profile.c
 `pkg-config --cflags --libs mono` -I /opt/mono/include/mono-2.0
 profile.c:19:9: warning: implicit declaration of function 'g_print' is
 invalid in C99 [-Wimplicit-function-declaration]
  g_print (total number of calls: %d\n, prof-ncalls);
  ^
 profile.c:39:16: warning: implicit declaration of function 'g_new0' is
 invalid in C99 [-Wimplicit-function-declaration]
  prof = g_new0 (MonoProfiler, 1);
 ^
 profile.c:39:24: error: unexpected type name 'MonoProfiler': expected
 expression
  prof = g_new0 (MonoProfiler, 1);
 ^
 2 warnings and 1 error generated.

 What am I missing to get this to build?

 --
 Studying for the Turing test






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



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Building Profiler Example

2015-01-20 Thread Greg Young
On Tuesday, January 20, 2015, Andres G. Aragoneses kno...@gmail.com wrote:

 On 20/01/15 20:19, Greg Young wrote:

 This is roughly what our scripts do.

 https://github.com/EventStore/EventStore/blob/dev/src/Scripts/get-mono


 So, are you running your pkg-config test inside the `[mono]` shell?


Have pkg config paths set to include /opt/mono/lib/pkgconfig

Pkg-config for dotnet gives back things but not mono.

I have most of the paths there setup except for the gnome ones. I am
guessing I have to build gnome to /opt/gnome is this part of what you are
doing? The gnew function is gnome iirc



  We don't rebuild all the dependencies from source as specified but


 Rebuild dependencies of mono from sources? I don't do that either, I don't
 think the URL I gave you recommends this.


 Hmm they have like 5 things to build from source



  mono is definitely done this way also it being that documentation is
 from Mono 1.1.9.1 I can only imagine the shear amount of yak shaving
 in trying to get it to work with current sources.


 I've been using a mono parallel environment for years in order to run two
 mono installations in the same computer at the same time (especially to
 test master branch). I don't think the wiki page I pointed you is obsolete
 at all.


  On Tue, Jan 20, 2015 at 9:06 PM, Andres G. Aragoneses kno...@gmail.com
 wrote:

 Are you using a parallel mono environment[1] for your /opt/mono
 installation?

 If not, then I'm not surprised that you're having pkg-config problems and
 the like.

 [1]
 http://www.mono-project.com/docs/compiling-mono/parallel-
 mono-environments/


 On 20/01/15 19:54, Greg Young wrote:


 from looking:

 greg@orc ~/src/shit » pkg-config --cflags --libs mono

 greg@orc ~/src/shit »

 I'd guess this should be returning something? I am running with mono
 in /opt/mono built from source.

 Is there some step I am missing here in getting setup?

 On Tue, Jan 20, 2015 at 4:18 PM, Greg Young gregoryyou...@gmail.com
 wrote:


 Was trying to build the profiler example in the source tree it
 mentions to build with

 gcc -shared -o mono-profiler-sample.so profile.c `pkg-config --cflags
 --libs mono`

 I am guessing I also need a -I /mymono/includes/mono-2.0

 I am still getting build errors though.

~/Code/profiletest  gcc -shared -o mono-profiler-sample.so
 profile.c
 `pkg-config --cflags --libs mono` -I /opt/mono/include/mono-2.0
 profile.c:19:9: warning: implicit declaration of function 'g_print' is
 invalid in C99 [-Wimplicit-function-declaration]
   g_print (total number of calls: %d\n, prof-ncalls);
   ^
 profile.c:39:16: warning: implicit declaration of function 'g_new0' is
 invalid in C99 [-Wimplicit-function-declaration]
   prof = g_new0 (MonoProfiler, 1);
  ^
 profile.c:39:24: error: unexpected type name 'MonoProfiler': expected
 expression
   prof = g_new0 (MonoProfiler, 1);
  ^
 2 warnings and 1 error generated.

 What am I missing to get this to build?

 --
 Studying for the Turing test







 ___
 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



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] SafeFileHandle

2015-01-12 Thread Greg Young
_wapi_handle_unref_full: Attempting to unref unused handle 0x8a

I seem to be getting this message from the runtime not sure what could
be causing it. From some googling this appears to happen when you
close a file handle multiple times.

The only place close is called is :

protected override void Dispose(bool disposing)
{
if(_handle == null) return;
Flush();
_handle.Close();
_handle = null;
   snip

Not sure how it could be called multiple times. I don't get any issues
on the CLR.

Any ideas?

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] SafeFileHandle

2015-01-12 Thread Greg Young
I have one I can file. I figured it was something on my side though.

Could it be the FileHandle closing itself later for a second time? Are
there other scenarios aside from close this can happen on?

In general SafeFileHandle is pretty painful to use since none of the
definitions support it.

Want me to create an issue?

Greg

On Tue, Jan 13, 2015 at 12:32 AM, Zoltan Varga var...@gmail.com wrote:
 Hi,

   This is a bug, it shouldn't happen. If you have some kind of reproducible
 test case, please file a bug report with it.

 Zoltan

 On Mon, Jan 12, 2015 at 5:28 PM, Greg Young gregoryyou...@gmail.com wrote:

 _wapi_handle_unref_full: Attempting to unref unused handle 0x8a

 I seem to be getting this message from the runtime not sure what could
 be causing it. From some googling this appears to happen when you
 close a file handle multiple times.

 The only place close is called is :

 protected override void Dispose(bool disposing)
 {
 if(_handle == null) return;
 Flush();
 _handle.Close();
 _handle = null;
snip

 Not sure how it could be called multiple times. I don't get any issues
 on the CLR.

 Any ideas?

 Greg

 --
 Studying for the Turing test
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list





-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] SafeFileHandle

2015-01-12 Thread Greg Young
Here is the code as well in case you see something obvious. I could
probably make it smaller but this is pretty simple.

The message happens asynchronously well after the code is run (as you
can see from the outputs). Causing a gc seems to make it happen sooner
which made me think finalizer

[Test]
public void shitbird_test() {
   var filename = GetFilePathFor(Guid.NewGuid().ToString());
   using(var stream = new shitstream(filename)) {
   Console.WriteLine(stream.Position);
   }
   Console.WriteLine(done);
}

public class shitstream : Stream {
private SafeFileHandle _handle;

 public shitstream(string filename) {
var han = Syscall.open(filename, OpenFlags.O_CREAT |
OpenFlags.O_RDONLY, FilePermissions.S_IRWXU);
var _handle = new SafeFileHandle((IntPtr) han, true);
if(_handle.IsInvalid) throw new Exception(Invalid handle);
}

public override void Flush() {}
public override long Seek(long offset, SeekOrigin origin){return 0;}

public override void SetLength(long value){}

public override int Read(byte[] buffer, int offset, int count)
{return 0;}
public override void Write(byte[] buffer, int offset, int count) {}

public override bool CanRead
{
get { return true; }
}

public override bool CanSeek
{
get  { return true;}
}

public override bool CanWrite
{
get { return true; }
}

public override long Length
{
get  { return 0;}
}

public override long Position
{
get { return 0;}
set  {}
}

protected override void Dispose(bool disposing)
{
if(_handle == null) return;
_handle.Close();
_handle = null;
GC.SuppressFinalize (this);
}
}

On Tue, Jan 13, 2015 at 12:46 AM, Zoltan Varga var...@gmail.com wrote:
 Hi,

   Yes, please file a report.

  Zoltan

 On Mon, Jan 12, 2015 at 5:42 PM, Greg Young gregoryyou...@gmail.com wrote:

 I have one I can file. I figured it was something on my side though.

 Could it be the FileHandle closing itself later for a second time? Are
 there other scenarios aside from close this can happen on?

 In general SafeFileHandle is pretty painful to use since none of the
 definitions support it.

 Want me to create an issue?

 Greg

 On Tue, Jan 13, 2015 at 12:32 AM, Zoltan Varga var...@gmail.com wrote:
  Hi,
 
This is a bug, it shouldn't happen. If you have some kind of
  reproducible
  test case, please file a bug report with it.
 
  Zoltan
 
  On Mon, Jan 12, 2015 at 5:28 PM, Greg Young gregoryyou...@gmail.com
  wrote:
 
  _wapi_handle_unref_full: Attempting to unref unused handle 0x8a
 
  I seem to be getting this message from the runtime not sure what could
  be causing it. From some googling this appears to happen when you
  close a file handle multiple times.
 
  The only place close is called is :
 
  protected override void Dispose(bool disposing)
  {
  if(_handle == null) return;
  Flush();
  _handle.Close();
  _handle = null;
 snip
 
  Not sure how it could be called multiple times. I don't get any issues
  on the CLR.
 
  Any ideas?
 
  Greg
 
  --
  Studying for the Turing test
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
  http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 



 --
 Studying for the Turing test





-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Unix.Native

2015-01-12 Thread Greg Young
I have been trying to set F_NOCACHE via fcntl on a mac to no avail.

 r = Syscall.fcntl
(handle.DangerousGetHandle().ToInt32(), (FcntlCommand) MAC_F_NOCACHE,
1);
 } while (UnixMarshal.ShouldRetrySyscall ((int) r));
 if (r == -1)
 UnixMarshal.ThrowExceptionForLastError ();

(EINVAL)

I have tried
48
0x400
and 0x4
for F_NOCACHE though from
https://github.com/realthunder/mac-headers/blob/master/usr/include/sys/fcntl.h#L256

Given FcntlCommandFlags does not expose F_NOCACHE but it still should
be fine to jam the value into the enum

Has anyone set this before? Chances of finding this on google are
slightly better than 0 :)

Cheers,

Greg
-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Unix.Native

2015-01-12 Thread Greg Young
If we can get a list of all the params that need to be supported and
the varying mappings I have no problem working on it.

I will look into its build etc as I have never dealt with it internally.

Greg

On Tue, Jan 13, 2015 at 3:48 AM, Rodrigo Kumpera kump...@gmail.com wrote:
 I agree we would be better with a better error message.

 Said that, right now Mono.Posix lacks a more dedicated maintainer and it
 would be lovely if you
 could bring some love to it. :)

 On Mon, Jan 12, 2015 at 8:39 PM, Greg Young gregoryyou...@gmail.com wrote:

 There are a ton to surface ... I just ran into this one :)

 In general I agree with you surfacing is better I was thinking just
 letting me call it if it doesn't understand it (or having a better
 message) would be useful. I spun for hours thinking what was wrong
 with my parameters to the call thinking it for some undocumented
 reason was returning EINVAL :)

 On Tue, Jan 13, 2015 at 3:30 AM, Rodrigo Kumpera kump...@gmail.com
 wrote:
  That would change the behavior of the function and translate into a more
  fragile API.
 
  The way to go is to surface this option.
 
  On Mon, Jan 12, 2015 at 8:23 PM, Greg Young gregoryyou...@gmail.com
  wrote:
 
  I figured out why after a while of looking. The C code translates the
  argument
 
  int Mono_Posix_FromFcntlCommand (int x, int *r)
 
  When its something that is not a known command it returns EINVAL.
  Might a better option be to try to let it pass through otherwise how
  could I call for instance a value on a ac?
 
  Cheers,
 
  Greg
 
  On Tue, Jan 13, 2015 at 2:28 AM, Greg Young gregoryyou...@gmail.com
  wrote:
   I have been trying to set F_NOCACHE via fcntl on a mac to no avail.
  
r = Syscall.fcntl
   (handle.DangerousGetHandle().ToInt32(), (FcntlCommand) MAC_F_NOCACHE,
   1);
} while (UnixMarshal.ShouldRetrySyscall ((int) r));
if (r == -1)
UnixMarshal.ThrowExceptionForLastError ();
  
   (EINVAL)
  
   I have tried
   48
   0x400
   and 0x4
   for F_NOCACHE though from
  
  
   https://github.com/realthunder/mac-headers/blob/master/usr/include/sys/fcntl.h#L256
  
   Given FcntlCommandFlags does not expose F_NOCACHE but it still should
   be fine to jam the value into the enum
  
   Has anyone set this before? Chances of finding this on google are
   slightly better than 0 :)
  
   Cheers,
  
   Greg
   --
   Studying for the Turing test
 
 
 
  --
  Studying for the Turing test
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
  http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 



 --
 Studying for the Turing test





-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Unix.Native

2015-01-12 Thread Greg Young
Rodrigo,

What do you think as a pattern (there are quite a few places like
this) if it were to do something like:

[Conditional(DEBUG)]
private void VerifyCommandEnumT(T enum) {
if(!Enum.IsDefined(typeof(T), command))
   throw new Exception(string.Format(The value passed '{0}'
for {1} is not  a defined value and will fail at runtime., enum,
typeof(T).ToString());
}

This will be slower but will give a reasonably sane error in debug at
least. I can send over a PR with a few of them covered but wanted to
run it by here before I spent the time on it.

Greg

On Tue, Jan 13, 2015 at 4:16 AM, Greg Young gregoryyou...@gmail.com wrote:
 btw if anyone runs into this (should be a top google result) and the
 constants are not in commands here is how to do it:

 Not the prettiest but it should work

 #if __MonoCS__ || USE_UNIX_IO
 [DllImport(libc)]
 static extern int fcntl(int fd, uint command, int arg);
 #endif

 if (OS.OsFlavor != OsFlavor.MacOS) return;
 #if __MonoCS__ || USE_UNIX_IO
 long r = 0;
 do {
 r = fcntl (handle.DangerousGetHandle().ToInt32(), MAC_F_NOCACHE, 1);
 } while (UnixMarshal.ShouldRetrySyscall ((int) r));
 if (r == -1)
 UnixMarshal.ThrowExceptionForLastError ();
 #endif

 On Tue, Jan 13, 2015 at 3:49 AM, Greg Young gregoryyou...@gmail.com wrote:
 If we can get a list of all the params that need to be supported and
 the varying mappings I have no problem working on it.

 I will look into its build etc as I have never dealt with it internally.

 Greg

 On Tue, Jan 13, 2015 at 3:48 AM, Rodrigo Kumpera kump...@gmail.com wrote:
 I agree we would be better with a better error message.

 Said that, right now Mono.Posix lacks a more dedicated maintainer and it
 would be lovely if you
 could bring some love to it. :)

 On Mon, Jan 12, 2015 at 8:39 PM, Greg Young gregoryyou...@gmail.com wrote:

 There are a ton to surface ... I just ran into this one :)

 In general I agree with you surfacing is better I was thinking just
 letting me call it if it doesn't understand it (or having a better
 message) would be useful. I spun for hours thinking what was wrong
 with my parameters to the call thinking it for some undocumented
 reason was returning EINVAL :)

 On Tue, Jan 13, 2015 at 3:30 AM, Rodrigo Kumpera kump...@gmail.com
 wrote:
  That would change the behavior of the function and translate into a more
  fragile API.
 
  The way to go is to surface this option.
 
  On Mon, Jan 12, 2015 at 8:23 PM, Greg Young gregoryyou...@gmail.com
  wrote:
 
  I figured out why after a while of looking. The C code translates the
  argument
 
  int Mono_Posix_FromFcntlCommand (int x, int *r)
 
  When its something that is not a known command it returns EINVAL.
  Might a better option be to try to let it pass through otherwise how
  could I call for instance a value on a ac?
 
  Cheers,
 
  Greg
 
  On Tue, Jan 13, 2015 at 2:28 AM, Greg Young gregoryyou...@gmail.com
  wrote:
   I have been trying to set F_NOCACHE via fcntl on a mac to no avail.
  
r = Syscall.fcntl
   (handle.DangerousGetHandle().ToInt32(), (FcntlCommand) MAC_F_NOCACHE,
   1);
} while (UnixMarshal.ShouldRetrySyscall ((int) r));
if (r == -1)
UnixMarshal.ThrowExceptionForLastError ();
  
   (EINVAL)
  
   I have tried
   48
   0x400
   and 0x4
   for F_NOCACHE though from
  
  
   https://github.com/realthunder/mac-headers/blob/master/usr/include/sys/fcntl.h#L256
  
   Given FcntlCommandFlags does not expose F_NOCACHE but it still should
   be fine to jam the value into the enum
  
   Has anyone set this before? Chances of finding this on google are
   slightly better than 0 :)
  
   Cheers,
  
   Greg
   --
   Studying for the Turing test
 
 
 
  --
  Studying for the Turing test
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
  http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 



 --
 Studying for the Turing test





 --
 Studying for the Turing test



 --
 Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Unix.Native

2015-01-12 Thread Greg Young
There are a ton to surface ... I just ran into this one :)

In general I agree with you surfacing is better I was thinking just
letting me call it if it doesn't understand it (or having a better
message) would be useful. I spun for hours thinking what was wrong
with my parameters to the call thinking it for some undocumented
reason was returning EINVAL :)

On Tue, Jan 13, 2015 at 3:30 AM, Rodrigo Kumpera kump...@gmail.com wrote:
 That would change the behavior of the function and translate into a more
 fragile API.

 The way to go is to surface this option.

 On Mon, Jan 12, 2015 at 8:23 PM, Greg Young gregoryyou...@gmail.com wrote:

 I figured out why after a while of looking. The C code translates the
 argument

 int Mono_Posix_FromFcntlCommand (int x, int *r)

 When its something that is not a known command it returns EINVAL.
 Might a better option be to try to let it pass through otherwise how
 could I call for instance a value on a ac?

 Cheers,

 Greg

 On Tue, Jan 13, 2015 at 2:28 AM, Greg Young gregoryyou...@gmail.com
 wrote:
  I have been trying to set F_NOCACHE via fcntl on a mac to no avail.
 
   r = Syscall.fcntl
  (handle.DangerousGetHandle().ToInt32(), (FcntlCommand) MAC_F_NOCACHE,
  1);
   } while (UnixMarshal.ShouldRetrySyscall ((int) r));
   if (r == -1)
   UnixMarshal.ThrowExceptionForLastError ();
 
  (EINVAL)
 
  I have tried
  48
  0x400
  and 0x4
  for F_NOCACHE though from
 
  https://github.com/realthunder/mac-headers/blob/master/usr/include/sys/fcntl.h#L256
 
  Given FcntlCommandFlags does not expose F_NOCACHE but it still should
  be fine to jam the value into the enum
 
  Has anyone set this before? Chances of finding this on google are
  slightly better than 0 :)
 
  Cheers,
 
  Greg
  --
  Studying for the Turing test



 --
 Studying for the Turing test
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list





-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Unix.Native

2015-01-12 Thread Greg Young
I figured out why after a while of looking. The C code translates the argument

int Mono_Posix_FromFcntlCommand (int x, int *r)

When its something that is not a known command it returns EINVAL.
Might a better option be to try to let it pass through otherwise how
could I call for instance a value on a ac?

Cheers,

Greg

On Tue, Jan 13, 2015 at 2:28 AM, Greg Young gregoryyou...@gmail.com wrote:
 I have been trying to set F_NOCACHE via fcntl on a mac to no avail.

  r = Syscall.fcntl
 (handle.DangerousGetHandle().ToInt32(), (FcntlCommand) MAC_F_NOCACHE,
 1);
  } while (UnixMarshal.ShouldRetrySyscall ((int) r));
  if (r == -1)
  UnixMarshal.ThrowExceptionForLastError ();

 (EINVAL)

 I have tried
 48
 0x400
 and 0x4
 for F_NOCACHE though from
 https://github.com/realthunder/mac-headers/blob/master/usr/include/sys/fcntl.h#L256

 Given FcntlCommandFlags does not expose F_NOCACHE but it still should
 be fine to jam the value into the enum

 Has anyone set this before? Chances of finding this on google are
 slightly better than 0 :)

 Cheers,

 Greg
 --
 Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Unix.Native

2015-01-12 Thread Greg Young
I would guess it to be the same for others like F_RDAHEAD

I don't think the long is too horrible as its only defined as 0/non-zero

On Tue, Jan 13, 2015 at 6:15 AM, Miguel de Icaza mig...@xamarin.com wrote:
 I added support for this on master.

 That said, there is an issue that I think will bite us.

 Currently the fcntl P/Invoke declaration uses a long as a general purpose
 way of passing flags to fcntl, and I suspect the parameter to F_NOCACHE
 should be an int.

 Thoughts?

 Miguel

 On Mon, Jan 12, 2015 at 7:28 PM, Greg Young gregoryyou...@gmail.com wrote:

 I have been trying to set F_NOCACHE via fcntl on a mac to no avail.

  r = Syscall.fcntl
 (handle.DangerousGetHandle().ToInt32(), (FcntlCommand) MAC_F_NOCACHE,
 1);
  } while (UnixMarshal.ShouldRetrySyscall ((int) r));
  if (r == -1)
  UnixMarshal.ThrowExceptionForLastError ();

 (EINVAL)

 I have tried
 48
 0x400
 and 0x4
 for F_NOCACHE though from

 https://github.com/realthunder/mac-headers/blob/master/usr/include/sys/fcntl.h#L256

 Given FcntlCommandFlags does not expose F_NOCACHE but it still should
 be fine to jam the value into the enum

 Has anyone set this before? Chances of finding this on google are
 slightly better than 0 :)

 Cheers,

 Greg
 --
 Studying for the Turing test
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list





-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Unix.Native

2015-01-12 Thread Greg Young
Are there any instructions on building/testing the area (linux)?

I don't mind jumping in it a bit

On Tue, Jan 13, 2015 at 6:28 AM, Miguel de Icaza mig...@xamarin.com wrote:
 Hey,

 Good observation, so passing a -1 is enough.

 That said, perhaps we do need to expose a number of overloads with various
 possible data types of other sizes.

 On Mon, Jan 12, 2015 at 11:23 PM, Greg Young gregoryyou...@gmail.com
 wrote:

 I would guess it to be the same for others like F_RDAHEAD

 I don't think the long is too horrible as its only defined as 0/non-zero

 On Tue, Jan 13, 2015 at 6:15 AM, Miguel de Icaza mig...@xamarin.com
 wrote:
  I added support for this on master.
 
  That said, there is an issue that I think will bite us.
 
  Currently the fcntl P/Invoke declaration uses a long as a general
  purpose
  way of passing flags to fcntl, and I suspect the parameter to F_NOCACHE
  should be an int.
 
  Thoughts?
 
  Miguel
 
  On Mon, Jan 12, 2015 at 7:28 PM, Greg Young gregoryyou...@gmail.com
  wrote:
 
  I have been trying to set F_NOCACHE via fcntl on a mac to no avail.
 
   r = Syscall.fcntl
  (handle.DangerousGetHandle().ToInt32(), (FcntlCommand) MAC_F_NOCACHE,
  1);
   } while (UnixMarshal.ShouldRetrySyscall ((int) r));
   if (r == -1)
   UnixMarshal.ThrowExceptionForLastError ();
 
  (EINVAL)
 
  I have tried
  48
  0x400
  and 0x4
  for F_NOCACHE though from
 
 
  https://github.com/realthunder/mac-headers/blob/master/usr/include/sys/fcntl.h#L256
 
  Given FcntlCommandFlags does not expose F_NOCACHE but it still should
  be fine to jam the value into the enum
 
  Has anyone set this before? Chances of finding this on google are
  slightly better than 0 :)
 
  Cheers,
 
  Greg
  --
  Studying for the Turing test
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
  http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 



 --
 Studying for the Turing test





-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] CodeContacts open sourced

2015-01-11 Thread Greg Young
On Sunday, January 11, 2015, Michael Hutchinson mhu...@xamarin.com wrote:

 On 9 January 2015 at 16:32, Greg Young gregoryyou...@gmail.com
 javascript:; wrote:
  It's not source analysis it theorem proving think formal proving a la
 eiffel

 The Code Contracts tools analyze (and rewrite) compiled code, but
 there's no reason why equivalent source analysis tools couldn't use a
 theorem prover.


This is true it can work on any ast as of now it works on il. Previously it
worked wih output from spec# and was called boogie.


  It's a massive!!!  task (like 5-10 man years) to bring it in as you need
 to
  put contracts on all of the mono code
 
  This is part of why it has not done well for Microsoft is much of the
  framework lacks co tracts which makes the theorem prover very difficult
 to
  use (needs tons of assume clauses)

 The repo includes the contract annotations for the BCL, and we have
 the reference source for much of the BCL too.


Many of these are auto generated not manually written. They wrote a tool in
msr to try to extract them. This also brings up an interesting question if
mono intends to match every contract. It is also a higher level of coupling.

If I even use just a few libraries without contracts the contract prover is
very annoying to use think about a call stack

Call: check preconditions- post conditions - returns v1
Call: no contracts param v1 returns v2 -
Call param v2 (how do you check preconditions?)

This gets worse when mutations are involved.

A big part of the reason the contracts library has not taken off is that
huge portions of library code in the space doesn't have contracts
associated with them. Also given the massive amounts of mutations that are
happening good contracts are often hard to write. A good example of this
would be stream.position post conditions after operations on a stream. Why
it's a particularly nasty example is that much of the contract is relying
on lower level code and assumes.

Don't get me wrong I love the idea of contracts. I am just pointing out
that it's a massive amount of work to get contracts on vast portions of
monos code base. If it's not pervasive then no one will use the contract
proving as its really annoying.

Cheers,

Greg



 - m



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono.Unix.Native

2015-01-11 Thread Greg Young
Oops read is failing as well.

Aside from having aligned buffer sizes do I need to do something like memalign?

Cheers,

Greg

On Mon, Jan 12, 2015 at 3:55 AM, Greg Young gregoryyou...@gmail.com wrote:
 I have been trying to use Syscalls a bit but am getting an exception I
 can't figure out why.

 Opening code throws no exceptions:
 var flags = OpenFlags.O_RDWR | OpenFlags.O_DIRECT |
 OpenFlags.O_CREAT;
 //var f = NativeConvert.FromOpenFlags(flags); not needed?
 var han = Syscall.open(path, flags, FilePermissions.S_IRWXU);
 if(han  0)
 throw new Win32Exception();

 var handle = new SafeFileHandle((IntPtr) han, true);
 if(handle.IsInvalid) throw new Exception(Invalid handle);
 return handle;

 Then I call write:

 fixed (byte* b = buffer)
 {
 long ret = 0;
  do {
 ret = Syscall.write
 (handle.DangerousGetHandle().ToInt32(), b ,count);
 } while (Mono.Unix.UnixMarshal.ShouldRetrySyscall ((int) 
 ret));
 if(ret == -1)
 Mono.Unix.UnixMarshal.ThrowExceptionForLastErrorIf
 ((int) ret);
 }

 I get an invalid parameter exception. Read seems to work following a
 similar pattern so not quite sure whats wrong.

 My writes are of size 4096. Perhaps the issue is needing to call
 memalign? I would expect reads to fail as well then though

 Cheers,

 Greg


 13) Test Error :
 EventStore.Core.Tests.TransactionLog.Unbuffered.UnbufferedTests.when_writing_then_seeking_exact_to_alignment_and_writing_again
System.ArgumentException : Invalid argument
    Mono.Unix.UnixIOException : Invalid argument [EINVAL].
   at Mono.Unix.UnixMarshal.ThrowExceptionForLastError () [0x0] in
 filename unknown:0
   at Mono.Unix.UnixMarshal.ThrowExceptionForLastErrorIf (Int32 retval)
 [0x0] in filename unknown:0
   at EventStore.Core.TransactionLog.Unbuffered.NativeFile.Write
 (Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Byte[]
 buffer, UInt32 count, System.Int32 written) [0x0] in filename
 unknown:0
   at 
 EventStore.Core.TransactionLog.Unbuffered.UnbufferedIOFileStream.InternalWrite
 (System.Byte[] buffer, UInt32 count) [0x0] in filename unknown:0
   at EventStore.Core.TransactionLog.Unbuffered.UnbufferedIOFileStream.Flush
 () [0x0] in filename unknown:0
   at EventStore.Core.TransactionLog.Unbuffered.UnbufferedIOFileStream.Dispose
 (Boolean disposing) [0x0] in filename unknown:0
   at System.IO.Stream.Close () [0x0] in filename unknown:0
   at System.IO.Stream.Dispose () [0x0] in filename unknown:0
   at 
 EventStore.Core.Tests.TransactionLog.Unbuffered.UnbufferedTests.when_writing_then_seeking_exact_to_alignment_and_writing_again
 () [0x0] in filename unknown:0
   at (wrapper managed-to-native)
 System.Reflection.MonoMethod:InternalInvoke
 (System.Reflection.MonoMethod,object,object[],System.Exception)
   at System.Reflection.MonoMethod.Invoke (System.Object obj,
 BindingFlags invokeAttr, System.Reflection.Binder binder,
 System.Object[] parameters, System.Globalization.CultureInfo culture)
 [0x0] in filename unknown:0
 --UnixIOException



 --
 Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono.Unix.Native

2015-01-11 Thread Greg Young
To answer my own question in case anyone runs into this.

Try this:

private byte* Align(IntPtr buf, uint alignTo)
{
//The buffer must originally be at least one alignment bigger!
var diff = alignTo - (buf.ToInt64() % alignTo);
var aligned = (IntPtr)(buf.ToInt64() + diff);
return (byte*) aligned;
}

On Mon, Jan 12, 2015 at 4:19 AM, Greg Young gregoryyou...@gmail.com wrote:
 Oops read is failing as well.

 Aside from having aligned buffer sizes do I need to do something like 
 memalign?

 Cheers,

 Greg

 On Mon, Jan 12, 2015 at 3:55 AM, Greg Young gregoryyou...@gmail.com wrote:
 I have been trying to use Syscalls a bit but am getting an exception I
 can't figure out why.

 Opening code throws no exceptions:
 var flags = OpenFlags.O_RDWR | OpenFlags.O_DIRECT |
 OpenFlags.O_CREAT;
 //var f = NativeConvert.FromOpenFlags(flags); not needed?
 var han = Syscall.open(path, flags, FilePermissions.S_IRWXU);
 if(han  0)
 throw new Win32Exception();

 var handle = new SafeFileHandle((IntPtr) han, true);
 if(handle.IsInvalid) throw new Exception(Invalid handle);
 return handle;

 Then I call write:

 fixed (byte* b = buffer)
 {
 long ret = 0;
  do {
 ret = Syscall.write
 (handle.DangerousGetHandle().ToInt32(), b ,count);
 } while (Mono.Unix.UnixMarshal.ShouldRetrySyscall ((int) 
 ret));
 if(ret == -1)
 Mono.Unix.UnixMarshal.ThrowExceptionForLastErrorIf
 ((int) ret);
 }

 I get an invalid parameter exception. Read seems to work following a
 similar pattern so not quite sure whats wrong.

 My writes are of size 4096. Perhaps the issue is needing to call
 memalign? I would expect reads to fail as well then though

 Cheers,

 Greg


 13) Test Error :
 EventStore.Core.Tests.TransactionLog.Unbuffered.UnbufferedTests.when_writing_then_seeking_exact_to_alignment_and_writing_again
System.ArgumentException : Invalid argument
    Mono.Unix.UnixIOException : Invalid argument [EINVAL].
   at Mono.Unix.UnixMarshal.ThrowExceptionForLastError () [0x0] in
 filename unknown:0
   at Mono.Unix.UnixMarshal.ThrowExceptionForLastErrorIf (Int32 retval)
 [0x0] in filename unknown:0
   at EventStore.Core.TransactionLog.Unbuffered.NativeFile.Write
 (Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Byte[]
 buffer, UInt32 count, System.Int32 written) [0x0] in filename
 unknown:0
   at 
 EventStore.Core.TransactionLog.Unbuffered.UnbufferedIOFileStream.InternalWrite
 (System.Byte[] buffer, UInt32 count) [0x0] in filename unknown:0
   at EventStore.Core.TransactionLog.Unbuffered.UnbufferedIOFileStream.Flush
 () [0x0] in filename unknown:0
   at EventStore.Core.TransactionLog.Unbuffered.UnbufferedIOFileStream.Dispose
 (Boolean disposing) [0x0] in filename unknown:0
   at System.IO.Stream.Close () [0x0] in filename unknown:0
   at System.IO.Stream.Dispose () [0x0] in filename unknown:0
   at 
 EventStore.Core.Tests.TransactionLog.Unbuffered.UnbufferedTests.when_writing_then_seeking_exact_to_alignment_and_writing_again
 () [0x0] in filename unknown:0
   at (wrapper managed-to-native)
 System.Reflection.MonoMethod:InternalInvoke
 (System.Reflection.MonoMethod,object,object[],System.Exception)
   at System.Reflection.MonoMethod.Invoke (System.Object obj,
 BindingFlags invokeAttr, System.Reflection.Binder binder,
 System.Object[] parameters, System.Globalization.CultureInfo culture)
 [0x0] in filename unknown:0
 --UnixIOException



 --
 Studying for the Turing test



 --
 Studying for the Turing test



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Mono.Unix.Native

2015-01-11 Thread Greg Young
I have been trying to use Syscalls a bit but am getting an exception I
can't figure out why.

Opening code throws no exceptions:
var flags = OpenFlags.O_RDWR | OpenFlags.O_DIRECT |
OpenFlags.O_CREAT;
//var f = NativeConvert.FromOpenFlags(flags); not needed?
var han = Syscall.open(path, flags, FilePermissions.S_IRWXU);
if(han  0)
throw new Win32Exception();

var handle = new SafeFileHandle((IntPtr) han, true);
if(handle.IsInvalid) throw new Exception(Invalid handle);
return handle;

Then I call write:

fixed (byte* b = buffer)
{
long ret = 0;
 do {
ret = Syscall.write
(handle.DangerousGetHandle().ToInt32(), b ,count);
} while (Mono.Unix.UnixMarshal.ShouldRetrySyscall ((int) ret));
if(ret == -1)
Mono.Unix.UnixMarshal.ThrowExceptionForLastErrorIf
((int) ret);
}

I get an invalid parameter exception. Read seems to work following a
similar pattern so not quite sure whats wrong.

My writes are of size 4096. Perhaps the issue is needing to call
memalign? I would expect reads to fail as well then though

Cheers,

Greg


13) Test Error :
EventStore.Core.Tests.TransactionLog.Unbuffered.UnbufferedTests.when_writing_then_seeking_exact_to_alignment_and_writing_again
   System.ArgumentException : Invalid argument
   Mono.Unix.UnixIOException : Invalid argument [EINVAL].
  at Mono.Unix.UnixMarshal.ThrowExceptionForLastError () [0x0] in
filename unknown:0
  at Mono.Unix.UnixMarshal.ThrowExceptionForLastErrorIf (Int32 retval)
[0x0] in filename unknown:0
  at EventStore.Core.TransactionLog.Unbuffered.NativeFile.Write
(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Byte[]
buffer, UInt32 count, System.Int32 written) [0x0] in filename
unknown:0
  at 
EventStore.Core.TransactionLog.Unbuffered.UnbufferedIOFileStream.InternalWrite
(System.Byte[] buffer, UInt32 count) [0x0] in filename unknown:0
  at EventStore.Core.TransactionLog.Unbuffered.UnbufferedIOFileStream.Flush
() [0x0] in filename unknown:0
  at EventStore.Core.TransactionLog.Unbuffered.UnbufferedIOFileStream.Dispose
(Boolean disposing) [0x0] in filename unknown:0
  at System.IO.Stream.Close () [0x0] in filename unknown:0
  at System.IO.Stream.Dispose () [0x0] in filename unknown:0
  at 
EventStore.Core.Tests.TransactionLog.Unbuffered.UnbufferedTests.when_writing_then_seeking_exact_to_alignment_and_writing_again
() [0x0] in filename unknown:0
  at (wrapper managed-to-native)
System.Reflection.MonoMethod:InternalInvoke
(System.Reflection.MonoMethod,object,object[],System.Exception)
  at System.Reflection.MonoMethod.Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
[0x0] in filename unknown:0
--UnixIOException



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] CodeContacts open sourced

2015-01-09 Thread Greg Young
See below.

On Friday, January 9, 2015, Miguel de Icaza mig...@xamarin.com wrote:


 Regarding XS/MD support for the code contracts tools, there are really
 two pieces.

 The first is to port/reimplement the VS addin. It doesn't look
 particularly complex, a proof of concept might only take a couple of
 days.


 This would be glorious.   They seem to be doing some kind of
 source-analysis like support, where they show potential problems.



It's not source analysis it theorem proving think formal proving a la eiffel

It's a massive!!!  task (like 5-10 man years) to bring it in as you need to
put contracts on all of the mono code

This is part of why it has not done well for Microsoft is much of the
framework lacks co tracts which makes the theorem prover very difficult to
use (needs tons of assume clauses)

Greg




 The second is figuring out how to build and ship the analysis tools,
 contract annotations and MSBuild tasks. AFAIK On Windows they're
 shipped in a MSI installer, but there are scripts to build a NuGet
 package too, though it doesn't seem to be on the public NuGet server.


 I think we could ship this with Mono itself (once we figure out how to
 build it).

 I tried to build it, but failed.Then again, I tried to build on
 Windows, and failed too :-)

 miguel



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono.Posix Cross Compiling

2015-01-07 Thread Greg Young
Sorry the question was already answered above but let me restate the issue.

The issue is compiling between ms build and xbuild as the mono.posix
reference should only be there in Unix (windows uses win api calls)

Above is a good solution (conditional reference) which works. I know we
could manually add a binary reference to mono.posix.dll and then not use it
but that just feels wrong. The conditional reference is exactly what we
were looking for and works like a charm now!

The alternative we were looking at was copy/pasting syscalls.cs which is
also ugly :)

Greg

On Wednesday, January 7, 2015, Jonathan Pryor jonpr...@vt.edu wrote:

 On Jan 5, 2015, at 6:08 PM, Greg Young gregoryyou...@gmail.com
 javascript:; wrote:
  Have anyone used mono.posix or mono.unix.native in a cross compiling
 scenario where you have to support visual studio builds? How did you handle
 this? I don't seem to be able to do a platform specific reference.

 What's the problem? Mono.Posix.dll is MIT/X11; simply bundle the assembly
 with your code, along with MonoPosixHelper.dll (just copy from the Mono
 install).

 Furthermore, Mono.Unix.Native.Stdlib should work as-is on Windows (it uses
 MSVCRT.dll).

 You will need to be careful not to actually use Syscall/etc. on Windows,
 but due to the lazy nature of the JIT this should be reasonably
 straightforward:

 if (running on Unix)
 MethodWhichUsesSyscall ();
 ...

 MethodWhichUsesSyscall() won't be JIT'd unless executed, so any references
 to e.g. Syscall will be lazily evaluated, allowing things to work on
 Windows.

  - Jon



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono.Posix Cross Compiling

2015-01-06 Thread Greg Young
 The reference appears with a warning in Visual Studio and you get a
compiler warning, “The referenced component ‘Mono.Posix’ could not be
found” but this is to be expected on Windows/.NET.

hmm we use warnings as errors will need to try this

On Tue, Jan 6, 2015 at 4:54 PM, David Curylo cury...@asme.org wrote:
 You have to use conditional compilation for the code that uses the 
 conditional reference, in this case Mono.Posix.  The reference appears with a 
 warning in Visual Studio and you get a compiler warning, “The referenced 
 component ‘Mono.Posix’ could not be found” but this is to be expected on 
 Windows/.NET.  This may be an annoyance, but it allows developers to be 
 productive developers on either platform, so I consider this to be a 
 functional solution.

 I created an example here on github: 
 https://github.com/ninjarobot/MonoConditionalReference

 This builds fine on Xamarin Studio on OS X and Visual Studio on Windows, 
 although given the conditional compilation, the resulting assembly is 
 different.  We take this approach in my organization so that some developers 
 can work on Windows with Visual Studio and other developers work entirely on 
 mono (our target platform).

 On Jan 6, 2015, at 8:39 AM, Edward Ned Harvey (mono) 
 edward.harvey.m...@clevertrove.com wrote:

 From: mono-devel-list-boun...@lists.ximian.com [mailto:mono-devel-list-
 boun...@lists.ximian.com] On Behalf Of David Curylo

 If you edit the .csproj file, you can have a platform-specific reference
 Mono.Posix like this:

 Reference Include=Mono.Posix Condition= '$(OS)' != 'Windows_NT'  /

 I've never gotten this to work before.  Moments ago, I pasted the above into 
 a test project, just to see if the above would work - and it didn't.  The 
 reference is still present, and still broken, if I open a project with the 
 above line in Visual Studio.  Fortunately as long as you don't use anything 
 from the missing assembly, the project still builds, so in some cases you 
 can ignore the broken reference by using [Conditional] and/or #if to wrap 
 around all the things that actually use something from that assembly...

 The workaround I've always settled on was to make multiple versions of the 
 .sln and .csproj files if I need different assemblies referenced on .Net and 
 mono.  (Which is usually the case, because of NUnit and Mono.Security, which 
 I use a lot.)  If you find a way to make the conditional reference 
 functional, please post.  I'd love to know.




-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Mono.Posix Cross Compiling

2015-01-05 Thread Greg Young
Have anyone used mono.posix or mono.unix.native in a cross compiling
scenario where you have to support visual studio builds? How did you
handle this? I don't seem to be able to do a platform specific
reference.

I am not using much out of it and it seems like just copy/pasting the
extern definitions to monoposixhelper might be the easiest way.

Any ideas?

Greg

-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono.Posix Cross Compiling

2015-01-05 Thread Greg Young
Ah nice I didn't know you could do that. Thanks! Saves me the trouble
of copying bunches of externs :)

Greg

On Tue, Jan 6, 2015 at 5:01 AM, David Curylo cury...@asme.org wrote:
 Greg,

 If you edit the .csproj file, you can have a platform-specific reference 
 Mono.Posix like this:

 Reference Include=Mono.Posix Condition= '$(OS)' != 'Windows_NT'  /

 On Windows with Visual Studio or msbuild, the reference will be ignored.  
 Building under mono with Xamarin Studio, Monodevelop, or xbuild, the 
 reference will be included.

 -Dave

 On Jan 5, 2015, at 6:08 PM, Greg Young gregoryyou...@gmail.com wrote:

 Have anyone used mono.posix or mono.unix.native in a cross compiling
 scenario where you have to support visual studio builds? How did you
 handle this? I don't seem to be able to do a platform specific
 reference.

 I am not using much out of it and it seems like just copy/pasting the
 extern definitions to monoposixhelper might be the easiest way.

 Any ideas?

 Greg

 --
 Studying for the Turing test
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list




-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Open source .Net, and TLS 1.1 1.2

2014-12-09 Thread Greg Young
I believe there already is one. If you look back to the (awful) mono
pull requests thread I believe it was mention specifically as an
example.

On Tue, Dec 9, 2014 at 11:09 PM, Miguel de Icaza mig...@xamarin.com wrote:
 Hello,

 We would love a test case to add to the test suite.

 We are building a new test suite as part of this work anyways.

 MIguel

 On Tue, Dec 9, 2014 at 3:21 PM, Edward Ned Harvey (mono)
 edward.harvey.m...@clevertrove.com wrote:

  From: Miguel de Icaza [mailto:mig...@xamarin.com]
 
  .NET's implementation of the TLS stack is built on top of native code,
  so it
  wont work on Mono.
 
  We have implemented TLS 1.1 and 1.2 on top of the not yet open sourced
  networking stack and will be publishing it as soon as Microsoft open
  sources
  the .NET networking stack.

 Great news, thank you!  A follow-up question:

 In the current released version of mono SslStream, if the server uses a
 cert that is signed by an intermediate chain, *and* a mono SslStream client
 connects, then the client rejects the cert.  The root cause is because the
 server does not send the intermediate chain to the client, and the client
 fails to construct the chain.  The behavior is specifically a mono-mono
 incompatibility - If either the server or the client is .Net, then the
 problem does not occur, because a windows server sends the chain to the
 client, and a windows client performs guerilla tactics to construct an
 incomplete chain.

 So the question is, how could it be possible to add a test for this
 behavior, presuming it will some day get fixed and then we don't want it to
 happen again?

 I can easily enough write example code to demonstrate the problem.  But
 then there's a question about what cert to use for demonstration purposes -
 it's probably best to create a junk CA with intermediate cert, and some junk
 server cert.  I could easily enough publish those certs somewhere and/or
 hard-code them into the demonstration code, with something like 30 year
 validity.



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




-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Crash course on bringing .NET open sourced code to Mono.

2014-11-15 Thread Greg Young
What's the plan on where there are differences in behavior? An example of
this would be uri matching. I would guess it makes sense to use the ms
stuff moving forward, how will changes in current behavior be communicated

On Saturday, November 15, 2014, Miguel de Icaza mig...@xamarin.com wrote:

 Hey guys,

 Sami reached out to me, and was wondering how to get started in bringing
 some code to Mono, in particular WCF to Mono.   So I wrote this small guide
 for newcomers.

 I would say it takes a couple of steps:

- Build your own local version of Mono on Linux.
- Make sure it works mcs should be able to run after installing it.
- Run a trivial self-hosted WCF server/client
- Make a trivial change to the WCF class library, and install this
version to test you can make changes locally and have them run:
   - cd mono/mcs/class/System.ServiceModel
   - Make changes
   - make install
   - Run your test again in another window
   - Repeat
- Make sure you can run the test suite:
   - cd mono/mcs/class/System.ServiceModel
   - make run-test-local

 Once you are ready, you can start importing code.   Ideally, you want to
 go for high-value targets: the most buggy parts of Mono's stack (you can
 check bugzilla for reports on memory usage, bugs).   Or you can pick a
 missing feature.

 To import code, modify the relevant .sources file in the
 System.ServiceModel directory (where you ran the test) and replace a local
 file, with a reference to the referencesource.

 Chances are, you will need to make changes to the referencesource code,
 since a lot of it is Windows specific.

 Miguel


 On Fri, Nov 14, 2014 at 5:25 PM, Sami Ben Grine 
 sben-gr...@axarosenberg.com
 javascript:_e(%7B%7D,'cvml','sben-gr...@axarosenberg.com'); wrote:

  Sweet – is there anything I can do to make progress?



 I am somewhat ignorant about Mono but I am pretty ok with .NET and Linux.



 thanks




-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] PR1375: cleanup

2014-10-28 Thread Greg Young
Can I buy a vowel?

On Tuesday, October 28, 2014, Miguel de Icaza mig...@xamarin.com wrote:



 ▉, ▉▉ . ▉▉▉ - ▉▉.   ▉▉, , ,
 ▉▉

 MIguel

 On Tue, Oct 28, 2014 at 1:57 PM, Alexander Köplinger 
 alex.koeplin...@outlook.com
 javascript:_e(%7B%7D,'cvml','alex.koeplin...@outlook.com'); wrote:
 
   Sounds good!
 
  Can you share what large patch you're working on or is that a secret
 new feature? :-)
 
  -- Alex
 
 
  
  From: mig...@xamarin.com
 javascript:_e(%7B%7D,'cvml','mig...@xamarin.com');
  Date: Tue, 28 Oct 2014 12:47:40 -0400
  Subject: Re: [Mono-dev] PR1375: cleanup
  To: champetier.etie...@gmail.com
 javascript:_e(%7B%7D,'cvml','champetier.etie...@gmail.com');;
 alex.koeplin...@outlook.com
 javascript:_e(%7B%7D,'cvml','alex.koeplin...@outlook.com');
  CC: mono-devel-list@lists.ximian.com
 javascript:_e(%7B%7D,'cvml','mono-devel-list@lists.ximian.com');
 
 
  Hey,
 
  I love this patch, and I also love the patch from Alexander to remove
 deprecated code.
 
  But we have a relatively large patch that changes a lot of files, and I
 am afraid that landing these changes now will make our currently forked
 tree a pain to merge.   We need about two more weeks to merge those
 patches, then we can proceed to remove this stuff.
 
  Miguel
 
  On Tue, Oct 28, 2014 at 10:45 AM, Etienne Champetier 
 champetier.etie...@gmail.com
 javascript:_e(%7B%7D,'cvml','champetier.etie...@gmail.com'); wrote:
 
  Hi
 
  while investigating a bug in System.Web, there was a lot of (now
 useless) TARGET_J2EE ifdef.
  This PR remove all TARGET_J2EE ifdef (using unifdef).
  I also remove all mainsoft stuff (it's not working anymore as i
 understand it).
  To finish the cleanup remove *.jvm* files and folders (TARGET_JVM was
 remove in PR1200)
 
  https://github.com/mono/mono/pull/1375
 
  Regards
  Etienne
 
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
 javascript:_e(%7B%7D,'cvml','Mono-devel-list@lists.ximian.com');
  http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 



-- 
Studying for the Turing test
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Heads up: Elimination of the 2.0 and 4.0 profiles

2014-10-24 Thread Greg Young
Is everything from 4.0 on the correct side currently there? I have seen
this cause confusion in the past for many thinking the version numbers
somehow match up :)

On Friday, October 24, 2014, Miguel de Icaza mig...@xamarin.com wrote:

 Ah, I see.

 Yeah, perhaps we will move to the 4.0 branding, just need to check with
 folks around here what they think.

 For distros: nobody in the Linux world really ever cared about this.

 We kept these profiles with the idea that this was something that actually
 mattered, and it turns out, it rarely did (in particular in Linux where
 things are built from scratch)

 On Fri, Oct 24, 2014 at 3:11 PM, Martin Thwaites monofo...@my2cents.co.uk
 javascript:_e(%7B%7D,'cvml','monofo...@my2cents.co.uk'); wrote:

 Hi Miguel,

 I'm referring to 3.9, 3.10.1, etc. i.e. the current version being
 3.10.1.  So I guess it should be considered the 3.x series.

 I'm meaning that we shouldn't preclude there being a 3.11, or 3.12, if
 there is a critical bug.

 Also, do you have an answer to the distro question?

 Thanks,
 Martin

 On 24 October 2014 19:13, Miguel de Icaza mig...@xamarin.com
 javascript:_e(%7B%7D,'cvml','mig...@xamarin.com'); wrote:

 Hello Martin,

 There is no such thing as a 3.x.x series.   It does not exist.   It
 never did.

 You must be confused.

 Miguel

 On Fri, Oct 24, 2014 at 12:34 PM, Martin Thwaites 
 monofo...@my2cents.co.uk
 javascript:_e(%7B%7D,'cvml','monofo...@my2cents.co.uk'); wrote:

 Hi Miguel,

 I think my preference would be to have the 3.x.x series continue (as
 security fix only) with all the profiles, and essentially have it be a
 legacy branch.  Then have the 4.x.x series by a .NET 4.5+ only code base.
 I think it should continue if people are willing to support it, but the
 contributors who don't want to have to support it (or don't have the time
 to implement hacks for it) don't have to.

 From a communication perspective it would be easier to get across
 saying that From mono 4.0 onwards, we only support the 4.5 profile rather
 than 3.11.x onwards as it's not as easy to remember which 3.x number it was
 when it stopped.  A decision and a change like that does really feel
 major and therefore warrant the change.

 The other question I have is around the linux distros that ship mono as
 standard (I think Ubuntu does).  Do you perceive this having an affect on
 them, i.e. they will never ship 4.0 as it doesn't cater for .NET 2.0
 applications and there are some core pieces that rely on it?

 Thanks,
 Martin

 On 22 October 2014 22:18, Miguel de Icaza mig...@xamarin.com
 javascript:_e(%7B%7D,'cvml','mig...@xamarin.com'); wrote:

 Hey,

 Mhm, that is a good idea.   Will think about it.

 Right now we were just planning on calling the next one Mono 3.12.
 But perhaps the time has come for a nice bump!

 Miguel

 On Wed, Oct 22, 2014 at 4:21 PM, Martin Thwaites 
 monofo...@my2cents.co.uk
 javascript:_e(%7B%7D,'cvml','monofo...@my2cents.co.uk'); wrote:

 Hi Miguel,

 Would you be looking at calling this Mono 4.0? Not that it makes any
 difference really, it just seems there's been a lot of improvements in
 recently, and an announcement of a new version me give some renewed
 interest.

 Thanks,
 Martin

 On 22 October 2014 21:10, Miguel de Icaza mig...@xamarin.com
 javascript:_e(%7B%7D,'cvml','mig...@xamarin.com'); wrote:

 Hey Alex,

 It is very repetitive work, so what I wanted to do was to write a
 perl script to remove the *obvious* ifdefs.   The tool would remove only
 those that match the following criteria (more or less):

- Remove toplevel #if NET_2_0 with the final #endif
- Only remove those that contain those preprocessor directives

 And then have a human do the more fine-tuned approach.  There
 are a couple more defines that I remember could be automated, but I 
 would
 love to have this in the form of a script.

 I am afraid of applying a patch like that blindly, because there are
 no exact guarantees of what happened without reviewing the whole file.  
 So
 a script with the invariants would take a lot of my nervousness out.

 Also, when I did it once, I had a setup where I rebuilt the
 assemblies and compared the output.  This would ensure that removal of
 ifdefs did not change the resulting binaries.

 On Wed, Oct 22, 2014 at 4:04 PM, akoeplinger 
 alex.koeplin...@outlook.com
 javascript:_e(%7B%7D,'cvml','alex.koeplin...@outlook.com');
 wrote:

 Sounds like a good thing ;-)

 I've got a branch in my fork where I removed the NET_2_0 ifdefs:
 https://github.com/akoeplinger/mono/compare/remove-net20-ifdefs,
 @kumpera
 told me a while ago that removing the 2.0 profile is on the horizon
 when I
 asked about why the ifdefs are still there.

 I refrained from making a PR so far because it is quite huge, do
 you think
 now would be a good time?

 -- Alex



 --
 View this message in context:
 http://mono.1490590.n4.nabble.com/Heads-up-Elimination-of-the-2-0-and-4-0-profiles-tp4664323p4664325.html
 Sent from the Mono - Dev mailing 

  1   2   3   >