This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help needed with libsigsegv2.10-2 + cygwin 2.4.1-1 + win7


On 18/03/2016 20:36, ari kumpumÃki wrote:
Hi all

Why the following test code works fluently in Linux and cygwin 1.5.
But with cygwin 2.4.1 it gives a segmentation fault, when running "x =
mem[filePageSize];"



   return (char *) mmap(0, ALIGN_TO_PAGE_SIZE(size), PROT_NONE,
MAP_SHARED | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0);

why a file descriptor = -1 ?
http://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html

Please note also that unsigned is not always same size of address
(eg 64 bit)

size_t works better for that.

In any case you should check the function result.

Regards
Marco

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]