Quantcast
Channel: VMware Communities : Unanswered Discussions - Virtual Machine, Guest OS and VM Tools
Viewing all articles
Browse latest Browse all 1748

Bug: Infinite recursion in vmware-tools-vmxnet-common postinstall trigger if $ENV{TMPDIR} points to non-existing directory

$
0
0

I've encountered an interesting problem installing package vmware-tools-vmxnet-common in some special (maybe even abnormal) conditions:

In my case, enviroment variable TMPDIR pointed to non-existing directory (I installed package using yum with non-default --installroot parameter value),

and postinstall trigger in this package that calls vmware-config.pl runs into infinite recursion in getTmpDir subroutine, continously printing following:

 

Temp directory XXXXXXX does not exist.

 

It leads to memory exhaustion and scriptlet failure (which is considered as non-fatal by package manager, however => package installation was "succesful".)

 

Have a look on this function in vmware-config.pl:

 

sub getTmpDir {

   my $tmpDir = defined($ENV{'TMPDIR'}) ? $ENV{'TMPDIR'} : '/tmp';

   if (not -d $tmpDir) {

      warning("Temp directory $tmpDir does not exist\n");

   }

   return $tmpDir;

}

 

In my case, TMPDIR is set, so we'll use it as a temporary directory. But, warning() function uses getTmpDir too! (see logging_getFilePath function, which is used in warning -> logging_logMessage -> logging_openLogFile).

So it produces infinite recursive call ladder until stack overflow occurs. Moreover, it produced a 700Mb output of a log file on my box - that's why I've discovered this issue

 

I don't provide a patch for this, because this could be fixed in plenty of ways - I don't realize which is better.

As for me, I'd preffer to change warning() call to die() - it's really abnormal condition and is a reason to stop any further work.


Viewing all articles
Browse latest Browse all 1748

Latest Images

Trending Articles



Latest Images