GDB warning "Failed to set controlling terminal" appears in VS Code Stable but not in VS Code Insiders
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Tranquilo
- Stack tecnológico
- c, typescript, vscode
- Área
- developer-experience, devtools
Línea de trabajo
Comienza reproduciendo la advertencia con los archivos launch.json y task.json proporcionados y, a continuación, compara el comando de GDB y los detalles de MIEngine entre VS Code Stable e Insiders. Investiga el manejo de --tty=${DbgTerm} de la extensión C/C++ y determina si el comportamiento de Stable es el esperado o si se trata de una regresión. Se considera terminado cuando se haya identificado la causa y el comportamiento de la advertencia se haya hecho coherente o documentado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Environment
Environment
- OS: Ubuntu Linux
- Architecture: x86_64
- VS Code Stable: 1.133.0
- VS Code Insiders: 1.33.7
- C/C++ extension: 1.32.2
- GDB: GNU gdb (Ubuntu 15.1-1ubuntu1~24.04.1) 15.1
- GCC: gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
Bug Summary
When debugging a simple C program using GDB through the Microsoft C/C++ extension, VS Code Stable prints the following warning:
warning: GDB: Failed to set controlling terminal: Operation not permitted
However, the same project and debugging configuration do not produce this warning when using VS Code Insiders.
The C program itself runs normally in both versions.
For example, the program outputs:
Hello world!
After the program exits, VS Code Stable also shows:
[1] + Done "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-..." 1>"/tmp/Microsoft-MIEngine-Out-..."
Steps to Reproduce
- Open a simple C project in VS Code Stable.
- Configure
cppdbgwith GDB. - Start debugging with F5.
- Observe the integrated terminal.
The following warning appears:
warning: GDB: Failed to set controlling terminal: Operation not permitted
- Open the same project with the same configuration in VS Code Insiders.
- Start debugging again.
The warning does not appear in VS Code Insiders.
Expected Behavior
The same debugging configuration should behave consistently between VS Code Stable and VS Code Insiders, or there should be an explanation for why GDB is unable to set the controlling terminal in the Stable version.
Actual Behavior
VS Code Stable:
warning: GDB: Failed to set controlling terminal: Operation not permitted
VS Code Insiders:
No warning
The program itself executes successfully in both cases.
Additional Information
The GDB command launched by VS Code is similar to:
/usr/bin/gdb --interpreter=mi --tty=${DbgTerm}
The warning seems to be related to the controlling terminal / TTY handling rather than the C program itself.
I also noticed that this behavior appeared after VS Code settings/extensions were synchronized. Before synchronization, I did not see this warning.
Is this expected behavior, or could this be a regression/change in the VS Code C/C++ extension or MIEngine?
I would like to understand why VS Code Stable attempts to set the controlling terminal in a way that results in:
Operation not permitted
while VS Code Insiders does not produce the warning.
Bug Summary and Steps to Reproduce
Steps to Reproduce
- Create a simple C project.
- Use the following
.vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": false,
"program": "${workspaceFolder}/main.out",
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "gcc"
}
]
}
- Make sure
/usr/bin/gdbis installed and available. - Press
F5to start debugging. - The program runs successfully, but the following warning appears in the terminal:
warning: GDB: Failed to set controlling terminal: Operation not permitted
- The same project and
launch.jsonare opened in VS Code Insiders. - Press
F5again.
The warning does not appear in VS Code Insiders.
The program itself runs normally in both versions and outputs:
Hello world!
Debugger Configurations
task.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "gcc",
"type": "shell",
"command": "gcc",
"args": [
"-g",
"${workspaceFolder}/src/*.c",
"${workspaceFolder}/main/*.c",
"-o",
"${workspaceFolder}/main.out",
"-Wall",
"-I${workspaceFolder}",
"-I${workspaceFolder}/include",
"-I${workspaceFolder}/src",
"-I${workspaceFolder}/main"
],
"problemMatcher": "$gcc",
"options": {
"cwd": "${workspaceFolder}"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": false,
"program": "${workspaceFolder}/main.out",
"cwd": "${workspaceFolder}",
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"logging": {
"engineLogging": true,
"trace": true,
"traceResponse": true
},
"preLaunchTask": "gcc"
}
]
}
Debugger Logs
## Debug Log
The C/C++ extension launches GDB with the following command:
"/usr/bin/gdb" --interpreter=mi --tty=$DbgTerm
The terminal output contains the following warning:
&"warning: GDB: Failed to set controlling terminal: Operation not permitted\n"
The warning is printed to stderr.
The GDB version is:
GNU gdb (Ubuntu 15.1-1ubuntu1~24.04.1) 15.1
The C/C++ extension debug log also reports the following MIEngine version:
VS.Diagnostics.Debugger.ImplementationName: Microsoft.MIDebugEngine
VS.Diagnostics.Debugger.EngineVersion: 17.12.40402.1
VS.Diagnostics.Debugger.HostVersion: 17.12.40402.1
VS.Diagnostics.Debugger.AdapterId: cppdbg
VS.Diagnostics.Debugger.MIMode: gdb
VS.Diagnostics.Debugger.FrameworkVersion: 8.0.2526.11203
The program itself runs successfully and outputs:
Hello world!
The important difference is that the warning occurs when debugging with VS Code Stable, but does not occur when using VS Code Insiders with the same project and debugging configuration.
Other Extensions
No response
Additional Information
No response
- Lenguaje dominante
- TypeScript
- Estrellas
- 6.2k
- Forks
- 1.7k
- Merge medio
- 14 h 46 min
- PR fusionados (30 d)
- 61
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/vscode-cpptools
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
microsoft/vscode-cpptools#14787 ·
-
[Bug] cpptools fails to start on Ubuntu ARM64 due to missing execute permissions on shared libraries Abiertobug fixed Language Service regression
microsoft/vscode-cpptools#14779 · 1 asignado ·
-
Language Service more info needed
microsoft/vscode-cpptools#14778 · 1 comentario · 1 asignado ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 64/100
microsoft/vscode-cpptools#14769 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
microsoft/vscode-cpptools#14768 · 1 comentario ·
Todos los issues de microsoft/vscode-cpptools
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Abiertobug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Client support matrix inclusion Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
calcite-components needs triage refactor
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Esri/calcite-design-system#15203 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
danielmiessler/LifeOS#2218 ·