Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#250 unable to expand INCLUDE on win 2003 server EE

v3.4.1
open-fixed
5
2010-11-09
2010-11-05
Bob Loihl
No

I have software successfully using version 3.4.1 of wrapper on multiple platforms. But on some installations of the software on win 2003 server Enterprise edition SP2 we are getting the error
Unable to expand "INCLUDE": The data area passed to a system call is too small 0x7a
and the wrapper never starts or even attempts to launch our application. The config file on these machines is no different than on other platforms that work. I can get a copy if requested. Which conf var is it trying to expand? can I get help identifying conditions that would cause this behavior?

Discussion

  • Leif Mortenson
    Leif Mortenson
    2010-11-06

    Bob,
    Could you please attache your wrapper.log and wrapper.conf files to the bottom of this issue? I would like to see the exact message you are seeing.

    Right now, I am unsure where this might be getting caused, but from your message: Does your system define an "INCLUDE" environment variable? If so, what is its value?

    Cheers,
    Leif

     
  • Leif Mortenson
    Leif Mortenson
    2010-11-06

    • assigned_to: nobody --> mortenson
     
  • Bob Loihl
    Bob Loihl
    2010-11-08

    wrapper log file

     
    Attachments
  • Bob Loihl
    Bob Loihl
    2010-11-08

    wrapper configuration file

     
    Attachments
  • Bob Loihl
    Bob Loihl
    2010-11-08

    added files - requesting additional info on the environment from the troublesome machines. Sorry I didn't think to include that info when I filed the defect.

    FWIW the wrapper starts fine on these machines when they use an older version of software that uses wrapper version 3.2.1 it is only when we update to use 3.4.1 that we begin to see this problem.

     
  • Bob,

    thank you for your files.
    I checked your conf file but couldn't find the environment variable "INCLUDE" getting defined in there.
    I've tried to reproduce the problem you were seeing on our Win 2003 server, but haven't succeeded yet...

    Could you please post the value of this environment variable?

    cheers,
    christian

     
  • Leif Mortenson
    Leif Mortenson
    2010-11-09

    Bob,
    Starting with version 3.0.0, the Wrapper was loading the entire environment from the registry before running the service. This was done to make it possible to make changes to the envionment in the control panel and have them take effect without requiring a system reboot. (Starting with Windows XP and 2003, Microsoft fixed this problem them selves so Windows now updates the environment before starting a new service.)

    I looked into the code to try and figure out what could be causing this problem. We make a call to the Windows ExpandEnvironmentStrings system call, passing a NULL for the buffer and 0 for the buffer length. This should cause it to figure out how big the buffer needs to be to hold the resulting expanded variable. For some reason, in your case, this is internally failing.

    Rereading the docs for the API, I see the following:
    The size of the lpSrc and lpDst buffers is limited to 32K.

    I need to add some checks for this in the code to avoid this causing fatal problems. Most likely this is what is causing the problem on your system. I am surprised that other applications are able to make use of the INCLUDE variable however. This may only be a limitation of the API call we are using.

    Starting with version 3.5.5, this now only happens on old versions of Windows which need the registry to be loaded. With Windows XP and 2003, we no longer reload the environment from the registry. Could you please try version 3.5.6 and let me know how it works for you?

    To understand this issue better though, I would really like to see what your full environment looks like. If it contains sensitive information, please feel free to send it directly to us at support@tanukisoftware.com.

    Cheers,
    Leif

     
  • Leif Mortenson
    Leif Mortenson
    2010-11-09

    This has been fixed for 3.5.7. But please send me your environment and results of testing with 3.5.6 so I can confirm that this really was the cause.

     
  • Leif Mortenson
    Leif Mortenson
    2010-11-09

    • status: open --> open-fixed
     
  • Bob Loihl
    Bob Loihl
    2010-11-09

    env output from one of the machines experiencing problem

     
    Attachments
  • Bob Loihl
    Bob Loihl
    2010-11-09

    I uploaded a sanitized output of set command for one of the machines in question. Unfortunately I do not have the liberty of upgrading the wrapper the machines using the product are running. I can and have asked that they change the environment that the program runs under to NOT have this include parameter since it does NOT apply to my application. I will try reproducing it on my test machine here and then try running with a new wrapper version once I have done that. For the time being I think we can make these machines work by adjusting the environment and then take into my process upgrading the version of the wrapper we are using.

    Thank you very much for your quick support and turn around! I will get back to you asap with results of testing 3.5.6

     
  • Bob Loihl
    Bob Loihl
    2010-11-09

    In my test environment - downloaded both 3.4.1 wrapper and 3.5.6.
    I set a large INCLUDE env var,
    installed 3.4.1 as a service (test app)
    attempt to start the service I get fail to start same as on live machines
    uninstall 3.4.1 as service
    install 3.5.6 as a service (test app)
    start service succeeds.

    so 3.4.1 does exhibit problem and 3.5.6 does NOT exhibit problem

    Please let me know if you need more info - as far as I am concerned this issue is resolved and thank you for your help and great response times!

     
  • Leif Mortenson
    Leif Mortenson
    2010-11-10

    Bob,
    That is good news that the 3.5.6 version fixes the problem for you. This is because of 2003, that code is simply not run any longer.

    On 2000 however, this will still be a problem.

    As I said, we added some code to 3.5.7 to detect this problem and continue with only a warning.

    I was looking at the environment that your sent. You have the following two variables:

    INCLUDE=%Include%;D:\myapp\applica90\applica\inc;D:\myapp\applica90\appuser\inc;D:\myapp\applica90\applica\inc;D:\myapp\applica90\appuser\inc;D:\myapp\applica90\applica\inc;D:\myapp\applica90\appuser\inc;D:\myapp\applica90\applica\inc;D:\myapp\applica90\appuser\inc;D:\myapp\applica90\applica\inc;D:\myapp\applica90\appuser\inc;D:\myapp\applica90\applica\inc;D:\myapp\applica90\appuser\inc
    LIB=%Lib%;D:\myapp\applica90\applica\lib;D:\myapp\applica90\appuser\lib;D:\myapp\applica90\applica\lib;D:\myapp\applica90\appuser\lib;D:\myapp\applica90\applica\lib;D:\myapp\applica90\appuser\lib;D:\myapp\applica90\applica\lib;D:\myapp\applica90\appuser\lib;D:\myapp\applica90\applica\lib;D:\myapp\applica90\appuser\lib;D:\myapp\applica90\applica\lib;D:\myapp\applica90\appuser\lib

    Are these in your user environment or your system environment? They both make reference to another %INCLUDE% or %LIB% variable. I am wondering if these might be getting expanded even further. It may also be an issue with recursion or something. Usually a value set in the environment does not contain such a reference to itself.

    It is also strange that the exact same path is repeated many times in the value. This may be the result of an installer on your system that has been run several times. The installer needs to be modified to only update the INCLUDE list if the new path value does not already exist.

    The INCLUDE path above is only 390 characters in length however so this is not all that large. We will look into this a little bit more and see if we can reproduce the problem using this value.

    If you open a command window, what happens if you type "echo %INCLUDE%"?

    Cheers,
    Leif

     
  • Bob Loihl
    Bob Loihl
    2010-11-10

    Leif,
    Thanks again for your great response! Answers to your comments and questions follow.
    We have noted that the problem will occur in our knowledge base and are actively trying to EOL our support of win 2000 systems :) I have a task in my queue to upgrade the application to a 3.5.6 or later version of the wrapper (presumably 3.5.7 will be shipped by the time I get to that task.

    the INCLUDE and LIB vars are in the system environment. I am told that the use of the %Include% allows the user env to inject it's own includes up front. I have the owner of the machine cleaning up these system variables, and pointed out the repetition, and the owner will inform the vendor of the other app that it's installer is doing this.

    I used exactly that same length include var in my System vars to reproduce the problem (with no user defined includes)

    the output of echo %INCLUDE% is this
    %Include%;D:\myapp\applica90\applica\inc;D:\myapp\applica90\appuser\inc;D:\myapp\applica90\applica\inc;D:\myapp\applica90\appuser\inc;D:\myapp\applica90\applica\inc;D:\myapp\applica90\appuser\inc;D:\myapp\applica90\applica\inc;D:\myapp\applica90\appuser\inc;D:\myapp\applica90\applica\inc;D:\myapp\applica90\appuser\inc;D:\myapp\applica90\applica\inc;D:\myapp\applica90\appuser\inc

    Thanks again for your great support,
    bob