Skip to content

Remote process picking appears to be broken. #13791

@mjrist

Description

@mjrist

Environment

  • OS and version: Dev container: Ubuntu 24.04.1 LTS
  • VS Code: 1.102.2
  • C/C++ extension: 1.26.3
  • OS and version of remote machine (if applicable): Application container also running Ubuntu 24.04.1 LTS
  • GDB / LLDB version: GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git

Bug Summary and Steps to Reproduce

Bug Summary:

remote-attach shows me the error "file name too long: unknown". See logs below.

It seems like it is quoted incorrectly and interpreting the entire string as the executable. I think it would work if the single quotes were removed from /bin/sh -c ...

Debugger Configurations

{
            "name": "Remote Attach",
            "type": "cppdbg",
            "request": "attach",
            "program": "/app/myapp",
            "pipeTransport": {           
                "pipeProgram": "kubectl",
                "pipeArgs": ["exec", "-i", "${input:pickPod}", "--"],
                "debuggerPath": "/usr/bin/gdb"                               
            }
        }

Debugger Logs

error: Internal error occurred: error executing command in container: failed to exec in container: failed to start exec "0288b51eedf9cbcb9fc25a591c73fa017d196be8409a7e2f91d201265106bf54": OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/sh -c \"uname && if [ $(uname -o) = \\\"Toybox\\\" ] ; then ps -A -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= ; elif [ $(uname) = \\\"Linux\\\" ] ; then ps axww -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= ; elif [ $(uname) = \\\"Darwin\\\" ] ; then ps axww -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= -c; fi\"": stat /bin/sh -c "uname && if [ $(uname -o) = \"Toybox\" ] ; then ps -A -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= ; elif [ $(uname) = \"Linux\" ] ; then ps axww -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= ; elif [ $(uname) = \"Darwin\" ] ; then ps axww -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= -c; fi": file name too long: unknown
Command failed: "kubectl" "exec" "-i" "myapp-cb4ddbd89-pkt2s" "--" '/bin/sh -c "uname && if [ $(uname -o) = \"Toybox\" ] ; then ps -A -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= ; elif [ $(uname) = \"Linux\" ] ; then ps axww -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= ; elif [ $(uname) = \"Darwin\" ] ; then ps axww -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= -c; fi"'
error: Internal error occurred: error executing command in container: failed to exec in container: failed to start exec "0288b51eedf9cbcb9fc25a591c73fa017d196be8409a7e2f91d201265106bf54": OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/sh -c \"uname && if [ $(uname -o) = \\\"Toybox\\\" ] ; then ps -A -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= ; elif [ $(uname) = \\\"Linux\\\" ] ; then ps axww -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= ; elif [ $(uname) = \\\"Darwin\\\" ] ; then ps axww -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= -c; fi\"": stat /bin/sh -c "uname && if [ $(uname -o) = \"Toybox\" ] ; then ps -A -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= ; elif [ $(uname) = \"Linux\" ] ; then ps axww -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= ; elif [ $(uname) = \"Darwin\" ] ; then ps axww -o pid=,comm=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,args= -c; fi": file name too long: unknown

Other Extensions

No response

Additional Information

No response

Metadata

Metadata

Assignees

Labels

bugdebuggerhelp wantedCan be fixed in the public (open source) repo.

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions