Code: Select all
This bug appears to be caused by the periodic reloading of Monitors by zmtrigger and the fact it calls "zmMemInvalidate" before that happens.
sub zmMemDetach( $ )
{
my $monitor = shift;
if(!defined($monitor)) {
print localtime()." Monitor not defined\n";
return;
}
if(!defined($$monitor{MMAP})) {
print localtime()." Monitor MMAP not defined with monitor $monitor\n";
print localtime()." Dump Monitor\n";
print Dumper($monitor);
print "Done....\n";
return;
}
and in zmtrigger:
if ( (time() - $monitor_reload_time) > MONITOR_RELOAD_INTERVAL )
{
foreach my $monitor ( values(%monitors) )
{
# Free up any used memory handle
print localtime()." zmMemInvalidate for $monitor\n";
zmMemInvalidate( $monitor );
}
loadMonitors();
}
This results in...
Thu Jan 22 19:40:29 2015 zmMemInvalidate for HASH(0x124ef68)
Thu Jan 22 19:40:29 2015 Monitor MMAP not defined with monitor HASH(0x124ef68)
Thu Jan 22 19:40:29 2015 Dump Monitor
$VAR1 = {
'LabelFormat' => '%N - %d/%m/%y %H:%M:%S',
'TrackDelay' => '0',
'Enabled' => '1',
'FrameSkip' => '0',
'Function' => 'Modect',
'SubPath' => '',
'DefaultRate' => '100',
'EventPrefix' => 'Motion-',
'LabelX' => '0',
'PreEventCount' => '25',
'Path' => '/video2.mjpg',
'AlarmMaxFPS' => '0.00',
'ImageBufferCount' => '50',
'Type' => 'Remote',
'LastEvent' => 46966,
'Port' => '80',
'MotionFrameSkip' => '0',
'WarmupCount' => '25',
'Triggers' => '',
'AutoStopTimeout' => undef,
'ControlAddress' => undef,
'Hue' => '-1',
'PostEventCount' => '25',
'LabelY' => '790',
'User' => '',
'RefBlendPerc' => '25',
'DefaultView' => 'Events',
'MMap' => \'Pv·ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿà.áÀTáÀT0',
'DefaultScale' => '50',
'MaxFPS' => '0.00',
'Pass' => '',
'Colours' => '3',
'V4LMultiBuffer' => undef,
'Palette' => '0',
'ReturnLocation' => '-1',
'Width' => '1280',
'Device' => '/dev/video0',
'Channel' => '0',
'Host' => 'admin:cdfdfgre@192.168.2.249',
'StreamReplayBuffer' => '1000',
'Protocol' => 'http',
'ReturnDelay' => '0',
'V4LCapturesPerFrame' => undef,
'SectionLength' => '600',
'Contrast' => '-1',
'ControlId' => '0',
'MMapAddr' => '140429154336768',
'FPSReportInterval' => '400',
'Colour' => '-1',
'Method' => 'simple',
'Deinterlacing' => '0',
'Name' => 'Cam2',
'AlarmRefBlendPerc' => '25',
'Format' => '255',
'Height' => '800',
'Controllable' => '0',
'ControlDevice' => undef,
'MMapHandle' => \*ZoneMinder::Memory::Mapped::MMAP,
'Id' => '2',
'Brightness' => '-1',
'LastState' => 0,
'Sequence' => '2',
'AlarmFrameCount' => '2',
'SignalCheckColour' => '#0000c0',
'TrackMotion' => '0',
'WebColour' => 'red',
'LinkedMonitors' => '',
'Orientation' => '0',
'Options' => ''
};
Done....
Thu Jan 22 19:40:29 2015 zmMemInvalidate for HASH(0x124e770)
Thu Jan 22 19:40:29 2015 Monitor MMAP not defined with monitor HASH(0x124e770)
Thu Jan 22 19:40:29 2015 Dump Monitor
$VAR1 = {
'Deinterlacing' => '0',
'Method' => 'simple',
'MMapAddr' => '140429154340864',
'FPSReportInterval' => '200',
'Colour' => '-1',
'ControlId' => '0',
'Contrast' => '-1',
'Protocol' => 'http',
'StreamReplayBuffer' => '1000',
'SectionLength' => '600',
'V4LCapturesPerFrame' => undef,
'ReturnDelay' => '0',
'Host' => 'admin:poipofks@192.168.2.248',
'Channel' => '0',
'Width' => '1280',
'Device' => '/dev/video0',
'Orientation' => '0',
'Options' => '',
'LinkedMonitors' => '',
'WebColour' => 'red',
'LastState' => 0,
'Sequence' => '1',
'Brightness' => '-1',
'AlarmFrameCount' => '2',
'SignalCheckColour' => '#0000c0',
'TrackMotion' => '0',
'Controllable' => '0',
'MMapHandle' => \*ZoneMinder::Memory::Mapped::MMAP,
'Id' => '1',
'ControlDevice' => undef,
'Height' => '800',
'Format' => '255',
'AlarmRefBlendPerc' => '12',
'Name' => 'Cam1',
'LastEvent' => 46969,
'Type' => 'Remote',
'AlarmMaxFPS' => '0.00',
'ImageBufferCount' => '50',
'MotionFrameSkip' => '0',
'Port' => '80',
'PreEventCount' => '25',
'Path' => '/video2.mjpg',
'EventPrefix' => 'Motion-',
'DefaultRate' => '100',
'LabelX' => '0',
'SubPath' => '',
'Function' => 'Modect',
'Enabled' => '1',
'FrameSkip' => '0',
'TrackDelay' => '0',
'LabelFormat' => '%N - %d/%m/%y %H:%M:%S',
'Palette' => '0',
'ReturnLocation' => '-1',
'V4LMultiBuffer' => undef,
'Colours' => '3',
'DefaultScale' => '50',
'Pass' => '',
'MaxFPS' => '0.00',
'LabelY' => '790',
'MMap' => \y·ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿà.áÀTáÀT0',
'User' => '',
'RefBlendPerc' => '12',
'DefaultView' => 'Events',
'ControlAddress' => undef,
'PostEventCount' => '25',
'Hue' => '-1',
'Triggers' => '',
'AutoStopTimeout' => undef,
'WarmupCount' => '25'
};
Done....
Thu Jan 22 19:40:29 2015 zmMemInvalidate for HASH(0x12543c8)
Thu Jan 22 19:40:29 2015 Monitor MMAP not defined with monitor HASH(0x12543c8)
Thu Jan 22 19:40:29 2015 Dump Monitor
$VAR1 = {
'Orientation' => '0',
'Options' => '',
'WebColour' => 'red',
'LinkedMonitors' => '',
'LastState' => 0,
'Sequence' => '3',
'AlarmFrameCount' => '2',
'Brightness' => '-1',
'SignalCheckColour' => '#0000c0',
'TrackMotion' => '0',
'Controllable' => '0',
'ControlDevice' => undef,
'Id' => '3',
'MMapHandle' => \*ZoneMinder::Memory::Mapped::MMAP,
'Height' => '800',
'AlarmRefBlendPerc' => '25',
'Format' => '255',
'Name' => 'Cam3',
'Deinterlacing' => '0',
'Method' => 'simple',
'MMapAddr' => '140429154332672',
'FPSReportInterval' => '400',
'Colour' => '-1',
'Contrast' => '-1',
'ControlId' => '0',
'StreamReplayBuffer' => '1000',
'Protocol' => 'http',
'ReturnDelay' => '0',
'V4LCapturesPerFrame' => undef,
'SectionLength' => '300',
'Channel' => '0',
'Host' => 'admin:cvxcxvxref@192.168.2.247',
'Width' => '1280',
'Device' => '/dev/video0',
'Palette' => '0',
'ReturnLocation' => '-1',
'V4LMultiBuffer' => undef,
'Colours' => '3',
'DefaultScale' => '50',
'MaxFPS' => '7.00',
'Pass' => '',
'LabelY' => '790',
'DefaultView' => 'Events',
'User' => '',
'RefBlendPerc' => '25',
'MMap' => \'Pt·ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿà.áÀT¬áÀT0PIRCancel',
'PostEventCount' => '25',
'Hue' => '-1',
'ControlAddress' => undef,
'Triggers' => '',
'AutoStopTimeout' => undef,
'WarmupCount' => '25',
'ImageBufferCount' => '50',
'AlarmMaxFPS' => '7.00',
'Type' => 'Remote',
'LastEvent' => 46964,
'Port' => '80',
'MotionFrameSkip' => '0',
'PreEventCount' => '25',
'Path' => '/video2.mjpg',
'DefaultRate' => '100',
'EventPrefix' => 'Motion-',
'LabelX' => '0',
'SubPath' => '',
'FrameSkip' => '0',
'Enabled' => '1',
'Function' => 'Modect',
'TrackDelay' => '0',
'LabelFormat' => '%N - %d/%m/%y %H:%M:%S'
};
Done....
Thu Jan 22 19:40:29 2015Loading monitors
(Passwords have been edited, before anyone wonders)