Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

panic: runtime error: invalid memory address or nil pointer dereference #41

Closed
edn9 opened this issue Jul 2, 2018 · 14 comments
Closed
Labels
bug Something isn't working

Comments

@edn9
Copy link

edn9 commented Jul 2, 2018

Hi dev! So, I just updated my distro and this bug happen with gotop:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x50f86f]

goroutine 12 [running]:
github.com/cjbassi/gotop/src/widgets.(*Disk).update(0xc42000d2c0)
/home/cjbassi/go/src/github.com/cjbassi/gotop/src/widgets/disk.go:90 +0x66f
github.com/cjbassi/gotop/src/widgets.NewDisk(0x0)
/home/cjbassi/go/src/github.com/cjbassi/gotop/src/widgets/disk.go:42 +0x195
main.initWidgets.func5()
/home/cjbassi/go/src/github.com/cjbassi/gotop/main.go:214 +0x22
created by main.initWidgets
/home/cjbassi/go/src/github.com/cjbassi/gotop/main.go:213 +0xda

Looks like its the same bug that happen with this guy: #39
Heres my distro info:
Linux 4.14.52-1-MANJARO #1 SMP PREEMPT Tue Jun 26 15:24:31 UTC 2018 x86_64 GNU/Linux
Shell: bash
Terminal: urxvt
I have tmux but im not using it to see gotop.
gotop version 1.4.0.

Do I need to change the gotop code or inform manjaro devs?

@edn9
Copy link
Author

edn9 commented Jul 3, 2018

And now its simple running ok.
What.

@cjbassi cjbassi added the bug Something isn't working label Jul 15, 2018
@cjbassi
Copy link
Owner

cjbassi commented Jul 15, 2018

Huh that's strange. Did you do anything different when it worked? And is it still working?

@edn9
Copy link
Author

edn9 commented Jul 16, 2018

I just updated my distro lol sudo pacman -Syyuu. Also I got the error again yesterday, I was so confused, I did the reboot and then the bug was gone.

@cjbassi
Copy link
Owner

cjbassi commented Jul 16, 2018

So like the issue the other guy is having too, it looks to be an issue with Disk information. Can you run lsblk and copy the output here?

@edn9
Copy link
Author

edn9 commented Jul 17, 2018

Sure!

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 698,7G 0 disk
├─sda1 8:1 0 100M 0 part
├─sda2 8:2 0 360,9G 0 part
└─sda3 8:3 0 337,7G 0 part /
sr0 11:0 1 1024M 0 rom
zram0 254:0 0 973,9M 0 disk [SWAP]

@cjbassi
Copy link
Owner

cjbassi commented Jul 18, 2018

Just pushed some changes that fixed the issue for me, so if you could update and let me know if you have any more issues that would be great.

@cjbassi cjbassi closed this as completed Jul 21, 2018
@edn9
Copy link
Author

edn9 commented Jul 21, 2018

So, I dont know if this bug still on, because I dont get the issue anymore haha, but thank you for the work!

@cjbassi
Copy link
Owner

cjbassi commented Jul 21, 2018

Sorry, just went ahead and closed this, but it should be fixed! It was caused by mounting a disk drive somewhere so that there was a space in the mount path. If you've updated then you're good.

@Arcandres
Copy link

Same error, If I umount my external drive It works normally.
Arch Linux 4.18.16
Gotop 1.5.0

@cjbassi
Copy link
Owner

cjbassi commented Nov 15, 2018

@Arcandres Can you give me the output of lsblk with your drive mounted, the name of your drive, and any other info you can? The more info the better, like drive type (usb vs external disk) etc.

@Arcandres
Copy link

@Arcandres Can you give me the output of lsblk with your drive mounted, the name of your drive, and any other info you can? The more info the better, like drive type (usb vs external disk) etc.

Yeah, the problem is with the partition name.

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 111.8G  0 disk 
└─sda1   8:1    0 111.8G  0 part /
sdb      8:16   0 465.8G  0 disk 
├─sdb1   8:17   0 195.3G  0 part 
└─sdb2   8:18   0 269.5G  0 part /run/media/arcandres/Games & Software

Once I changed it, It works fine.

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 111.8G  0 disk 
└─sda1   8:1    0 111.8G  0 part /
sdb      8:16   0 465.8G  0 disk 
├─sdb1   8:17   0 195.3G  0 part 
└─sdb2   8:18   0 269.5G  0 part /run/media/arcandres/Software

@cjbassi
Copy link
Owner

cjbassi commented Nov 15, 2018

So it's either an issue with the spaces, the ampersand, or a combination of the two. Can you try playing around with different mountpoint names and seeing which one it is?

cjbassi added a commit that referenced this issue Nov 15, 2018
@cjbassi
Copy link
Owner

cjbassi commented Nov 15, 2018

I tested this myself and confirmed that it was the space character again. I had thought this was fixed by the dependency causing the issue but apparently not, so I just re-added the fix that I applied last time and created a new release, but it should be working now.

@Arcandres
Copy link

Yeah, now It is working even with spaces in the partition name.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants