Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#187 Missing dot in Generic.pm

v0.9.9
closed-invalid
Andre-Littoz
1
2011-08-01
2011-07-29
Kevin Walls
No

LXR 0.9.9, but looks to be the same in 0.9.10 also.

Nothing runs, basically. Sorry, lost the exact command but failure is:

[Thu Jul 28 11:08:40 2011] [error] [client x.x.x.x] [Thu Jul 28 11:08:40 2011] fatal: main, line 224: Sequence (?|...) not recognized in regex; marked by <-- HERE in m/^\t\t\t\t\t# reminder: no initial space in the grammar,
...referrer info etc...

This must need the following, a missing dot before a question-mark:

diff -C 3 lib/LXR/Lang/Generic.pm.orig lib/LXR/Lang/Generic.pm
*** lib/LXR/Lang/Generic.pm.orig Sun Mar 27 10:51:25 2011
--- lib/LXR/Lang/Generic.pm Fri Jul 29 11:27:50 2011
***************
*** 217,223 ****
$source =~ s/^ # reminder: no initial space in the grammar
([\w\#]\s*[\w]*) # reserved keyword for include construct
(\s+) # space
! (?| (\")(.+?)(\") # C syntax
| (\0<)(.+?)(\0>) # C alternate syntax
| ()([\w:]+)(\b) # Perl and others
)
--- 217,223 ----
$source =~ s/^ # reminder: no initial space in the grammar
([\w\#]\s*[\w]*) # reserved keyword for include construct
(\s+) # space
! (.?| (\")(.+?)(\") # C syntax
| (\0<)(.+?)(\0>) # C alternate syntax
| ()([\w:]+)(\b) # Perl and others
)

..which runs fine. The same statement is in lib/LXR/Lang.pm WITH the missing dot in place.

Discussion

  • Andre-Littoz
    Andre-Littoz
    2011-07-29

    No, your suggested fix doesn't solve the bug. I don't exactly know what it does, but sure, it messes up #include processing: the file name is reduced to the first delimiter (i.e. " or >) and the hyperlink is not generated.

    The cause is in Perl. Your version is probably 5.8.8 whereas the syntax is 5.10. See comments # 3 & 4 in topic "Help on non-regression test" of forum Help. It is covered in depth in the discussion.

    Basically, (?| requests that all captures in the alternatives keep the same numbers. Your proposed change says a first alternative (.?| optionnally captures a single character and is followed by a series of alternatives. Since the first always succeeds, the others are never tested.

    If you think that 5.8.8-flavoured Perl is still ubiquitous, I can issue rather quickly a 0.9.11 release to downgrade the syntax. The easiest way to go is to upgrade your Perl.

     
  • Andre-Littoz
    Andre-Littoz
    2011-07-29

    • assigned_to: nobody --> ajlittoz
    • labels: --> Lang support
    • status: open --> pending-invalid
     
  • Kevin Walls
    Kevin Walls
    2011-07-29

    Ah right, thanks.. So I'm missing out on the include file stuff!
    I had wondered if I had a Perl version that was behind, but was happy things were running. 8-)

    (I just checked the same statement in lib/LXR/Lang.pm in 0.9.10 and I see now it has changed to REMOVE the dot, I guess I was fooled as I was looking at 0.9.9 and the dot was there.)

     
  • Kevin Walls
    Kevin Walls
    2011-07-29

    • status: pending-invalid --> open-invalid
     
  • Andre-Littoz
    Andre-Littoz
    2011-07-30

    I am upset by your comment: I checked both my working development copy and the reference I put on the lxr.sf.net site and found that the 0.9.9 and 0.9.10 versions of generic.pm and Lang.pm are identical. They have no dot in the (?| prefix flag construct.

    I didn't check the released tarball. Please verify your copy and tell me if I made an error. This would be a very serious bug.

     
  • Andre-Littoz
    Andre-Littoz
    2011-07-30

    • status: open-invalid --> pending-invalid
     
  • Kevin Walls
    Kevin Walls
    2011-08-01

    • priority: 5 --> 1
    • status: pending-invalid --> closed-invalid
     
  • Kevin Walls
    Kevin Walls
    2011-08-01

    Oooops - OK, sorry for the spam!...

    I can't explain this, but the released tarball is fine and my install has not only gained the dot we are talking about, but there is an extra TAB character on the same line... I have no idea where this comes from, it's not like I've been intentionally changing the file, I just went to look once I hit the error (in the other copy of the same expression).

    But, it looks like some craziness in my copy which is fixed by unpacking it again. I thought I'd stumbled on something useful/important, but really its just my own problem.

    Thanks for the guidance. 8-)