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

Error setting environement variables with a length > 1966 chars in the debugger through the environment file #8411

Closed
ylatuya opened this issue Nov 17, 2021 · 4 comments
Labels

Comments

@ylatuya
Copy link

ylatuya commented Nov 17, 2021

Bug type: Debugger

Describe the bug

  • OS and Version: macOS Monterrey 12.0.1
  • VS Code Version: Version: 1.62.2 commit: 3a6960b964327f0e3882ce18fcebd07ed191b316
  • C/C++ Extension Version: v1.7.1
  • Other extensions you installed (and if the issue persists after disabling them): None
  • The debugger fails to start with an error setting an environment variable with a long value with settings set target.env-vars. Other shorter environment variables are set correctly. Setting the same longer environment variable in lldb succeeds as expected. The error can reproduced when the value of the env variable is > 1966 characters

To Reproduce

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "GStreamer - Build and debug",
            "request": "launch",
            "type": "cppdbg",
            "cwd": ".",
            "program": "/bin/sh",
            "envFile": "${workspaceFolder}/env",
            "MIMode": "lldb",
            "stopAtEntry": false,
            "console": "externalTerminal",
            "preLaunchTask": "Build",
        }
    ]
}

env file

GST_PLUGIN_SCANNER=/Users/andoni/git/gstreamer/build/subprojects/gstreamer/libs/gst/helpers/gst-plugin-scanner
GST_PLUGIN_PATH=/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-base/gst/audiomixer:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/adpcmenc:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/gaudieffects:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/sys/shm:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-base/gst/rawparse:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/ext/webp:/Users/andoni/git/gstreamer/build/subprojects/gst-python/plugin:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-good/gst/wavenc:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/gdp:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-good/gst/replaygain:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-good/gst/flx:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/ext/closedcaption:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/aiff:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-good/gst/debugutils:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-base/gst/pbtypes:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/ext/rsvg:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/switchbin:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/speed:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/ivtc:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/videoparsers:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/ext/assrender:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/subenc:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/build/subpss35su

Steps to reproduce the behavior:

  1. Click Run -> Start debugging
  2. See error
Unable to start debugging. Unexpected LLDB output from command "-interpreter-exec console "settings set target.env-vars GST_PLUGIN_PATH=\"/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-base/gst/audiomixer:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/adpcmenc:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/gaudieffects:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/sys/shm:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-base/gst/rawparse:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/ext/webp:/Users/andoni/git/gstreamer/build/subprojects/gst-python/plugin:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-good/gst/wavenc:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/gdp:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-good/gst/replaygain:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-good/gst/flx:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/ext/closedcaption:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/aiff:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-good/gst/debugutils:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-base/gst/pbtypes:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/ext/rsvg:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/switchbin:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/speed:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/ivtc:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/videoparsers:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/ext/assrender:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/subenc:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/build/subpss35sus\""".
Command 'interpreter-exec'. Command Args. Validation failed. Mandatory args not found: interpreter, command. Not all arguments or options were recognised: console "settings set target.env-vars GST_PLUGIN_PATH=\"/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-base/gst/audiomixer:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/adpcmenc:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/gaudieffects:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/sys/shm:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-base/gst/rawparse:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/ext/webp:/Users/andoni/git/gstreamer/build/subprojects/gst-python/plugin:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-good/gst/wavenc:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/gdp:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-good/gst/replaygain:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-good/gst/flx:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/ext/closedcaption:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/aiff:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-good/gst/debugutils:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-base/gst/pbtypes:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/ext/rsvg:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/switchbin:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/speed:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/ivtc:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/videoparsers:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/ext/assrender:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/subenc:/Users/andoni/git/gstreamer/build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/gst-plugins-bad/gst/rtmp2://build/subprojects/build/subpss35sus\"
@ylatuya
Copy link
Author

ylatuya commented Nov 17, 2021

The error can be reproduced for values with a length > 1966 characters. I will update the description of the issue

@ylatuya ylatuya changed the title Error setting long environement variables in the debugger through the environment file Error setting environement variables with a length > 1966 chars in the debugger through the environment file Nov 17, 2021
@WardenGnaw
Copy link
Member

This would be an issue on lldb-mi.

Their max buffer size seems to be 2048. See https://github.com/lldb-tools/lldb-mi/blob/87e390195fd2d2c40bb4154a51b0e7e003b6b9c8/src/MICmnStreamStdin.h#L58

@ylatuya
Copy link
Author

ylatuya commented Nov 23, 2021

Thanks, increasing the buffer command value x10 fixes the issue. I will open a new PR.
This seems to be a duplicate issue of #6874

ylatuya added a commit to ylatuya/lldb-mi that referenced this issue Nov 23, 2021
Increase the command buffer size x10 to support passing long environment
variables.  This is required in projects like GStreamer requiring to
setup env variables like GST_PLUGIN_PATH with several directories in
order to be able to debug without having to install into a prefix, which
takes a long time and slows down the development cycle.

microsoft/vscode-cpptools#8411
microsoft/vscode-cpptools#6874
ylatuya added a commit to ylatuya/lldb-mi that referenced this issue Nov 23, 2021
Increase the command buffer size x10 to support passing long environment
variables.  This is required in projects like GStreamer requiring to
setup env variables like GST_PLUGIN_PATH with several directories in
order to be able to debug without having to install into a prefix, which
takes a long time and slows down the development cycle.

microsoft/vscode-cpptools#8411
microsoft/vscode-cpptools#6874
@Colengms
Copy link
Contributor

Colengms commented Dec 7, 2021

Closing as external.

@Colengms Colengms closed this as completed Dec 7, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants