question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: ripgrep giving segfault and quietly making searches fail

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Chrome
  • Local OS: macOS
  • Remote OS: Ubuntu
  • Remote Architecture: x86_64
  • code-server --version: 4.5.0

Steps to Reproduce

  1. Install code-server in the remote machine via conda-forge (mamba install code-server=4.5.0)
  2. attempt to execute the ripgrep binary included in this installation
  3. Also, after opening code-server and accessing via browser, try to search for a string in all files

Expected

  1. When executing rg, the binary executes (i.e. if you just execute /path/to/conda/env/share/code-server/lib/vscode/node_modules/@vscode/ripgrep/bin/rg, you should get an error that no arguments were required - which is expected)
  2. When searching for a string in all files, you should see all matches

Actual

  1. Get a segfault instead of observing that rg executes.
  2. When searching for a string in all open files, only see matches in open files

Logs

Having trouble finding relevant logs doing this, but I have confirmed that if I install a working version of ripgrep (i.e. via mamba install ripgrep and then replace the segfaulting binary rg inside of share/code-server/lib/vscode/node_modules/@vscode/ripgrep/bin with a symlink to this working version (which I tried based on #5216) then the search functionality works fine. So I’m pretty sure this is the source of the issue. I just don’t know WHY that binary gives a segfault.

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • I cannot reproduce this in VS Code.
  • I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:3
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
BEFHcommented, Jul 26, 2022

I was going to say that checksum mismatches on the binaries are not surprising, since conda builds everything from source. However, that’s clearly not what’s happening here. Something is very wrong:

[I] Mon, Jul 25, 2022: 21:40:40 fultob01:LOAD@li03c02 ~/local/src/lab_operations main ✔ ./rw
$ sha256sum /sc/arion/work/fultob01/conda/envs/py3.9/bin/rg                                                                                                                                                 (py3.9)
ed70a72a11ec57f60ecdf88eed747796cecbd09350f636d9e4ea6c22c0f4ec1d  /sc/arion/work/fultob01/conda/envs/py3.9/bin/rg
[I] Mon, Jul 25, 2022: 21:41:33 fultob01:LOAD@li03c02 ~/local/src/lab_operations main ✔ ./rw
$ sha256sum /sc/arion/work/fultob01/conda/envs/py3.9/share/code-server/lib/vscode/node_modules/*vscode/ripgrep/bin/rg                                                                                       (py3.9)
9b85e1a11cd624e775ab33e6b7e86fe60844f534be89d04b34a17cebf6ccc611  /sc/arion/work/fultob01/conda/envs/py3.9/share/code-server/lib/vscode/node_modules/@vscode/ripgrep/bin/rg
[I] Mon, Jul 25, 2022: 21:43:31 fultob01:LOAD@li03c02 ~/local/src/lab_operations main ✔ ./rw
$ /sc/arion/work/fultob01/conda/envs/py3.9/share/code-server/lib/vscode/node_modules/*vscode/ripgrep/bin/rg --version                                                                                       (py3.9)
fish:
[I] Mon, Jul 25, 2022: 21:44:04 fultob01:LOAD@li03c02 ~/local/src/lab_operations main ✔ ./rw
$ /sc/arion/work/fultob01/conda/envs/py3.9/share/code-server/lib/vscode/node_modules/*vscode/ripgrep/bin/rg                                                                                                 (py3.9)
fish:
0reactions
code-ashercommented, Jul 25, 2022

Ah, I was thinking that since the code-server script Conda installs invokes plain node then depending on your path or the last version of Node you installed it could be the wrong version.

But I realized that ripgrep segfaults when you run it directly so the version of Node has nothing to do with this anyway.

The sha256 does not match the release on GitHub so I am not sure what happened to it. There might be another part to the Conda build process I am missing.

9b85e1a11cd624e775ab33e6b7e86fe60844f534be89d04b34a17cebf6ccc611 
/home/coder/miniconda3/share/code-server/lib/vscode/node_modules/@vscode/ripgrep/bin/rg

80e049a3e46689b4fdee6b70bb02ee748a6ab88f6f4853753f23ae4aa2a7e958 
/home/coder/code-server-4.5.0-linux-amd64/lib/vscode/node_modules/@vscode/ripgrep/bin/rg

Edit: fixed the paths; GitHub mangled them thinking they were email addresses.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected segfault in a grep command - Stack Overflow
Any crash in user utilities, such as grep , cp , ls , etc. is a bug in said utility, and you should...
Read more >
ripgrep 11.0.2 - Docs.rs
Namely, if a non-fatal error occurs during a search, then ripgrep will now always emit a ... One exception to this is if...
Read more >
CHANGELOG.md - ripgrep - Fossies
BUG #1389: Fixes a bug where ripgrep would panic when searching a symlinked directory. BUG #1439: Improve documentation for ripgrep's automatic stdin detection....
Read more >
Triagebot Notification Data - Rust
Comment on Login error covers login link · Comment on Add unstable `rustc-check-cfg` build script output · Comment on A project can not...
Read more >
ChangeLog - ftp
Change the error when an overlay image is not writable into a warning that ... make distcheck * color-settings: Fix ColorSettings release *...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found