Skip Menu |

This queue is for tickets about the Win32-TieRegistry CPAN distribution.

Report information
The Basics
Id: 97127
Status: resolved
Priority: 0/
Queue: Win32-TieRegistry

People
Owner: Nobody in particular
Requestors: SJM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.26
Fixed in: 0.28



Subject: Strawberry Perl 5.20 NO_MORE_ITEMS in _enumSubKeys() Error
I have no idea why this is happening or why what I did to fix it works, but I am not seeing this error on anything before 5.20. In a registry key, where the max subkey length is 72 (reported correctly by the Information() method), SubKeysNames() is failing inside of _enumSubKeys because it is failing the _NoMoreItems() check when it gets to the $self->RegEnumKeyEx call on the longest subkey. For some reason changing the line: 695: $namSiz++; $clsSiz++; to 695: $namSiz+=8; $clsSiz++; Corrects the issue. Any less than increasing it by 8 results in the error.
To add some more information, since this has been difficult to reproduce, attached is a quick script I wrote to sort of display the issue with some real-world info. I know the longest subkey in the particular registry key I'm looking at, so I can show the problem. Here is the output of running the script with Strawberry Perl 5.18.2.2: Longest SubKey : [Symantec NetBackup 7.6.0.3 (7.6 Release Update 0 Maintenance Release 3)] Longest SubKey length: [71] Maximum SubKey length: [71] --------- Using SubKey name size: 71 (+0) More data, error occured ---------- Using SubKey name size: 72 (+1) Got all subkeys AddressBook Connection Manager DirectDrawEx Fontcore IE40 IE4Data IE5BAKEX IEData Microsoft .NET Framework 4 Client Profile Microsoft .NET Framework 4 Extended MobileOptionPack SchedulingAgent Sevinst Symantec NetBackup Symantec NetBackup 7.6.0.3 (7.6 Release Update 0 Maintenance Release 3) WIC {1D8E6291-B0D5-35EC-8441-6616F567A0F7} {4B6C7001-C7D6-3710-913E-5BC23FCE91E6} {5841B7F6-7208-4751-A133-BC8A78A2FC2D} {5FCE6D76-F5DC-37AB-B2B8-22AB8CEDB1D4} {71EB7443-F4C0-4359-8338-5BADB61D8EC4} {732F0287-FFD8-44C0-BD2A-A6452CBC5F00} {89C285BC-E164-4FF6-81B6-E80C2A371486} {8E34682C-8118-31F1-BC4C-98CD9675E1C2} {B53661DC-CD94-4B14-B15F-D9DDCFF72558} {DBFC6AAE-DCCB-4C23-B01C-3EDDDC03298B} {DC95E7AD-E6E9-4635-838E-13B051B05045} {E683E343-9CDE-4F66-8A7A-6517838597CF} {F5B09CFD-F0B2-36AF-8DF4-1DF6B63FC7B4} And the output of running it with Strawberry Perl 5.20.0.1: Longest SubKey : [Symantec NetBackup 7.6.0.3 (7.6 Release Update 0 Maintenance Release 3)] Longest SubKey length: [71] Maximum SubKey length: [71] --------- Using SubKey name size: 71 (+0) More data, error occured ---------- Using SubKey name size: 72 (+1) More data, error occured ---------- Using SubKey name size: 73 (+2) More data, error occured ---------- Using SubKey name size: 74 (+3) More data, error occured ---------- Using SubKey name size: 75 (+4) More data, error occured ---------- Using SubKey name size: 76 (+5) More data, error occured ---------- Using SubKey name size: 77 (+6) More data, error occured ---------- Using SubKey name size: 78 (+7) More data, error occured ---------- Using SubKey name size: 79 (+8) Got all subkeys AddressBook Connection Manager DirectDrawEx Fontcore IE40 IE4Data IE5BAKEX IEData Microsoft .NET Framework 4 Client Profile Microsoft .NET Framework 4 Extended MobileOptionPack SchedulingAgent Sevinst Symantec NetBackup Symantec NetBackup 7.6.0.3 (7.6 Release Update 0 Maintenance Release 3) WIC {1D8E6291-B0D5-35EC-8441-6616F567A0F7} {4B6C7001-C7D6-3710-913E-5BC23FCE91E6} {5841B7F6-7208-4751-A133-BC8A78A2FC2D} {5FCE6D76-F5DC-37AB-B2B8-22AB8CEDB1D4} {71EB7443-F4C0-4359-8338-5BADB61D8EC4} {732F0287-FFD8-44C0-BD2A-A6452CBC5F00} {89C285BC-E164-4FF6-81B6-E80C2A371486} {8E34682C-8118-31F1-BC4C-98CD9675E1C2} {B53661DC-CD94-4B14-B15F-D9DDCFF72558} {DBFC6AAE-DCCB-4C23-B01C-3EDDDC03298B} {DC95E7AD-E6E9-4635-838E-13B051B05045} {E683E343-9CDE-4F66-8A7A-6517838597CF} {F5B09CFD-F0B2-36AF-8DF4-1DF6B63FC7B4}
Subject: reg.pl
use strict; use Win32::TieRegistry; my $folder = Win32::TieRegistry ->Open('HKEY_LOCAL_MACHINE') ->Open('SOFTWARE') ->Open('Microsoft') ->Open('Windows') ->Open('CurrentVersion') ->Open('Uninstall'); my $longest = 'Symantec NetBackup 7.6.0.3 (7.6 Release Update 0 Maintenance Release 3)'; my ($max) = $folder->Information('MaxSubKeyLen'); print "Longest SubKey : [$longest]\n"; printf "Longest SubKey length: [%i]\n", length($longest); printf "Maximum SubKey length: [%i]\n", $max; print "---------\n"; my $plus = 0; while (1) { my( @subkeys, @classes, @times )= (); my $pos= 0; my( $subkey, $class, $time )= ("","",""); my( $namSiz, $clsSiz )= $folder->Information( qw( MaxSubKeyLen MaxSubClassLen )); $clsSiz++; $namSiz+=$plus; print "Using SubKey name size: $namSiz (+${plus})\n"; while( $folder->RegEnumKeyEx( $pos++, $subkey, $namSiz, [], $class, $clsSiz, $time ) ) { push( @subkeys, $subkey ); push( @classes, $class ); push( @times, $time ); } if ($^E eq 'More data is available') { print " More data, error occured\n"; $plus++; } else { print "Got all subkeys\n"; print " $_\n" foreach @subkeys; last; } print "----------\n"; }
On Fri Jul 11 17:13:18 2014, SJM wrote: Show quoted text
> To add some more information, since this has been difficult to > reproduce, attached is a quick script I wrote to sort of display the > issue with some real-world info. > > I know the longest subkey in the particular registry key I'm looking > at, so I can show the problem. Here is the output of running the > script with Strawberry Perl 5.18.2.2: > > Longest SubKey : [Symantec NetBackup 7.6.0.3 (7.6 Release Update > 0 Maintenance Release 3)] > Longest SubKey length: [71] > Maximum SubKey length: [71] > --------- > Using SubKey name size: 71 (+0) > More data, error occured > ---------- > Using SubKey name size: 72 (+1) > Got all subkeys > AddressBook > Connection Manager > DirectDrawEx > Fontcore > IE40 > IE4Data > IE5BAKEX > IEData > Microsoft .NET Framework 4 Client Profile > Microsoft .NET Framework 4 Extended > MobileOptionPack > SchedulingAgent > Sevinst > Symantec NetBackup > Symantec NetBackup 7.6.0.3 (7.6 Release Update 0 Maintenance Release > 3) > WIC > {1D8E6291-B0D5-35EC-8441-6616F567A0F7} > {4B6C7001-C7D6-3710-913E-5BC23FCE91E6} > {5841B7F6-7208-4751-A133-BC8A78A2FC2D} > {5FCE6D76-F5DC-37AB-B2B8-22AB8CEDB1D4} > {71EB7443-F4C0-4359-8338-5BADB61D8EC4} > {732F0287-FFD8-44C0-BD2A-A6452CBC5F00} > {89C285BC-E164-4FF6-81B6-E80C2A371486} > {8E34682C-8118-31F1-BC4C-98CD9675E1C2} > {B53661DC-CD94-4B14-B15F-D9DDCFF72558} > {DBFC6AAE-DCCB-4C23-B01C-3EDDDC03298B} > {DC95E7AD-E6E9-4635-838E-13B051B05045} > {E683E343-9CDE-4F66-8A7A-6517838597CF} > {F5B09CFD-F0B2-36AF-8DF4-1DF6B63FC7B4} > > And the output of running it with Strawberry Perl 5.20.0.1: > > Longest SubKey : [Symantec NetBackup 7.6.0.3 (7.6 Release Update > 0 Maintenance Release 3)] > Longest SubKey length: [71] > Maximum SubKey length: [71] > --------- > Using SubKey name size: 71 (+0) > More data, error occured > ---------- > Using SubKey name size: 72 (+1) > More data, error occured > ---------- > Using SubKey name size: 73 (+2) > More data, error occured > ---------- > Using SubKey name size: 74 (+3) > More data, error occured > ---------- > Using SubKey name size: 75 (+4) > More data, error occured > ---------- > Using SubKey name size: 76 (+5) > More data, error occured > ---------- > Using SubKey name size: 77 (+6) > More data, error occured > ---------- > Using SubKey name size: 78 (+7) > More data, error occured > ---------- > Using SubKey name size: 79 (+8) > Got all subkeys > AddressBook > Connection Manager > DirectDrawEx > Fontcore > IE40 > IE4Data > IE5BAKEX > IEData > Microsoft .NET Framework 4 Client Profile > Microsoft .NET Framework 4 Extended > MobileOptionPack > SchedulingAgent > Sevinst > Symantec NetBackup > Symantec NetBackup 7.6.0.3 (7.6 Release Update 0 Maintenance Release > 3) > WIC > {1D8E6291-B0D5-35EC-8441-6616F567A0F7} > {4B6C7001-C7D6-3710-913E-5BC23FCE91E6} > {5841B7F6-7208-4751-A133-BC8A78A2FC2D} > {5FCE6D76-F5DC-37AB-B2B8-22AB8CEDB1D4} > {71EB7443-F4C0-4359-8338-5BADB61D8EC4} > {732F0287-FFD8-44C0-BD2A-A6452CBC5F00} > {89C285BC-E164-4FF6-81B6-E80C2A371486} > {8E34682C-8118-31F1-BC4C-98CD9675E1C2} > {B53661DC-CD94-4B14-B15F-D9DDCFF72558} > {DBFC6AAE-DCCB-4C23-B01C-3EDDDC03298B} > {DC95E7AD-E6E9-4635-838E-13B051B05045} > {E683E343-9CDE-4F66-8A7A-6517838597CF} > {F5B09CFD-F0B2-36AF-8DF4-1DF6B63FC7B4}
The problem is with Win32API::Registry. See some good analysis here: https://rt.perl.org/Public/Bug/Display.html?id=123207 The only solution is to patch Win32API::Registry. The author seems a little unresponsive (see https://rt.cpan.org/Ticket/Display.html?id=37750.) If someone who knows XS would like to offer to take it over I think that would be best.
From: Bruce Reed
This appears to be the same bug as https://rt.cpan.org/Public/Bug/Display.html?id=99892 .