Re: possible problem with memory allocation using calloc/mmap/munmap

2019-06-07 Thread Corinna Vinschen
On Jun 6 15:13, Stanislav Kascak wrote: > > > [...] > > > I played around a bit and I can confirm it would be consistent with > > > current behavior: > > > memwrite <0 - filesize) - no error, written to file > > > memwrite > > memwrite <4k, 64k) - SIGSEGV > > > memwrite <64k, mmap alloc size) - S

Re: possible problem with memory allocation using calloc/mmap/munmap

2019-06-06 Thread Stanislav Kascak
> > > > > > > > It seems that when mmap() is called with length argument > > > > > > > > exceeding > > > > > > > > size of file, only memory to fit that file is allocated. > > > > > > > > munmap() > > > > > > > > however frees the full specified length. [...] > > > > > > > [...] > > > > > > > I k

Re: possible problem with memory allocation using calloc/mmap/munmap

2019-06-05 Thread Corinna Vinschen
On Jun 4 18:01, Stanislav Kascak wrote: > > > > > > > It seems that when mmap() is called with length argument exceeding > > > > > > > size of file, only memory to fit that file is allocated. munmap() > > > > > > > however frees the full specified length. [...] > > > > > > [...] > > > > > > I know

Re: possible problem with memory allocation using calloc/mmap/munmap

2019-06-04 Thread Stanislav Kascak
> > > > > > It seems that when mmap() is called with length argument exceeding > > > > > > size of file, only memory to fit that file is allocated. munmap() > > > > > > however frees the full specified length. [...] > > > > > [...] > > > > > I know this situation is unsatisfying, but I have no easy

Re: possible problem with memory allocation using calloc/mmap/munmap

2019-06-04 Thread Corinna Vinschen
On Jun 4 15:48, Stanislav Kascak wrote: > > > > > It seems that when mmap() is called with length argument exceeding > > > > > size of file, only memory to fit that file is allocated. munmap() > > > > > however frees the full specified length. [...] > > > > [...] > > > > I know this situation is u

Re: possible problem with memory allocation using calloc/mmap/munmap

2019-06-04 Thread Stanislav Kascak
> > > > It seems that when mmap() is called with length argument exceeding > > > > size of file, only memory to fit that file is allocated. munmap() > > > > however frees the full specified length. Since (at least on my > > > > computer) big chunk of memory allocated by calloc() is located after >

Re: possible problem with memory allocation using calloc/mmap/munmap

2019-06-04 Thread Corinna Vinschen
On Jun 4 11:38, Stanislav Kascak wrote: > > > It seems that when mmap() is called with length argument exceeding > > > size of file, only memory to fit that file is allocated. munmap() > > > however frees the full specified length. Since (at least on my > > > computer) big chunk of memory allocate

Re: possible problem with memory allocation using calloc/mmap/munmap

2019-06-04 Thread Stanislav Kascak
> > It seems that when mmap() is called with length argument exceeding > > size of file, only memory to fit that file is allocated. munmap() > > however frees the full specified length. Since (at least on my > > computer) big chunk of memory allocated by calloc() is located after > > mmap() allocat

Re: possible problem with memory allocation using calloc/mmap/munmap

2019-06-03 Thread Corinna Vinschen
On May 3 13:33, Stanislav Kascak wrote: > Hello cygwin team, > > I came across a problem with memory allocation/deallocation when > trying to compile and run tests of openldap under cygwin. > > I created a test program to simulate sequence of actions. First a > bigger chunk of memory (>~262kB) i

Re: possible problem with memory allocation using calloc/mmap/munmap

2019-05-20 Thread Ken Brown
On 5/3/2019 7:33 AM, Stanislav Kascak wrote: > I came across a problem with memory allocation/deallocation when > trying to compile and run tests of openldap under cygwin. Corinna can give you a definitive response when she returns from vacation, but I looked at the code and have a few comments.

possible problem with memory allocation using calloc/mmap/munmap

2019-05-03 Thread Stanislav Kascak
Hello cygwin team, I came across a problem with memory allocation/deallocation when trying to compile and run tests of openldap under cygwin. I created a test program to simulate sequence of actions. First a bigger chunk of memory (>~262kB) is allocated using calloc(), then mmap() is called with