microsoft / microsoft/vscode-cpptools

Debugger: corrupted double-linked list

Open
#12,945 12 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger help wanted
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and version: archlinux
  • VS Code: 1.96.0 - insider
  • C/C++ extension: 1.23.1
  • GDB / LLDB version: GNU gdb (GDB) 15.2
Bug Summary and Steps to Reproduce

Bug Summary:
Sometimes when I start to debug a cpp file, gdb crashes with "corrupted double-linked list". That seems to happen randomly, and usually disappear after a restart or rebuild.

Steps to reproduce:

  1. In the latest archlinux, install vscode-insider from aur.
  2. install the C/C++ extension.
  3. Write a cpp file.
  4. build
  5. launch.
  6. There's "corrupted double-linked list" in the shell.
Debugger Configurations
{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: g++ Build",
            "command": "/usr/bin/g++",
            "args": [
                "-fdiagnostics-color=always",
                "-g",
                "${file}",
                "-o",
                "${workspaceFolder}/Problems/bin/${fileBasenameNoExtension}",
                "-Wall",
                "-mcmodel=large",
                "-fsanitize=undefined,address"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ],
    "version": "2.0.0"
}

launch.json:

    {
        "name": "(gdb) launch",
        "type": "cppdbg",
        "request": "launch",
        "program": "${workspaceFolder}/Problems/bin/${fileBasenameNoExtension}",
        "args": [
                "2>",
                "${workspaceFolder}/Problems/logs/${fileBasenameNoExtension}.log",
                "<",
                "${workspaceFolder}/Problems/input/${fileBasenameNoExtension}.in",
                ">",
                "${workspaceFolder}/Problems/output/${fileBasenameNoExtension}.out"
            ],
        "stopAtEntry": false,
        "cwd": "${fileDirname}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "setupCommands": [
            {
                "description": "enable-pretty-printing",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            },
            {
                "description": "gdb-set disassembly-flavor intel",
                "text": "-gdb-set disassembly-flavor intel",
                "ignoreFailures": true
            }
        ],
        "logging": {
            "trace": false,
            "traceResponse": false,
            "engineLogging": false
        }
    }
Debugger Logs
Shell:
 /tmp/Microsoft-MIEngine-Cmd-o4wyfsi1.uvj: 第 2 行:44048 已中止               (核心已转储)"/usr/bin/gdb" --interpreter=mi --tty=$DbgTerm < "/tmp/Microsoft-MIEngine-In-bm43zbsy.hm0" > "/tmp/Microsoft-MIEngine-Out-bjnwcvx0.uct"
Output:
Activating task providers cppbuild
Debug Console:
Nothing after gdb's copyright information.
Core dump:
           PID: 44048 (gdb)
           UID: 1000 (Sving1024)
           GID: 1000 (Sving1024)
        Signal: 6 (ABRT)
     Timestamp: Sat 2024-11-09 21:50:47 CST (7min ago)
  Command Line: /usr/bin/gdb --interpreter=mi --tty=/dev/pts/2
    Executable: /usr/bin/gdb
 Control Group: /user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@wayland.service
          Unit: user@1000.service
     User Unit: org.gnome.Shell@wayland.service
         Slice: user-1000.slice
     Owner UID: 1000 (Sving1024)
       Boot ID: 0decefcddda24410bcd734a899f90617
    Machine ID: f708d61fa25b4732ad2631e253cfbfa6
      Hostname: archlinux-asm236x
       Storage: /var/lib/systemd/coredump/core.gdb.1000.0decefcddda24410bcd734a899f90617.44048.1731160247000000.zst (present)
  Size on Disk: 3.9M
       Message: Process 44048 (gdb) of user 1000 dumped core.
                
                Module /usr/lib/guile/3.0/ccache/ice-9/format.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/vlist.go without build-id.
                Module /usr/lib/guile/3.0/ccache/srfi/srfi-26.go without build-id.
                Module /usr/lib/guile/3.0/ccache/language/scheme/decompile-tree-il.go without build-id.
                Module /usr/lib/guile/3.0/ccache/language/scheme/compile-tree-il.go without build-id.
                Module /usr/lib/guile/3.0/ccache/language/scheme/spec.go without build-id.
                Module /usr/lib/guile/3.0/ccache/system/vm/loader.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/receive.go without build-id.
                Module /usr/lib/guile/3.0/ccache/system/base/message.go without build-id.
                Module /usr/lib/guile/3.0/ccache/system/base/language.go without build-id.
                Module /usr/lib/guile/3.0/ccache/system/base/compile.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/eval-string.go without build-id.
                Module /usr/share/gdb/guile/gdb.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/regex.go without build-id.
                Module /usr/lib/guile/3.0/ccache/system/base/target.go without build-id.
                Module /usr/lib/guile/3.0/ccache/system/foreign.go without build-id.
                Module /usr/lib/guile/3.0/ccache/system/foreign-library.go without build-id.
                Module /usr/lib/guile/3.0/ccache/srfi/srfi-16.go without build-id.
                Module /usr/lib/guile/3.0/ccache/language/tree-il.go without build-id.
                Module /usr/lib/guile/3.0/ccache/oop/goops.go without build-id.
                Module /usr/lib/guile/3.0/ccache/system/base/syntax.go without build-id.
                Module /usr/lib/guile/3.0/ccache/system/base/pmatch.go without build-id.
                Module /usr/lib/guile/3.0/ccache/language/tree-il/primitives.go without build-id.
                Module /usr/lib/guile/3.0/ccache/rnrs/bytevectors.go without build-id.
                Module /usr/lib/guile/3.0/ccache/srfi/srfi-4.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/exceptions.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/control.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/q.go without build-id.
                Module /usr/lib/guile/3.0/ccache/srfi/srfi-9/gnu.go without build-id.
                Module /usr/lib/guile/3.0/ccache/system/base/ck.go without build-id.
                Module /usr/lib/guile/3.0/ccache/srfi/srfi-9.go without build-id.
                Module /usr/lib/guile/3.0/ccache/srfi/srfi-1.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/futures.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/match.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/threads.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/ports.go without build-id.
                Module /usr/lib/guile/3.0/ccache/srfi/srfi-11.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/copy-tree.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/deprecated.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/networking.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/psyntax-pp.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/boot-9.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/posix.go without build-id.
                Module /usr/lib/guile/3.0/ccache/ice-9/eval.go without build-id.
                Stack trace of thread 44048:
                #0  0x000071f420bb63f4 n/a (libc.so.6 + 0x963f4)
                #1  0x000071f420b5d120 raise (libc.so.6 + 0x3d120)
                #2  0x00006234c1650772 n/a (gdb + 0x2bf772)
                #3  0x000071f420b5d1d0 n/a (libc.so.6 + 0x3d1d0)
                #4  0x000071f420bb63f4 n/a (libc.so.6 + 0x963f4)
                #5  0x000071f420b5d120 raise (libc.so.6 + 0x3d120)
                #6  0x000071f420b444c3 abort (libc.so.6 + 0x244c3)
                #7  0x000071f420b45354 n/a (libc.so.6 + 0x25354)
                #8  0x000071f420bc0765 n/a (libc.so.6 + 0xa0765)
                #9  0x000071f420bc138c n/a (libc.so.6 + 0xa138c)
                #10 0x000071f420bc425a n/a (libc.so.6 + 0xa425a)
                #11 0x000071f420bc5fae __libc_calloc (libc.so.6 + 0xa5fae)
                #12 0x00006234c1ea79fc n/a (gdb + 0xb169fc)
                #13 0x00006234c17368b1 n/a (gdb + 0x3a58b1)
                #14 0x00006234c17369f7 n/a (gdb + 0x3a59f7)
                #15 0x00006234c174652d n/a (gdb + 0x3b552d)
                #16 0x00006234c1747aeb n/a (gdb + 0x3b6aeb)
                #17 0x00006234c1ef9524 n/a (gdb + 0xb68524)
                #18 0x00006234c1517d82 n/a (gdb + 0x186d82)
                #19 0x00006234c1520395 n/a (gdb + 0x18f395)
                #20 0x00006234c1f5677f n/a (gdb + 0xbc577f)
                #21 0x00006234c17c1773 n/a (gdb + 0x430773)
                #22 0x00006234c17c2cad n/a (gdb + 0x431cad)
                #23 0x00006234c17c3194 n/a (gdb + 0x432194)
                #24 0x00006234c16505f7 n/a (gdb + 0x2bf5f7)
                #25 0x00006234c1a26740 n/a (gdb + 0x695740)
                #26 0x00006234c1ebc3e1 n/a (gdb + 0xb2b3e1)
                #27 0x00006234c1f0b703 n/a (gdb + 0xb7a703)
                #28 0x00006234c178f765 n/a (gdb + 0x3fe765)
                #29 0x00006234c1428c15 n/a (gdb + 0x97c15)
                #30 0x000071f420b45e08 n/a (libc.so.6 + 0x25e08)
                #31 0x000071f420b45ecc __libc_start_main (libc.so.6 + 0x25ecc)
                #32 0x00006234c143fc25 n/a (gdb + 0xaec25)
                
                Stack trace of thread 44053:
                #0  0x000071f420bb0a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000071f420bb3479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000071f420ed6c31 __gthread_cond_wait (libstdc++.so.6 + 0xd6c31)
                #3  0x00006234c1ebf8ec n/a (gdb + 0xb2e8ec)
                #4  0x000071f420ee1c34 execute_native_thread_routine (libstdc++.so.6 + 0xe1c34)
                #5  0x000071f420bb439d n/a (libc.so.6 + 0x9439d)
                #6  0x000071f420c3949c n/a (libc.so.6 + 0x11949c)
                
                Stack trace of thread 44054:
                #0  0x000071f420bb0a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000071f420bb3479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000071f420ed6c31 __gthread_cond_wait (libstdc++.so.6 + 0xd6c31)
                #3  0x00006234c1ebf8ec n/a (gdb + 0xb2e8ec)
                #4  0x000071f420ee1c34 execute_native_thread_routine (libstdc++.so.6 + 0xe1c34)
                #5  0x000071f420bb439d n/a (libc.so.6 + 0x9439d)
                #6  0x000071f420c3949c n/a (libc.so.6 + 0x11949c)
                
                Stack trace of thread 44055:
                #0  0x000071f420bb0a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000071f420bb3479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000071f420ed6c31 __gthread_cond_wait (libstdc++.so.6 + 0xd6c31)
                #3  0x00006234c1ebf8ec n/a (gdb + 0xb2e8ec)
                #4  0x000071f420ee1c34 execute_native_thread_routine (libstdc++.so.6 + 0xe1c34)
                #5  0x000071f420bb439d n/a (libc.so.6 + 0x9439d)
                #6  0x000071f420c3949c n/a (libc.so.6 + 0x11949c)
                
                Stack trace of thread 44056:
                #0  0x000071f420bb0a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000071f420bb3479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000071f420ed6c31 __gthread_cond_wait (libstdc++.so.6 + 0xd6c31)
                #3  0x00006234c1ebf8ec n/a (gdb + 0xb2e8ec)
                #4  0x000071f420ee1c34 execute_native_thread_routine (libstdc++.so.6 + 0xe1c34)
                #5  0x000071f420bb439d n/a (libc.so.6 + 0x9439d)
                #6  0x000071f420c3949c n/a (libc.so.6 + 0x11949c)
                
                Stack trace of thread 44060:
                #0  0x000071f420bb0a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000071f420bb3479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000071f4210f36a1 n/a (libgc.so.1 + 0x1f6a1)
                #3  0x000071f4210f382f n/a (libgc.so.1 + 0x1f82f)
                #4  0x000071f420bb439d n/a (libc.so.6 + 0x9439d)
                #5  0x000071f420c3949c n/a (libc.so.6 + 0x11949c)
                
                Stack trace of thread 44061:
                #0  0x000071f420bb0a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000071f420bb3479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000071f4210f36a1 n/a (libgc.so.1 + 0x1f6a1)
                #3  0x000071f4210f382f n/a (libgc.so.1 + 0x1f82f)
                #4  0x000071f420bb439d n/a (libc.so.6 + 0x9439d)
                #5  0x000071f420c3949c n/a (libc.so.6 + 0x11949c)
                
                Stack trace of thread 44062:
                #0  0x000071f420bb0a19 n/a (libc.so.6 + 0x90a19)
                #1  0x000071f420bb3479 pthread_cond_wait (libc.so.6 + 0x93479)
                #2  0x000071f4210f36a1 n/a (libgc.so.1 + 0x1f6a1)
                #3  0x000071f4210f382f n/a (libgc.so.1 + 0x1f82f)
                #4  0x000071f420bb439d n/a (libc.so.6 + 0x9439d)
                #5  0x000071f420c3949c n/a (libc.so.6 + 0x11949c)
                ELF object binary architecture: AMD x86-64
Other Extensions

core.gdb.1000.0decefcddda24410bcd734a899f90617.44048.1731160247000000.zip

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the crash with the tasks configuration and launch.json on Arch Linux, using the reported VS Code, C/C++ extension, and GDB versions. Inspect the provided GDB core dump and debugger logs to narrow down the failure; done means launching the configured C++ program no longer causes GDB to abort.

Written by the indexing model from the issue text.

Assessment

Tech stack
arch-linux, cpp, vscode
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.