Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when searching on a mounted drive (WSL) #551

Open
PratyushBalaji opened this issue Jan 22, 2025 · 3 comments
Open

Crash when searching on a mounted drive (WSL) #551

PratyushBalaji opened this issue Jan 22, 2025 · 3 comments
Labels
bug Something isn't working cant reproduce crash Superfile encountered a crash help wanted Extra attention is needed OS-Windows-WSL Issue is related to using superfile in WSL in windows only

Comments

@PratyushBalaji
Copy link

Description
When attempting to search with the / command on the /mnt/c, any character press immediately triggers a crash
Search on any other drive works, searching on subfolders of /mnt/c also works, although it is extremely slow. Navigation on /mnt/c is extremely laggy.

To Reproduce

  1. Hit s and navigate to disk c
  2. Hit /
  3. Type any character
  4. See error

Expected behavior
Working search behaviour like on every other disk

Screenshots

Image
Search on /mnt/c

Image
Crash log

System information

  • OS: Ubuntu on WSL (Windows 11)
  • WSL 2, Ubuntu-22.04
  • superfile version v1.1.7.1
    (superfile installed using bash -c "$(curl -sLo- https://superfile.netlify.app/install.sh)")

Terminal output

Caught panic:

runtime error: invalid memory address or nil pointer dereference

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
        /usr/lib/golang/src/runtime/debug/stack.go:24 +0x5e
runtime/debug.PrintStack()
        /usr/lib/golang/src/runtime/debug/stack.go:16 +0x13
github.com/charmbracelet/bubbletea.(*Program).recoverFromPanic(0xc00014c500)
        /home/yorukot/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:705 +0x91
panic({0xd2c1c0?, 0x179bda0?})
        /usr/lib/golang/src/runtime/panic.go:770 +0x132
github.com/yorukot/superfile/src/internal.returnFolderElementBySearchString({0xc00012f1a1, 0x6}, 0x0, {0xc0009056b8, 0x1})
        /home/yorukot/Documents/code/superfile/src/internal/function.go:153 +0x1cd
github.com/yorukot/superfile/src/internal.(*model).getFilePanelItems(0xc0007f0f80)
        /home/yorukot/Documents/code/superfile/src/internal/model.go:411 +0x31e
github.com/yorukot/superfile/src/internal.model.Update({{{0xc000144008, 0x1, 0x1}, 0x31, 0x0, 0x2, {0x1, 0x2f}}, {{0xc00046e000, 0x9, ...}, ...}, ...}, ...)
        /home/yorukot/Documents/code/superfile/src/internal/model.go:76 +0x5f2
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0xc00014c500, {0x11d8d30?, 0xc000146a88?}, 0xc00008a480)
        /home/yorukot/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:461 +0x810
github.com/charmbracelet/bubbletea.(*Program).Run(0xc00014c500)
        /home/yorukot/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:595 +0xaad
github.com/yorukot/superfile/src/cmd.Run.func2(0xc00046ba80)
        /home/yorukot/Documents/code/superfile/src/cmd/main.go:92 +0x290
github.com/urfave/cli/v2.(*Command).Run(0xc000222580, 0xc00046ba80, {0xc000022090, 0x1, 0x1})
        /home/yorukot/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:276 +0x97d
github.com/urfave/cli/v2.(*App).RunContext(0xc000154200, {0x11d9910, 0x18306e0}, {0xc000022090, 0x1, 0x1})
        /home/yorukot/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:333 +0x5a5
github.com/urfave/cli/v2.(*App).Run(...)
        /home/yorukot/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:307
github.com/yorukot/superfile/src/cmd.Run({0xc0000061c0?})
        /home/yorukot/Documents/code/superfile/src/cmd/main.go:105 +0x41c
main.main()
        /home/yorukot/Documents/code/superfile/main.go:15 +0x1a
@PratyushBalaji PratyushBalaji added the bug Something isn't working label Jan 22, 2025
@lazysegtree
Copy link
Collaborator

lazysegtree commented Jan 22, 2025

I went through src/internal.returnFolderElementBySearchString function that crashes. Couldn't find anything obvious that could cause slowness and crash. Since there are just 20 file + directories in /mnt/c, there shouldn't be any concern of slowness. The call to os.ReadDir() should be quick (it doesn't do recursive read), and fuzzy search should be quick too because the hayStack has only 20 items

This is quite strange.

@PratyushBalaji

  • Can you provide list of all 20 files in /mnt/c .
  • Can you run superfile in your windows powershell ( in windows environment, not in WSL ). Then navigate to C:\ in superfile. Try to perform search and see if it crashes or not.

@lazysegtree
Copy link
Collaborator

@PratyushBalaji Can you also share superfile logs ?
Should be in ~/.local/state/superfile/superfile.log

@PratyushBalaji
Copy link
Author

No lag or crash issues when using the powershell superfile. Even with extremely large directories with many files. The lag only seems to occur on the mounted disks on wsl. Other directories (included /mnt) on wsl and any directory on windows work perfectly fine.

log file

@lazysegtree lazysegtree added help wanted Extra attention is needed crash Superfile encountered a crash cant reproduce OS-Windows-WSL Issue is related to using superfile in WSL in windows only labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cant reproduce crash Superfile encountered a crash help wanted Extra attention is needed OS-Windows-WSL Issue is related to using superfile in WSL in windows only
Projects
None yet
Development

No branches or pull requests

2 participants