p5quared / decanter

CLI for UB Autolab... Decan't you see why that's awesome?
MIT License
3 stars 1 forks source link

BUG: Segmentation Fault on Submission #4

Open p5quared opened 4 months ago

p5quared commented 4 months ago

There appears to be a bug with submissions; not entirely sure what the cause is.

Possibly involves huh.Spinnner().

> decanter submit -c cse486-s24 -a PA2-k-DHT-Part-1-Routing -f kdht.tar -w                                                  

Submitting kdht.tar to PA2-k-DHT-Part-1-Routing...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x10 pc=0x10522661c]

goroutine 2 [running]:
github.com/p5quared/decanter/Autolab.SubmitFile(0x1400012cbd0, {0x105274b5a?, 0x0?}, {0x16ae4752b, 0xa}, {0x16ae47539, 0x18}, {0x16ae47555, 0x8})
    /Users/petervaiciulis/code/decanter/Autolab/user.go:94 +0x2fc
main.main.func1()
    /Users/petervaiciulis/code/decanter/main.go:160 +0x58
github.com/charmbracelet/huh/spinner.(*Spinner).Run.func1()
    /Users/petervaiciulis/go/pkg/mod/github.com/charmbracelet/huh/spinner@v0.0.0-20240209193029-45947515c4cf/spinner.go:148 +0x30
created by github.com/charmbracelet/huh/spinner.(*Spinner).Run in goroutine 1
    /Users/petervaiciulis/go/pkg/mod/github.com/charmbracelet/huh/spinner@v0.0.0-20240209193029-45947515c4cf/spinner.go:147 +0x104
p5quared commented 2 months ago

Can anyone reproduce this? If you're going to submit a bug, it is really helpful if you would share the steps to reproduce the bug as well.

p5quared commented 2 months ago

I believe it happens in this case:

  1. Auto-complete a filename in a command
  2. Modify the file elsewhere
  3. Run command

I believe it that the file before modification is somehow being referenced. I thought that files were just referenced by their name??