[augeas-devel] Weird print result with Perl bindings on amd64

David Lutterkort lutter at redhat.com
Wed Jan 14 17:23:23 UTC 2009


On Wed, 2009-01-14 at 15:03 +0100, Dominique Dumont wrote:
> David Lutterkort <lutter at redhat.com> writes:
> 
> > I can also reproduce that on my F10 box; and after much poking around
> > and staring at regexps, I verified that the C and perl versions use the
> > exact same regexps internally, but split the input differently - augtool
> > correctly notices that the first * in 'lns' is not matched with your
> > small example, but the second is. Running under perl, the first '*' is
> > matched, and trouble ensues.
> 
> Actually, after much tinkering with sshd lens, I have the gut feeling
> that the problem is in the key_re lens. Looks like the '-' operator
> between the 2 regex is not working properly.

At first, that was my suspicion, too, but the regular expressions that
are used for matching are identical, and I can see in the debugger that
the regex matcher produces different results.

> > It seems it's a locale problem - if I run the perl test with LANG=C in
> > the environment, it produces the same result as the Perl version, but if
> > I run with LANG=en_US, I get the results you described.
> 
> Weird, the LANG change has no effect on my Rhel5 machine.

Do you have any LC_ variables set ?

> But it has an effect on my Debian machine... [scratching my head]
> 
> In fact, I can get correct results with setting only the LC_COLLATE
> variable. According to the doc this variable changes the way character
> sorts are done.

Yeah, I suspect that that's what causes the differences.

> > It's not clear to me what causes the different behaviors; it seems
> > Perl is doing something with locale setup beyond what glibc does,
> > otherwise augtool should produce the same strange result with
> > LANG=en_US, but it doesn't.
> 
> Yes, and there's still the fact that the problem cannot be reproduced
> (so far) on a 32 bits arch. 

What have you tried to reproduce this on 32bit ? And with what LC_*/LANG
vars ?

David





More information about the augeas-devel mailing list