Menu

#276 LXR goes in to infinite loop if '#include path//to/src.h' is found in source code.

v2.3
closed-fixed
None
3
2019-02-04
2019-01-30
No

The version of LXR that you are using: 2.2.1, tried 2.3.3 but the error is still there.
Any error message that you see: No message since http request essentially hangs.
What database you are using: mysql.

Issue was noticed with C++ souce file. If there is include statement that looks like this :

#include "RecoLocalTracker/Records//interface/TrackerCPERecord.h"

LXR will get confused by '//' and goes into infinite loop. We created our own workaround patch [0], but maybe you can make it a more robust solution.

[0] https://github.com/cms-sw/cms-docker/blob/master/docker-lxr/custom.d/lxr-2.2.1-incpath-fix.patch

Discussion

  • Andre-Littoz

    Andre-Littoz - 2019-01-30
    • labels: bug -->
    • assigned_to: Andre-Littoz
    • Group: current_git --> v2.3
    • Priority: 5 --> 3
     
  • Andre-Littoz

    Andre-Littoz - 2019-01-30

    The double slash is an excellent reason for the bad behaviour. Can you confirm that everything works fine with single / separator?

    I had similar problems in other language scanners but never thought to check C/C++ (because they're so heavily used in cross-referencing the Linux kernel).

     
  • Žygimantas Matonis

    Everything is working fine with single seperator.

    The patch needs some improvement procesing '//' though (but at least it does not hang).
    http://snpy.in/ZeAGiZ

     
  • Andre-Littoz

    Andre-Littoz - 2019-02-02

    I've pushed a patch to the git repository. It works for me but my test is quite artificial. Could you test it on your real tree? Note: just substitute Lang.pm and restart the web server. Empty the caches in the browser for added reliability. No need to reindex.

    If it works fine also for you, I'll upload a fixed release.

     
  • Žygimantas Matonis

    I confirm that after replacing Lang.pm with your version in 2.2.1, path generation works as expected with various type of paths ('//////', './' '../').

     
  • Andre-Littoz

    Andre-Littoz - 2019-02-04
    • status: open --> closed-fixed
     
  • Andre-Littoz

    Andre-Littoz - 2019-02-04

    Released 2.3.4 with bug fix

    Thanks for reporting the bug.

    I'd advise you to update to latest release because all releases prior to 2.3.1 are plagued by a major vulnarability risk. DB schema did not change, you can substitute LXR source and don't need to reindex tree.

     

    Last edit: Andre-Littoz 2019-02-04
  • Žygimantas Matonis

    We are using docker container to deploy lxr. Unfortunately, if I blindly overwrite to verions 2.3.3, genxref fails to index new changes. Everything else works. This is the main issue preventing me from upgrade.

     

Log in to post a comment.

MongoDB Logo MongoDB