Subject: | SvTYPE is not always SVt_PV |
I'm using this package on Ubuntu-13.10
uname -a
Linux ling 3.11.0-14-generic #21-Ubuntu SMP Tue Nov 12 17:04:55 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
0.16
This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-gnu-thread-multi
(with 80 registered patches, see perl -V for more detail)
I am using zoneminder-1.26.5. A modified version to track to mmap bug, just adding
Info logging statements.
When munmap is called, this section of code is hit:
if(SvTYPE(var) != SVt_PV) {
croak("variable is not a string");
return;
}
by adding additional information to the croak statement, I determined that var is type 7,
SVt_PVMG.
This causes munmap failure.
I modified the code, see attached patch file svtype-fix, which seems to fix the problem. I think that we want to allow everything between SVt_PVMG and SVt_PV to be accepted as unmap.
Here is output from the modified croak call,
variable is not a string: 7 at /usr/share/perl5/ZoneMinder/Memory/Mapped.pm line 115.
croak("variable is not a string, type is: %d", SvTYPE(var));
Subject: | svtype-fix |
Message body not shown because it is not plain text.