Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Sys-Mmap CPAN distribution.

Report information
The Basics
Id: 96043
Status: resolved
Priority: 0/
Queue: Sys-Mmap

People
Owner: SWALTERS [...] cpan.org
Requestors: lindahl [...] pbm.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.16
Fixed in: 0.17_01



Subject: bugs with perl-5.20.0
Date: Wed, 28 May 2014 14:37:27 -0700
To: bug-Sys-Mmap [...] rt.cpan.org
From: Greg Lindahl <lindahl [...] pbm.com>
sys-mmap 0.16 is getting a bit old, here are patches for copy on write and adding the MAP_LOCKED flag. 1) Fix bug with COW --- Mmap.xs~ 2014-05-28 14:28:56.000000000 -0700 +++ Mmap.xs 2014-05-28 14:32:01.000000000 -0700 @@ -208,6 +214,12 @@ croak("mmap: mmap call failed: errno: %d errmsg: %s ", errno, strerror(errno)); } +#if PERL_VERSION >= 20 + if (SvIsCOW(var)) { + sv_force_normal_flags(var, 0); + } +#endif + SvUPGRADE(var, SVt_PV); if (!(prot & PROT_WRITE)) SvREADONLY_on(var); 2) Add MAP_LOCKED --- Mmap.pm~ 2014-05-28 14:25:33.000000000 -0700 +++ Mmap.pm 2014-05-28 14:32:21.000000000 -0700 @@ -185,7 +185,7 @@ @ISA = qw(Exporter); @EXPORT = qw(mmap munmap - MAP_ANON MAP_ANONYMOUS MAP_FILE MAP_PRIVATE MAP_SHARED + MAP_ANON MAP_ANONYMOUS MAP_FILE MAP_LOCKED MAP_PRIVATE MAP_SHARED PROT_EXEC PROT_NONE PROT_READ PROT_WRITE); [lindahl@greg-desk ~]$ diff -u Mmap.xs~ Mmap.xs --- Mmap.xs~ 2014-05-28 14:28:56.000000000 -0700 +++ Mmap.xs 2014-05-28 14:32:01.000000000 -0700 @@ -76,6 +76,12 @@ #else goto not_there; #endif + if (strEQ(name, "MAP_LOCKED")) +#ifdef MAP_LOCKED + return MAP_LOCKED; +#else + goto not_there; +#endif break; case 'P': if (strEQ(name, "PROT_EXEC"))
Hi Greg, Thank you very much taking time to work on this code. I'm sorry that I don't monitor here and it took me this long to notice this. Let me coordinate with Todd Rinaldo who has been working on Sys::Mmap and doing releases to get this pushed to CPAN and maybe point the module at another issue tracker. I've merged these changes into https://github.com/scrottie/Sys-Mmap. Thanks again!
On Wed May 28 17:37:37 2014, lindahl@pbm.com wrote: Show quoted text
> sys-mmap 0.16 is getting a bit old, here are patches for copy on write > and adding the MAP_LOCKED flag. > > 1) Fix bug with COW > > --- Mmap.xs~ 2014-05-28 14:28:56.000000000 -0700 > +++ Mmap.xs 2014-05-28 14:32:01.000000000 -0700 > @@ -208,6 +214,12 @@ > croak("mmap: mmap call failed: errno: %d errmsg: %s ", > errno, strerror(errno)); > } > > +#if PERL_VERSION >= 20 > + if (SvIsCOW(var)) { > + sv_force_normal_flags(var, 0); > + } > +#endif > + > SvUPGRADE(var, SVt_PV); > if (!(prot & PROT_WRITE)) > SvREADONLY_on(var); > >
Patched - https://github.com/toddr/Sys-Mmap/commit/8dd0d54348ec2ccee77bd4ad243ea87e744b8b09 Show quoted text
> 2) Add MAP_LOCKED > > --- Mmap.pm~ 2014-05-28 14:25:33.000000000 -0700 > +++ Mmap.pm 2014-05-28 14:32:21.000000000 -0700 > @@ -185,7 +185,7 @@ > @ISA = qw(Exporter); > > @EXPORT = qw(mmap munmap > - MAP_ANON MAP_ANONYMOUS MAP_FILE MAP_PRIVATE MAP_SHARED > + MAP_ANON MAP_ANONYMOUS MAP_FILE MAP_LOCKED MAP_PRIVATE > MAP_SHARED > PROT_EXEC PROT_NONE PROT_READ PROT_WRITE); > >
Patched - https://github.com/toddr/Sys-Mmap/commit/aa01d7357018a0e18333d1cd41e4cb871d79accd Show quoted text
> [lindahl@greg-desk ~]$ diff -u Mmap.xs~ Mmap.xs > --- Mmap.xs~ 2014-05-28 14:28:56.000000000 -0700 > +++ Mmap.xs 2014-05-28 14:32:01.000000000 -0700 > @@ -76,6 +76,12 @@ > #else > goto not_there; > #endif > + if (strEQ(name, "MAP_LOCKED")) > +#ifdef MAP_LOCKED > + return MAP_LOCKED; > +#else > + goto not_there; > +#endif > break; > case 'P': > if (strEQ(name, "PROT_EXEC"))
Patched - https://github.com/toddr/Sys-Mmap/commit/f37cd24de9c552126f00f852ef8a68bf1684db84