Bug 799660

Summary: yast2 ldap-server - uninitialized value $initial_skip ... /usr/lib/perl5/vendor_perl/5.16.2/Parse/RecDescent.pm line 3054
Product: [openSUSE] openSUSE 12.3 Reporter: David Bahi <david.bahi>
Component: BasesystemAssignee: E-mail List <bnc-team-screening>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: jsuchome, jweberhofer, mpluskal, msvec, ralf, suse-beta, varkoly, vcizek, wstephenson
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Bahi 2013-01-21 15:44:07 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:10.0.9) Gecko/20100101 Firefox/10.0.9

bang:~ # yast2 ldap-server

Use of uninitialized value $initial_skip in concatenation (.) or string at
	/usr/lib/perl5/vendor_perl/5.16.2/Parse/RecDescent.pm line 3054 (#1)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.
    
    To help you figure out what was undefined, perl will try to tell you
    the name of the variable (if any) that was undefined.  In some cases
    it cannot do this, so it also tells you what operation you used the
    undefined value in.  Note, however, that perl optimizes your program
    anid the operation displayed in the warning may not necessarily appear
    literally in your program.  For example, "that $foo" is usually
    optimized into "that " . $foo, and the warning will refer to the
    concatenation (.) operator, even though there is no . in
    your program.
    


Reproducible: Always

Steps to Reproduce:
1. install opensuse 12.3 beta1
2. run 'yast2 ldap-server'
3. see exception in Parse/RecDescent.pm



cannot use yast to configure LDAP server without this fixed.
Comment 1 Jiří Suchomel 2013-02-07 13:04:32 UTC
Seems like a bug in X500/DN.pm. Simple perl code with just

#! /usr/bin/perl -w

use X500::DN;


produces this error.


I do not understand the code, but maybe the line

local $Parse::RecDescent::skip = undef;

in /usr/lib/perl5/vendor_perl/5.16.0/X500/DN.pm

is the problematic one?
Comment 2 Jiří Suchomel 2013-02-07 13:04:59 UTC
*** Bug 802371 has been marked as a duplicate of this bug. ***
Comment 4 Daniel Lovasko 2013-02-12 13:14:39 UTC
It seems to be the problem. 
On the line mentioned in warning (unfortunately, right now I am not able to reproduce the warning) the code is:

my $initial_skip = defined($self->{skip}) ? $self->{skip} : $skip; 

so it means $skip _always_ needs to be defined, and '\s*' seems to me as a reasonable value. I am the maintainer of the package not so long, so I have no idea right now, why somebody set the skip to 'undef'. I will work on that.
Comment 5 Ralf Haferkamp 2013-02-13 09:05:08 UTC
*** Bug 803460 has been marked as a duplicate of this bug. ***
Comment 6 Will Stephenson 2013-03-04 13:55:31 UTC
Same warning on initial boot while yast is writing the initial configuration.
Comment 7 Johannes Weberhofer 2013-04-02 08:59:15 UTC
It would be great to see a fix for that issues, as it is currently impossible to configure a LDAP server via YaST.
Comment 9 Jiří Suchomel 2013-06-10 06:14:48 UTC
This is not YaST bug. The problem is in perl-X500-DN package, as mentioned in comments 3-4
Comment 10 Johannes Weberhofer 2013-06-10 06:36:35 UTC
X500-DN-0.29.tar.gz - which is used in the package - hasn't changed since 70 month; I had no problem with opensuse 12.1 before. Regarding https://build.opensuse.org/package/show?package=perl-X500-DN&project=openSUSE%3A12.3, only two version strings have been updated in the meantime.
Comment 11 Jiří Suchomel 2013-06-10 06:47:33 UTC
I know.

But look at comment 1: minimal example, totally unrelated to YaST
Comment 12 Johannes Weberhofer 2013-06-10 08:42:02 UTC
You are right; there is also a related debian bug-report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=641796

Must be in relation to a change in the Parse-RecDescent class; I have tried to change Line 46 in /usr/lib/perl5/vendor_perl/5.16.2/X500/DN.pm to 

local $Parse::RecDescent::skip = '';

which results in no more problems with that messages; however some perl guru should have a look at it.
Comment 15 Vítězslav Čížek 2013-06-18 07:07:20 UTC
This is a bug in X500-DN (passing undef value) or Parser-RecDescent (not handling undef value as $skip)

The X500-DN author wanted to reset the parser's default $skip value.
(which is a regular expression describing the universal token prefix)
It defaults to '\s*' meaning skipping all whitespace.

There's a distinction between undef and '' in perl, (eg in test with defined()).
However perl treats undef variable as either 0 or an empty string (depending on the context I guess)
In this case the undef-ined skip variable is treated as '',
so the suggested fix should work exactly the same as did the 'undef' before.
Comment 16 Vítězslav Čížek 2013-06-25 04:11:30 UTC
Package perl-X500-DN submitted.
Comment 17 Johannes Weberhofer 2013-06-25 04:26:50 UTC
Can you, please, request a maintenance release for opensuse 12.3, as it's also affected; one can not setup a ldap-server becaus of that issue.
Comment 18 Vítězslav Čížek 2013-06-25 05:34:20 UTC
I've already done that (openSUSE:Maintenance:1797).
Comment 19 David Bahi 2013-06-25 05:38:58 UTC
b.t.w. can we get a fix for 12.2 as well - though this has little functional impact it is "uncool" ;)

bang-tan:/export # cat /etc/SuSE-release
openSUSE 12.2 (x86_64)
VERSION = 12.2
CODENAME = Mantis

bang-tan:/export # yast2 ldap-server
Use of uninitialized value $initial_skip in concatenation (.) or string at
	/usr/lib/perl5/vendor_perl/5.16.0/Parse/RecDescent.pm line 3054 (#1)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.
    
    To help you figure out what was undefined, perl will try to tell you
    the name of the variable (if any) that was undefined.  In some cases
    it cannot do this, so it also tells you what operation you used the
    undefined value in.  Note, however, that perl optimizes your program
    anid the operation displayed in the warning may not necessarily appear
    literally in your program.  For example, "that $foo" is usually
    optimized into "that " . $foo, and the warning will refer to the
    concatenation (.) operator, even though there is no . in
    your program.
Comment 20 Vítězslav Čížek 2013-06-25 05:52:40 UTC
The maintenance update includes 12.2 as well:
https://build.opensuse.org/project/show?project=openSUSE%3AMaintenance%3A1797
Comment 21 Swamp Workflow Management 2013-06-26 05:05:01 UTC
openSUSE-RU-2013:1078-1: An update that has one recommended fix can now be installed.

Category: recommended (moderate)
Bug References: 799660
CVE References: 
Sources used:
openSUSE 12.3 (src):    perl-X500-DN-0.29-100.4.1
openSUSE 12.2 (src):    perl-X500-DN-0.29-98.4.1