microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.53k stars 1.56k forks source link

Unable to start debugging. Unexpected GDB output from command "-exec-run". During startup program exited with code 127. #10053

Closed poddar414 closed 2 years ago

poddar414 commented 2 years ago

Environment

Bug Summary and Steps to Reproduce

Bug Summary: Debugger exits.

Steps to reproduce: Use the mentioned json file, and launch the debugger. On Terminal I see "&"warning: GDB: Failed to set controlling terminal: Operation not permitted\n" &"warning: Cannot exec /bin/expired\n" &"warning: -c\n" &"warning: exec /home/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/utils/tidlModelImport/out/tidl_model_import.out /user/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/test/testvecs/config/import/public/onnx/tidl_import_tiad_jpointPillars.txt\n" &"warning: Error: No such file or directory\n" [1] + Done "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-gxuouxy4.cy1" 1>"/tmp/Microsoft-MIEngine-Out-knahyqaq.0wq""

Debugger Configurations

{
            "name": "tidl_import",
            "type": "cppdbg",
            "request": "launch",
            "program": "/user/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/utils/tidlModelImport/out/tidl_model_import.out",
            //"args": ["/user/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/test/testvecs/config/import/public/caffe/tidl_import_peeleNet.txt"],
            "args": ["/user/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/test/testvecs/config/import/public/onnx/tidl_import_tiad_jpointPillars.txt"],
            //"args": ["/user/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/test/testvecs/config/import/public/tensorflow/tidl_import_mobileNetv1_0.75_ssd.txt"],
            "stopAtEntry": true,
             "cwd": "/user/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/utils/tidlModelImport",
            "environment": [],
            "externalConsole": false,
            "logging": {
              "engineLogging": true
            },            
            "MIMode": "gdb",
            "miDebuggerPath": "/usr/bin/gdb",
            "setupCommands": [
              {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": false
              }
            ]
          },

Debugger Logs

1: (86) LaunchOptions{"name":"tidl_import","type":"cppdbg","request":"launch","program":"/user/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/utils/tidlModelImport/out/tidl_model_import.out","args":["/user/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/test/testvecs/config/import/public/onnx/tidl_import_tiad_jpointPillars.txt"],"stopAtEntry":true,"cwd":"/user/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/utils/tidlModelImport","environment":[],"externalConsole":false,"logging":{"engineLogging":true},"MIMode":"gdb","miDebuggerPath":"/usr/bin/gdb","setupCommands":[{"description":"Enable pretty-printing for gdb","text":"-enable-pretty-printing","ignoreFailures":false}],"__configurationTarget":6,"__sessionId":"f5ad0da6-31a0-43b6-b81a-eac04288319d"}
1: (288) ->=thread-group-added,id="i1"
1: (290) ->~"GNU gdb (Ubuntu 10.2-0ubuntu1~18.04~2) 10.2\n"
1: (290) ->~"Copyright (C) 2021 Free Software Foundation, Inc.\n"
1: (290) ->~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law."
1: (290) ->~"\nType \"show copying\" and \"show warranty\" for details.\n"
1: (291) ->~"This GDB was configured as \"x86_64-linux-gnu\".\n"
1: (291) ->~"Type \"show configuration\" for configuration details.\n"
1: (291) ->~"For bug reporting instructions, please see:\n"
1: (291) ->~"<https://www.gnu.org/software/gdb/bugs/>.\n"
1: (291) ->~"Find the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>."
1: (291) ->~"\n\n"
1: (291) ->~"For help, type \"help\".\n"
1: (291) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"
1: (291) ->(gdb)
1: (297) <-1001-gdb-set mi-async on
1: (297) ->1001^done
1: (298) ->(gdb)
1: (301) 1001: elapsed time 5
1: (315) <-1002-enable-pretty-printing
1: (316) ->1002^done
1: (316) ->(gdb)
1: (316) 1002: elapsed time 1
1: (316) <-1003-interpreter-exec console "set pagination off"
1: (317) ->=cmd-param-changed,param="pagination",value="off"
1: (317) ->1003^done
1: (317) ->(gdb)
1: (317) 1003: elapsed time 0
1: (317) <-1004-gdb-set auto-solib-add on
1: (320) ->1004^done
1: (320) ->(gdb)
1: (321) 1004: elapsed time 4
1: (321) <-1005-gdb-set solib-search-path /user/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/utils/tidlModelImport/out:
1: (322) ->1005^done
1: (322) ->(gdb)
1: (322) 1005: elapsed time 0
1: (322) <-1006-gdb-set stop-on-solib-events 1
1: (322) ->1006^done
1: (322) ->(gdb)
1: (322) 1006: elapsed time 0
1: (323) <-1007-environment-cd /user/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/utils/tidlModelImport
1: (323) ->1007^done
1: (323) ->(gdb)
1: (323) 1007: elapsed time 0
1: (323) <-1008-file-exec-and-symbols /user/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/utils/tidlModelImport/out/tidl_model_import.out
1: (329) ->1008^done
1: (330) ->(gdb)
1: (330) 1008: elapsed time 6
1: (333) <-1009-interpreter-exec console "show architecture"
1: (333) ->~"The target architecture is set to \"auto\" (currently \"i386:x86-64\").\n"
1: (334) ->1009^done
1: (334) ->(gdb)
1: (334) 1009: elapsed time 1
1: (336) <-1010-exec-arguments /user/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/test/testvecs/config/import/public/onnx/tidl_import_tiad_jpointPillars.txt
1: (337) ->1010^done
1: (337) ->(gdb)
1: (337) 1010: elapsed time 1
1: (338) <-1011-break-insert -f main
1: (349) ->1011^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000006090",func="main(int32_t, char**)",file="tidl_import_main.cpp",fullname="/home/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/utils/tidlModelImport/tidl_import_main.cpp",line="272",thread-groups=["i1"],times="0",original-location="main"}
1: (349) ->(gdb)
1: (359) 1011: elapsed time 21
1: (372) Send Event AD7EngineCreateEvent
1: (375) Send Event AD7ProgramCreateEvent
1: (413) ShellPid=8524
1: (414) DebuggerPid=8526
1: (654) Send Event AD7LoadCompleteEvent
=thread-group-added,id="i1"
GNU gdb (Ubuntu 10.2-0ubuntu1~18.04~2) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
1: (679) <-1012-exec-run
1: (680) ->=thread-group-started,id="i1",pid="8559"
1: (681) ->=thread-created,id="1",group-id="i1"
1: (681) ->=thread-exited,id="1",group-id="i1"
1: (681) ->=thread-group-exited,id="i1"
1: (681) ->1012^error,msg="During startup program exited with code 127."
1: (681) ->(gdb)
1: (685) <-1013-thread-info 1
1: (686) ->1013^done,threads=[]
1: (686) ->(gdb)
1: (690) 1012: elapsed time 11
1: (694) 1013: elapsed time 9
1: (697) Send Event AD7MessageEvent
1: (699) <--gdb-exit
1: (703) ->^exit
ERROR: Unable to start debugging. Unexpected GDB output from command "-exec-run". During startup program exited with code 127.
1: (711) Send Event AD7ProgramDestroyEvent
The program '/user/a0393749/deepak_files/ti/c7x-mma-tidl-before/ti_dl/utils/tidlModelImport/out/tidl_model_import.out' has exited with code 0 (0x00000000).

Other Extensions

No response

Additional Information

No response

poddar414 commented 2 years ago

It seems issue is related to https://github.com/microsoft/vscode-cpptools/issues/7515 I followed the guide https://github.com/Microsoft/MIEngine/wiki/Troubleshoot-attaching-to-processes-using-GDB

I used the commands:

echo 0| sudo tee /proc/sys/kernel/yama/ptrace_scope sudo setcap cap_sys_ptrace=eip /usr/bin/gdb

But issue still there. I am using remotedesktop to ubuntu18.04 machine. It used to work perfectly fine for years, but not sure why this happened now.

poddar414 commented 2 years ago

this was my local issue. I was able to do remote desktop, but not able to do SSH to the ubuntu machine because of my office authentication issue. Surprisingly I was able to do remote desktop but not SSH. After fixing my authentication issue , i was able to do SSH to machine and was able to do debugging in remote desktop connected environment as well.

Thanks.