Canop / dysk

A linux utility to get information on filesystems, like df but better
https://dystroy.org/dysk
MIT License
890 stars 25 forks source link

panic error when drive is full #26

Closed daniejstriata closed 2 years ago

daniejstriata commented 2 years ago

Hi,

I got this error on what I believe was a full drive.

thread 'main' panicked at 'index out of bounds: the len is 10 but the index is 10', /cargo/registry/src/github.com-1ecc6299db9ec823/termimad-0.17.0/src/tbl.rs:214:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Growing drive took the error away. Setting backtrace did not make any difference.

Canop commented 2 years ago

Were you running lfs in a very thin terminal ?

daniejstriata commented 2 years ago

@Canop no. It was a normal ssh session. I load lfs from my motd.sh inside /etc/profile.d/

Canop commented 2 years ago

I'm puzzled there. I have no idea how this can happen.

Can you check the version of lfs you're using ?

daniejstriata commented 2 years ago

It is on 1.3.0. The only thing wrong / different here was that the one drive was full. When I grew the disk lfs worked again.

Stargateur commented 2 years ago

The only thing that could come to my mind to explain this with a full drive is linux not being able to correctly answer api call for the fd of the virtual console, or ssh who need to handle it but fail if disk is full for the same reason. But that a random guess.

Canop commented 2 years ago

The error is in Termimad. And I just notice the version of termimad included in lfs is quite old. I thought I had updated the dependency but it seems I forgot.

It seems impossible to have an error on this line, though: https://github.com/Canop/termimad/blob/3c143bddefa20988f621beb78256ce7c775ce1d1/src/tbl.rs#L214

Canop commented 2 years ago

@daniejstriata Please, what were the launch arguments ?

daniejstriata commented 2 years ago

I added the binary output. lfs --units binary

Canop commented 2 years ago

As I removed that section of code, I declare the bug "solved".