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 while trying to bulk delete #542

Open
alejodelosrios opened this issue Jan 14, 2025 · 2 comments
Open

Crash while trying to bulk delete #542

alejodelosrios opened this issue Jan 14, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@alejodelosrios
Copy link

Describe the bug
When you select several files and press Ctrl + d for deleting them, app crashes.

To Reproduce
Steps to reproduce the behavior:

  1. Press V
  2. Press Shift + Up or Shift + Down to select some files for deleting
  3. Press Ctrl + d
  4. See error

Expected behavior
App is going to crash

Log
Caught panic:

runtime error: invalid memory address or nil pointer dereference

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:26 +0x64
runtime/debug.PrintStack()
runtime/debug/stack.go:18 +0x1c
github.com/charmbracelet/bubbletea.(*Program).recoverFromPanic(0x140001a6000)
github.com/charmbracelet/[email protected]/tea.go:705 +0x84
panic({0x10378ab80?, 0x103d41630?})
runtime/panic.go:785 +0x124
github.com/yorukot/superfile/src/internal.returnFolderElement.func3(0x40?, 0x0)
github.com/yorukot/superfile/src/internal/function.go:108 +0x9c
sort.partition_func({0x140006ca410?, 0x1400011e540?}, 0x0, 0x54, 0x140006ca208?)
sort/zsortfunc.go:157 +0x1d0
sort.pdqsort_func({0x140006ca410?, 0x1400011e540?}, 0x14000430018?, 0x0?, 0x0?)
sort/zsortfunc.go:114 +0x1b0
sort.Slice({0x10374b920?, 0x14000430018?}, 0x140006ca410)
sort/slice.go:29 +0xb8
github.com/yorukot/superfile/src/internal.returnFolderElement({0x14000500960, 0x1f}, 0x0, {{0x14000330fc0, 0x3, 0x3}, 0x2, 0x0})
github.com/yorukot/superfile/src/internal/function.go:112 +0x214
github.com/yorukot/superfile/src/internal.(*model).getFilePanelItems(0x140006d8fb8)
github.com/yorukot/superfile/src/internal/model.go:413 +0x304
github.com/yorukot/superfile/src/internal.model.Update({{{0x14000232008, 0x1, 0x1}, 0xa9, 0x0, 0x8, {0x1, 0xa7}}, {{0x14000583a40, 0xc, ...}, ...}, ...}, ...)
github.com/yorukot/superfile/src/internal/model.go:76 +0x620
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0x140001a6000, {0x103833c78?, 0x14000234a88?}, 0x14000110310)
github.com/charmbracelet/[email protected]/tea.go:461 +0x6a8
github.com/charmbracelet/bubbletea.(*Program).Run(0x140001a6000)
github.com/charmbracelet/[email protected]/tea.go:595 +0x8cc
github.com/yorukot/superfile/src/cmd.Run.func2(0x140003c1a40)
github.com/yorukot/superfile/src/cmd/main.go:92 +0x1a4
github.com/urfave/cli/v2.(*Command).Run(0x140001da580, 0x140003c1a40, {0x14000142130, 0x1, 0x1})
github.com/urfave/cli/[email protected]/command.go:276 +0x600
github.com/urfave/cli/v2.(*App).RunContext(0x140001aa200, {0x1038347a0, 0x103e49860}, {0x14000142130, 0x1, 0x1})
github.com/urfave/cli/[email protected]/app.go:333 +0x51c
github.com/urfave/cli/v2.(*App).Run(...)
github.com/urfave/cli/[email protected]/app.go:307
github.com/yorukot/superfile/src/cmd.Run({0x103d6d9b8?})
github.com/yorukot/superfile/src/cmd/main.go:105 +0x3f4
main.main()
github.com/yorukot/superfile/main.go:15 +0x24

System information (please complete the following information):

  • OS: MacOS Sequoia
  • Version 15.1.1 (24B91)
  • superfile Version 1.1.7.1
@alejodelosrios alejodelosrios added the bug Something isn't working label Jan 14, 2025
@lazysegtree
Copy link

lazysegtree commented Jan 22, 2025

@alejodelosrios Could not reproduce it. Tried these environments. Any tips on how can I reproduce it ?
@yorukot Were you able to reproduce it ?

MacOS Sonoma (14.7.1(23H222))

➜  ~ [11:38:07] spf --version
superfile version v1.1.7.1
➜  ~ [11:38:08] uname -a
Darwin kuknitin-mac 23.6.0 Darwin Kernel Version 23.6.0: Thu Sep 12 23:35:29 PDT 2024; root:xnu-10063.141.1.701.1~1/RELEASE_ARM64_T6000 arm64
➜  ~ [11:38:14]

Oracle Linux 8

[opc@test-client-hyd-1 tempf]$ spf --version
superfile version v1.1.7.1
[opc@test-client-hyd-1 tempf]$ uname -a
Linux test-client-hyd-1 5.15.0-210.163.7.el8uek.x86_64 #2 SMP Tue Sep 10 18:31:09 PDT 2024 x86_64 x86_64 x86_64 GNU/Linux
[opc@test-client-hyd-1 tempf]$
superfile_bulk_del.mp4

@alejodelosrios
Copy link
Author

Hi @lazysegtree, I tried the same as you creating a new folder with some example files. It worked!!!!. But, when I try again from my Downloads folder it crashes.

I don't understand why but happens. Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Bug
Development

No branches or pull requests

2 participants