[Mono-dev] Problem handling more the 1024 file handle

2011-11-04 Thread Torello Querci
Hi al, trying to handle more that 1024 handle file I got an exception even if I increase the max number of file limit using setrlimit. The example source code below. Of course mono have the right pcap permission. Using strace on both this code and no setrlimit version code I have some

Re: [Mono-dev] Problem handling more the 1024 file handle

2011-11-04 Thread Alan
Hi, Mono itself has no trouble opening 1000's of files. Would you be able to create an equivalent C program and see if that works as expected? My guess would be that the equivalent C program will fail in the same way. If it does not, then it's likely to be a mono bug. Alan On 4 November 2011

Re: [Mono-dev] Problem handling more the 1024 file handle

2011-11-04 Thread Torello Querci
This is the first test that I realized. On the same machine, same kernel same calls Below the source code: = #include linux/resource.h //#include stdlib.h #include stdio.h int main(int argc, char* argv[]) {

Re: [Mono-dev] Problem handling more the 1024 file handle

2011-11-04 Thread Robert Jordan
On 04.11.2011 10:17, Torello Querci wrote: This is the first test that I realized. On the same machine, same kernel same calls You don't say which Mono arch you're using. On 32 bit, the following might not be correct: struct rlimit { public IntPtr rlimit_cur;

Re: [Mono-dev] Problem handling more the 1024 file handle

2011-11-04 Thread Torello Querci
Sorry, You are right I'm on 32bit arch 2011/11/4 Robert Jordan robe...@gmx.net: On 04.11.2011 10:17, Torello Querci wrote: This is the first test that I realized. On the same machine, same kernel same calls You don't say which Mono arch you're using. On 32 bit, the following

Re: [Mono-dev] Problem handling more the 1024 file handle

2011-11-04 Thread Torello Querci
Looking in the strace output file this is the setrlimit call: setrlimit(RLIMIT_NOFILE, {rlim_cur=2, rlim_max=2}) = 0 so seems to be correct 2011/11/4 Torello Querci tque...@gmail.com: Sorry, You are right I'm on 32bit arch 2011/11/4 Robert Jordan robe...@gmx.net: On

Re: [Mono-dev] Problem handling more the 1024 file handle

2011-11-04 Thread Robert Jordan
On 04.11.2011 10:49, Torello Querci wrote: Sorry, You are right I'm on 32bit arch Then you need this: struct rlimit { public long rlimit_cur; public long rlimit_max; } Robert ___

Re: [Mono-dev] Problem handling more the 1024 file handle

2011-11-04 Thread Robert Jordan
On 04.11.2011 11:18, Torello Querci wrote: Hy Robert, On 32bit arch IntPtr is 32bit, on 64 bit arch, IntPrt is 64 bit. Yes, this is not the issue here. However I try your suggestion but the setrlimit no more work. Looking inside the strace output this is the setrlimit syscall:

Re: [Mono-dev] Problem handling more the 1024 file handle

2011-11-04 Thread Robert Jordan
On 04.11.2011 08:19, Torello Querci wrote: Hi al, trying to handle more that 1024 handle file I got an exception even if I increase the max number of file limit using setrlimit. The example source code below. Of course mono have the right pcap permission. This is a bug in Mono's io-layer:

Re: [Mono-dev] Problem handling more the 1024 file handle

2011-11-04 Thread Robert Jordan
On 04.11.2011 13:26, Robert Jordan wrote: Meanwhile, you could just increase the open files limit with ulimit -S -H 2, so don't mark the bug as super critical ;) I've fat-fingered ulimit's arguments: ulimit -S -H -n 2 Robert ___

Re: [Mono-dev] Problem handling more the 1024 file handle

2011-11-04 Thread Torello Querci
Bug filled: http://bugzilla.xamarin.com/show_bug.cgi?id=1888 Sorry for the delay. 2011/11/4 Robert Jordan robe...@gmx.net: On 04.11.2011 13:26, Robert Jordan wrote: Meanwhile, you could just increase the open files limit with ulimit -S -H 2, so don't mark the bug as super critical ;)