microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.86k stars 29.51k forks source link

SEGFAULT in @vscode/sqlite3 #219595

Open TheDevMinerTV opened 5 months ago

TheDevMinerTV commented 5 months ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Run VSCode on a Linux system
  2. Use KDE's "Crashed Processes Viewer"

Backtrace:

#0  sqlite3VdbeExec (p=p@entry=0x2c03bc8ca0) at /usr/src/debug/sqlite/sqlite-src-3460000/sqlite3.c:98848
#1  0x00007ffff5566d24 in sqlite3Step (p=<optimized out>) at /usr/src/debug/sqlite/sqlite-src-3460000/sqlite3.c:91222
#2  sqlite3_step (pStmt=<optimized out>) at /usr/src/debug/sqlite/sqlite-src-3460000/sqlite3.c:91283
#3  sqlite3_step (pStmt=<optimized out>) at /usr/src/debug/sqlite/sqlite-src-3460000/sqlite3.c:91272
#4  0x00007ffff15edec6 in node_sqlite3::Statement::Work_Run(napi_env__*, void*) ()
    at /opt/visual-studio-code/resources/app/node_modules.asar.unpacked/@vscode/sqlite3/build/Release/vscode-sqlite3.node
#5  0x000055555ea7ab20 in ??? ()
#6  0x0000000000000214 in ??? ()
#7  0x0000000000000000 in ??? ()

Issue in the module's repo: https://github.com/microsoft/vscode-node-sqlite3/issues/45

TheDevMinerTV commented 5 months ago

Apparently forcing VSCode to open a clean window using code -n and then just reopening my project fixed it.

wprzytula commented 4 months ago

I can confirm experiencing similar error on OSS-code 1.90.0

                #0  0x0000000001010101 n/a (n/a + 0x0)
                #1  0x0000750c28a82d24 sqlite3_step (libsqlite3.so.0 + 0x4bd24)
                #2  0x0000750b98ab2e0b _ZN12node_sqlite39Statement8Work_RunEP10napi_env__Pv (vscode-sqlite3.node + 0x47e0b)
                #3  0x000064ddeca233aa n/a (electron + 0x97123aa)
                #4  0x000064ddeca23281 n/a (electron + 0x9712281)
                #5  0x000064dde4a3314e n/a (electron + 0x172214e)
                #6  0x0000750c2bbd8ded n/a (libc.so.6 + 0x92ded)
                #7  0x0000750c2bc5c0dc n/a (libc.so.6 + 0x1160dc)
siakc commented 4 months ago
Stack trace of thread 3455:
                                                      #0  0x0000000001010101 n/a (n/a + 0x0)
                                                      #1  0x000072533f668d24 sqlite3_step (libsqlite3.so.0 + 0x4bd24)
                                                      #2  0x000072533d69de0b _ZN12node_sqlite39Statement8Work_RunEP10napi_env__Pv (vscode-sqlite3.node + 0x47e0b)
                                                      #3  0x00006214cc1cf3aa n/a (electron + 0x97123aa)
                                                      #4  0x00006214cc1cf281 n/a (electron + 0x9712281)
                                                      #5  0x00006214c41df14e n/a (electron + 0x172214e)
                                                      #6  0x00007253427ccded n/a (libc.so.6 + 0x92ded)
                                                      #7  0x00007253428500dc n/a (libc.so.6 + 0x1160dc)

Does not let me upload .zst core dump.

matthewwardrop commented 4 months ago

I'm seeing a similar stack trace here too (Arch Linux latest, VS Code 1.91):

#0  0x0000000001010101 in ?? ()
#1  0x000079bb5352edc7 in sqlite3VdbeExec (p=p@entry=0x23b803234ca0) at /usr/src/debug/sqlite/sqlite-src-3460000/sqlite3.c:98848
#2  0x000079bb53536d24 in sqlite3Step (p=<optimized out>) at /usr/src/debug/sqlite/sqlite-src-3460000/sqlite3.c:91222
#3  sqlite3_step (pStmt=<optimized out>) at /usr/src/debug/sqlite/sqlite-src-3460000/sqlite3.c:91283
#4  sqlite3_step (pStmt=<optimized out>) at /usr/src/debug/sqlite/sqlite-src-3460000/sqlite3.c:91272
#5  0x000079bb4c3edec6 in node_sqlite3::Statement::Work_Run(napi_env__*, void*) () from /opt/visual-studio-code/resources/app/node_modules.asar.unpacked/@vscode/sqlite3/build/Release/vscode-sqlite3.node
#6  0x00006302a2f3fb20 in ?? ()
#7  0x00000000000002f0 in ?? ()
#8  0x0000000000000000 in ?? ()

It definitely seems to be related to restoring of project state, since as above code -n fixes the issue. Will report back further if I can reproduce the error reliably.

matthewwardrop commented 4 months ago

Hmm... so I can reliably reproduce this starting from scratch, but I'm not at liberty to share the repositories I'm using publically. @deepak1556 Let me know if there's some way I can share relevant information with you about this one.

ItsOhen commented 4 months ago

Seeing the same thing. Not much i can add other than the coredump and that core -n will solve the problem. Stack trace of thread 215120:

0 0x0000000001010101 n/a (n/a + 0x0)

            #1  0x00007973794b2d24 sqlite3_step (libsqlite3.so.0 + 0x4bd24)
            #2  0x0000797376a9de0b _ZN12node_sqlite39Statement8Work_RunEP10napi_env__Pv (vscode-sqlite3.node + 0x47e0b)
            #3  0x000064fd90d15ada n/a (electron + 0x9688ada)
            #4  0x000064fd90d159b1 n/a (electron + 0x96889b1)
            #5  0x000064fd88da93f1 n/a (electron + 0x171c3f1)
            #6  0x000079737c5afded n/a (libc.so.6 + 0x92ded)
            #7  0x000079737c6330dc n/a (libc.so.6 + 0x1160dc)

coredump.zip

davendu commented 4 months ago

There are two different kinds of crash on my machine. One matches matthewwardrop's previous comment after enabled debuginfo, while the other crash have a messed up stack.

The crash usually happens during using Remote-SSH, and my remote machine is a OpenCloudOS, with pretty old libraries (sqlite 3.26.0, which is build in 2018). Considering the messed up stack, and weird 0x0000000001010101 in stack, maybe some version mismatch and different layout of struct caused this?