Giter Site home page Giter Site logo

Comments (24)

Shatur avatar Shatur commented on August 13, 2024

I also tested the code on my Linux machine and everything works correctly.

from plenary.nvim.

Conni2461 avatar Conni2461 commented on August 13, 2024

I think args = { '--files', '.' }, should make it work (previously that wasn't necessary only when grepping).
Also see neovim/neovim#13736

from plenary.nvim.

Shatur avatar Shatur commented on August 13, 2024

@Conni2461, thanks for the info, updated the first post but still didn't help. The editor crashes.

from plenary.nvim.

Shatur avatar Shatur commented on August 13, 2024

Opened the issue in Neovim: neovim/neovim#14484

from plenary.nvim.

clason avatar clason commented on August 13, 2024

Why? Can you reproduce this without plenary?

from plenary.nvim.

Shatur avatar Shatur commented on August 13, 2024

@clason, I think that the editor should never crash, no matter what plugin is used. It should throw an error if something is wrong.

from plenary.nvim.

clason avatar clason commented on August 13, 2024

But you're calling an out-of-process job via libuv, so it's not clear that it's the editor's fault.

from plenary.nvim.

Shatur avatar Shatur commented on August 13, 2024

@clason, sure, this need more investigation.

from plenary.nvim.

clason avatar clason commented on August 13, 2024

Also, can you try without the sync() to check whether the problem is there rather than in Job:new()?

And try a debug build to see if an assert is triggered.

from plenary.nvim.

Shatur avatar Shatur commented on August 13, 2024

And try a debug build to see if an assert is triggered.

Should I build it myself?

from plenary.nvim.

clason avatar clason commented on August 13, 2024

Yes. (I mean neovim, of course, just to be clear.)

from plenary.nvim.

Shatur avatar Shatur commented on August 13, 2024

Also, can you try without the sync() to check whether the problem is there rather than in Job:new()?

Doesn't crash without sync ().

Yes. (I mean neovim, of course, just to be clear.)

Sure. Okay, will take some time, Windows is not a very convenient platform for such things.

from plenary.nvim.

clason avatar clason commented on August 13, 2024

OK, then the culprit is in sync, specifically. Since @tjdevries is on vacation, maybe our resident async expert @oberblastmeister has an idea why this crashes on Windows?

from plenary.nvim.

clason avatar clason commented on August 13, 2024

Also, can you add more details (stacktrace) on how it crashes?

from plenary.nvim.

Conni2461 avatar Conni2461 commented on August 13, 2024

job:new doesn't really do anything besides creating a job object and since plenary.job is just a wrapper around uv.spawn could you try a minimal script similar to what ndavidq0 did a couple of months ago.

Idk something like this:

local uv = vim.loop

local stdin = uv.new_pipe(false)
local stdout = uv.new_pipe(false)
local stderr = uv.new_pipe(false)

local handle = uv.spawn("rg", {
  args = { '--files' },
  stdio = { stdin, stdout, stderr }
}, function() end)

uv.read_start(stdout, function(err, data)
  assert(not err, err)
  if data then
    print(vim.inspect(data))
  end
end)

uv.read_start(stderr, function() end)

uv.shutdown(stdin, function()
  uv.close(handle, function() end)
end)

from plenary.nvim.

Shatur avatar Shatur commented on August 13, 2024

Also, can you add more details (stacktrace) on how it crashes?

How can I do it on Windows?

job:new doesn't really do anything besides creating a job object and since plenary.job is just a wrapper around uv.spawn could you try a minimal script similar to what ndavidq0 did a couple of months ago.

Prints the output and crashes.

from plenary.nvim.

clason avatar clason commented on August 13, 2024

Also, can you add more details (stacktrace) on how it crashes?

How can I do it on Windows?

I don't know; I haven't touched Windows for more than 15 years. I'm sure StackOverflow can help, though. How are you running neovim (without -qt) in Windows?

job:new doesn't really do anything besides creating a job object and since plenary.job is just a wrapper around uv.spawn could you try a minimal script similar to what ndavidq0 did a couple of months ago.

Prints the output and crashes.

Can you reproduce without neovim (via https://github.com/luvit/luv)?

from plenary.nvim.

Shatur avatar Shatur commented on August 13, 2024

I don't know; I haven't touched Windows for more than 15 years. I'm sure StackOverflow can help, though. How are you running neovim (without -qt) in Windows?

I've tried both cases.

Can you reproduce without neovim (via https://github.com/luvit/luv)?

I have not tried it because I don't use Windows as my development environment.

from plenary.nvim.

Shatur avatar Shatur commented on August 13, 2024

At the moment I'm trying to build on Windows in debug and see where the crash occurs. I need some time to setup the environment.

from plenary.nvim.

Shatur avatar Shatur commented on August 13, 2024

I built the application and its dependencies in debug. When executing the above code, the debugger stops here:

изображение

from plenary.nvim.

Shatur avatar Shatur commented on August 13, 2024

@Conni2461, with the latest master the following code works just fine:

local uv = vim.loop

local stdin = uv.new_pipe(false)
local stdout = uv.new_pipe(false)
local stderr = uv.new_pipe(false)

local handle = uv.spawn("rg", {
  args = { '--files' },
  stdio = { stdin, stdout, stderr }
}, function() end)

uv.read_start(stdout, function(err, data)
  assert(not err, err)
  if data then
    print(vim.inspect(data))
  end
end)

uv.read_start(stderr, function() end)

uv.shutdown(stdin, function()
  uv.close(handle, function() end)
end)

But the code from the my first message still crashes the editor. I assume that this is a Plenary issue. Can I somehow provide more information to help to fix it?

from plenary.nvim.

tjdevries avatar tjdevries commented on August 13, 2024

maybe it's out of memory? how many files are getting stored? where are you running it from?

from plenary.nvim.

Shatur avatar Shatur commented on August 13, 2024

maybe it's out of memory? how many files are getting stored? where are you running it from?

Tried different folders even with one text file, the result is the same.

Maybe I can try running other examples to see which part of Plenary is crashing? Like with uv.spawn.

from plenary.nvim.

Shatur avatar Shatur commented on August 13, 2024

The issue was in repgrep itself, check nvim-pack/nvim-spectre#5 (comment)

from plenary.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.