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

PERL Fatal Error | Unable to load LXR::Lang::C

Help
dvs
2013-08-04
2013-08-05
  • dvs
    dvs
    2013-08-04

    Hi,

    #Setup
    LXR 1.2
    Ubuntu 12.04 LTS
    Server version: Apache/2.2.22 (Ubuntu)
    Server built: Jul 12 2013 13:37:15
    Chrome and Firefox
    #Setup

    I'm facing an error while trying to view the contents of .C files on LXR.

    Here's the sequence of events:

    1.1 The first time i tried to visit http://localhost/lxr/source, the browser threw an internal server error. I got the following error in the apache logs. Can't locate LXR/Common.pm in @INC.

    1.2 To fix this, I added the line use lib 'home/falex/lxr/lib'; to the /lxr/source file to point to the location of LXR installation.

    1.3 After this, the lxr/source page opened up correctly in the browser.

    2.1 Upon trying to view the contents of a .C file, I get the following error in apache logs. fatal: LXR::Lang, line 72: Unable to load LXR::Lang::C Lang class, ModPerl::Util::exit: (120000) exit was called at home/falex/lxr/lib/LXR/Common.pm line 173 at home/falex/lxr/lib/LXR/Lang.pm line 72, <CONFIG> line 6.

    2.2 I later added the correct path to LXR /lib folder in the following files as well: ident, search and showconfig.

    2.3 The same error as 2.1 appears.

    Any ideas?

    Thanks (a lot) in advance for your time and help.

    Regards,
    dvshetty

     
    Last edit: dvs 2013-08-04
    • Andre-Littoz
      Andre-Littoz
      2013-08-05

      Hello dvs,

      First, this kind of request should be submitted as a "Support request" ticket. Mailing list lxr-discussion is dedicated (in principle) developers about ideas, suggestions, discussion, ... on future features and evolution of LXR. Moreover, others could benefit from reading about your problem and its solution.

      Strangely enough, I helped yesterday an other user who incurred the same difficulty. He also did not file his request under the correct category (he used lsr-general).

      =====

      It looks like Ubuntu has two shortcomings.

      1. LXR has a dependency on Apache module mod_version, which must be installed (depending on distro it may not be installed by default). Ubuntu does not automatically load this module.

      Something like:
      cp mods-available/mod_version.loadmods-enabled/
      may be necessary (probably from within some /etc subdir -- I have no Ubuntu).

      This will cause correct interpretation of Perl(PostConfig)Require directive in apache-lxrserver.conf and set the library paths (.../lib and .../lib/LXR) as you patched the main scripts (you should also have done it for diff).

      1. What surprised me most, when Apache (mod_perl?) launched an LXR Perl script, the current working directory was apparently not set to the LXR root directory (the one containing source, showconfig, ...). This caused all relative file references (in lxr.conf) to fail. The relative paths are used to name the HTML templates in the HTML section.

      If you incur also this malfunction, prefix the templates files with the absolute LXR directory path:
      instead of 'templates/html/...', use '/home/myself/lxr/templates/html/...'.

      === Does it solve your issue?

      Regards,
      ajl, LXR administrator


      Hi,

      Setup

      LXR 1.2
      Ubuntu 12.04 LTS
      Server version: Apache/2.2.22 (Ubuntu)
      Server built: Jul 12 2013 13:37:15
      Chrome and Firefox

      Setup

      I'm facing an error while trying to view the contents of .C files on LXR.
      Here's the sequence of events:
      1.1 The first time i tried to visit http://localhost/lxr/source, the browser threw an internal server error. I got the following error in the apache logs. Can't locate LXR/Common.pm in @INC.
      1.2 To fix this, I added the line use lib 'home/falex/lxr/lib'; to point to the location of LXR installation.
      1.3 After this, the lxr/source page opened up correctly in the browser.
      2.1 Upon trying to view the contents of a .C file, I get the following error in apache logs. fatal: LXR::Lang, line 72: Unable to load LXR::Lang::C Lang class, ModPerl::Util::exit: (120000) exit was called at home/falex/lxr/lib/LXR/Common.pm line 173 at home/falex/lxr/lib/LXR/Lang.pm line 72, line 6.
      2.2 I later added the correct path to LXR /lib folder in the following files as well: ident, search and showconfig.
      2.3 The same error as 2.1 appears.
      Any ideas?
      Thanks (a lot) in advance for your time and help.
      Regards,
      dvshetty

       
      • dvs
        dvs
        2013-08-05

        Hi ajl,

        First of all, thank you very much for your valuable time and help.

        Next, apologies for posting in the wrong section.

        Should I open a ticket in the "Bugs" section to track this? I'll post your reply as well.

        As for your proposed solution, I'll check it and get back to you.

        Thanks once again.

        Regards,
        Dhiraj

         
  • dvs
    dvs
    2013-08-05

    Hi ajl,

    I did a fresh install of LXR from scratch.

    1. Your solution to enable mod_version in Apache worked for me. As you correctly mentioned, it was not enabled by default in Ubuntu.

    To enable it, the following commands need to be run on Ubuntu.

    sudo a2enmod version
    sudo service apache2 restart

    Upon doing this, the C PERL modules were located correctly.

    Please also note that I did not need to patch the main scripts (source, diff, etc.) with the use lib 'home/falex/lxr/lib'; line. It worked just by enabling mod_version.

    1. You're right again. For some reason, the paths relative to the current directory were not being honored for the HTML templates in lxr.conf. I had to add the absolute OS paths.

    Thanks once again for your valuable support.

     
    Last edit: dvs 2013-08-05