#12 Circular reference checking is flawed


It seems that the circular reference checking mechanism of ApVSys
is flawed :

Example : I have 2 (perl) scripts, one script (child.pl) gets
called from within the other script (parent.pl) :

parent.pl :
print `child.pl`;

child.pl :
print "Hello World !\n";

When I run 'parent.pl' I get :

# APVSYS-ERROR : Circular reference detected
# command 'perl' of 'perl/v5.6.1' is not executable
# Check the file/link:
# /ap/apvroot/SunOS/v5.8/perl/v5.6.1/bin/perl
# and contact your administrator.
# The reasons of this problem can be:
# - The network is down and the command is not available.
# - The tool/version was removed but not unregistered before.
# In this case, apv-dbcheck can solve the problem.
# - The command is linked to a partition that is not shared.
# - You are not allowed to execute this command.

It seems that it is not possible to call a script from
within a script if both scripting shells (#!/apv/bin/perl) are
the same : ApVSys incorrectly thinks this a circular reference case.

The problem is propably caused by the circular ref. checking code
in apvsys-wrapper.c. To detect a circ. ref. the first path that is
defined in the (existing) PATH environment variable is compared to
the new path that is about to be prepended to the PATH variable
(/ap/apvroot/SunOS/v5.8/perl/v5.6.1/bin in our example) and if they
are the same, a circular reference error message is produced.


philip d0t van_den_bosch at alcatel d0t be


  • Arnaud BERTRAND

    Arnaud BERTRAND - 2004-04-20
    • assigned_to: nobody --> apvsys
    • status: open --> open-postponed
  • Arnaud BERTRAND

    Arnaud BERTRAND - 2004-04-20

    Logged In: YES

    Hi Philip,

    You're right: in some case, it could be annoying but I don't
    see immediately a nice solution to this problem because the
    circular reference detection is also really important. If
    you have an idea, it is welcome.

    I don't see a solution but I see a work around that should
    satisfact your needs:

    By replacing the shibang of your script: #!/apv/bin/perl by
    #!/usr/bin/env perl

    If your environment is set to look in /apv/bin first (as it
    should be ;-) ), it will have the behaviour you expected.

    So, I will posponed the resolution until I (or you... or
    someone else) will have a brilliant idea :-)



  • Arnaud BERTRAND

    Arnaud BERTRAND - 2004-04-20
    • status: open-postponed --> closed-postponed
  • Nobody/Anonymous

    Logged In: NO

    Independent of the findings of Philip, I ran into the same
    problem while trying to build kdelibs-3.3.2 (autoconf/v2.57
    and perl/v5.6.1) . Can the problem be fixed by allowing a
    reasonable recursion depth ?



Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks