sadat.ali.khan has asked for the wisdom of the Perl Monks concerning the following question:

hello,

I have created a 64 bit perl binary for RHEL 5.10, using the PAR Packer version 0.85 version and perl 5.8.8. The binary works fine and has been scheduled in cron every 15 minutes.

But I am observing something very strange. After about 3 days of running, the size of the binary reduces on its own. The original size is 4185367 B and the reduced size is different for different hosts ( e.g. 1353584 B ). This reduction in size causes problems in binary run.

any clues/pointers as to why this is happening ?

regards Sadat Ali Khan

Replies are listed 'Best First'.
Re: perl binary size reducing
by rminner (Chaplain) on Nov 28, 2013 at 07:55 UTC
    In case a programm/person is modifying the compiled perl script, you can try to set it immutable:
    chattr +i mycompiledscript
    
    Afterwards it will not be possible to modify or replace this script until someone executes:
    chattr -i mycompiledscript
    
    Since most programms don't do a 'chattr -i file' before trying to modify a file, and most people do not know about it, it should be less likely that your file will change in size.

    Update:
    Note: "chattr +/-i file" will only work as root.
      "...and most people do not know about it..."

      Unfortunately now they know about it.

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

        pretty sure it is not a person who is doing this... so not very concerned about the -i option... wait and watch

      thanks... done. will monitor for a few days and confirm if this works

        Note that a root user can still do whatever he wants with the file.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: perl binary size reducing
by BrowserUk (Patriarch) on Nov 28, 2013 at 06:07 UTC

    Are you saying that the size of the executable file on disk is changing?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      yes exactly

        Then, this might be an occurrence of a rare phenomenon known as bit decay.

        Did you put some plutonium in your program? If yes, you should probably try to remove it from the program.

        ;-)

        Then I suggest you look around your office to see who is grinning, because it's probably someone close playing a prank.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re: perl binary size reducing
by marto (Cardinal) on Nov 28, 2013 at 09:50 UTC

    Please show us how you created the executable, the exact command line string used.

      pp -o binary binary.pl

        Perhaps something weird is going on with your system with regards the cache directory the "executable" unpacks to. Without seeing your code all I can suggest is basic logical debugging actions. I'd use the verbose option when creating the package, then monitor the cached area to ensure that nothing is cleaning it up or removing any files for whatever reason.

        You could specify an area outside of /tmp which would be imune from cetain sysadmin/housekeeping tasks. Look for -vvv and -T options witin the pp documentation.

Re: perl binary size reducing
by Anonymous Monk on Nov 28, 2013 at 04:46 UTC
    what binary ?

      file <binary name> gives the following

      ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), stripped

        Which file is that?