Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Visual Studio: Debugging "Environment" setting probably too long --> Application fails to start with "Not enough quota" #11626

Closed
giovaorama opened this issue Jul 13, 2022 · 5 comments · Fixed by #11631
Assignees

Comments

@giovaorama
Copy link

Environment Details (include every applicable attribute)

  • Operating System+version: MS Windows 10 version 1809
  • Compiler+version: MS Visual Studio 2019 and 2013 (last service packs)
  • Conan version: 1.48.1
  • Python version: The one installed with conan

Steps to reproduce (Include if Applicable)

Please consider that I'm not at conan expert. We just introduce it in our build environment. Then what follows may be just due to my faults

I have a Visual Studio project that depends from some conan prebuild libraries stored in our local Artifacts server (at the moment it depends directly from 2 libraries, that with their dependencies become 14 libraries).

I made test both with Visual Studio 2019 and Visual Studio 2013, our main build systems, and in both i get the same unexpected behavior:

  • the application can be compiled with out problems

  • i can start it from command line/explorer with out problems

  • when I try to start it from Visual Studio (for instance to debug it) it fails to start with this error message (sorry for the Italian)

    error

    while in the output window of the Visual Studio I got this message
    The program '[24528] MeasureBaseApp.exe' has exited with code -1073741801 (0xc0000017) 'Not Enough Quota'.

I made a lot of test to understand why I get this problem, and I think I nailed it.

The generated dependencies\conandeps.props update the Environment setting for Debugging for each dependencies.
Each generated props file for each library contains these lines, that update this setting:

<LocalDebuggerEnvironment>PATH=%PATH%;$(ConanMeasureBaseBinaryDirectories)$(LocalDebuggerEnvironment)</LocalDebuggerEnvironment>

At the end I get this result

Debugging

![Debugging](https://user-images.githubuserconten
Debugging-Enviroment

Since $(LocalDebuggerEnvironment) already contains PATH, each update adds it at least two times for each libraries making the PATH contents grows recursively with a nearly quadratic way.

It probably becomes longer that 2048 characters (I can't find a way to really check its length) leading to my problem. If I understand correctly 2048 is the standard limit for environment variables in the winapi.

If I clear the Enviroment setting (I uncheck also the "Inherit from parent or project defaults" check box) I can start the application as usual and debug it.

Please note that in some way (but maybe this may be my fault) "Inherit from parent or project defaults" will be rechecked automatically if I open again the Enviroment setting.

I still do not understand if I really need this setting, but I think that this is a strange and probably unwanted behavior.

@memsharded
Copy link
Member

Hi @giovaorama

Thanks very much for your detailed report, and your deep investigation, great job, very helpful.

I think you are right, and this is an overflow of the variable. And if LocalDebuggerEnvironment already contains the PATH, then it should be possible to remove that extra one, lets give it a try.

@memsharded
Copy link
Member

This would be the proposed fix: #11631. The only problem is that I don't see an easy way to test it automatically, it kind of needs manually trying from the IDE.

@memsharded
Copy link
Member

I have been testing it manually, and had to do some tricks in #11631, but apparently now it is working. If you know @giovaorama how to run Conan from source, it would be great if you can validate the fix works.

@memsharded
Copy link
Member

Closed by #11631, it will be in next 1.51 (and next beta.2, that will happen sooner).
Please give it a try when possible, thanks!

@giovaorama
Copy link
Author

I was out of office in the last days and i do not get any notification of your answer.
I'm to see that you solve it. Now i have to forcecall my colleagues ti update their conan version.
Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants