aristocratos / bashtop

Linux/OSX/FreeBSD resource monitor
Apache License 2.0
10.79k stars 552 forks source link

Error log filling up with same 4 syntax errors #150

Closed g-dg closed 4 years ago

g-dg commented 4 years ago

Describe the bug

The error log (~/.config/bashtop/error.log) is filling up with what appears to be the same 4 syntax errors.

To Reproduce

Run Bashtop with error logging enabled and the error log gets filled up with the same 4 errors.

Expected behavior

I expected there to be no errors in the log or at least the error log to not fill up my hard drive.

Screenshots

N/A

Info (please complete the following information):

Additional context

contents of $HOME/.config/bashtop/error.log (Note that this is just the first few lines due to the file being several GB of the same error message.)


New instance of bashtop version: 0.9.15 Pid: 22378
/home/garnetdegelder/bin/bashtop: line 1377: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1387: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1393: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1374: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1377: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1387: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1393: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1374: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1377: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1387: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1393: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1374: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1377: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1387: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1393: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1374: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1377: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1387: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1393: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1374: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1377: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1387: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
/home/garnetdegelder/bin/bashtop: line 1393: ((: Pid: Program:       Arguments:                                               Threads: User:    Mem%       Cpu%: syntax error in expression (error token is ": Program:       Arguments:                                               Threads: User:    Mem%       Cpu%")
aristocratos commented 4 years ago

Can you post a screenshot of bashtop running? By the looks of the error messages the processes shouldn't be displaying correctly. I can add some error checks to the create_graph() function where the errors are picked up, but I doubt it would fix the underlying issue, and I'm not sure what the cause is.

If you don't mind, you could also run bashtop --debug but not for more than 5 seconds then CTRL-C. It will create a file named tracing.log in config dir, but it will get really big if run for more than a couple of seconds since it's logging every command in the script. And then post it here or mail it to admin@qvantnet.com, whatever you're comfortable with. That would allow me to see exactly what's going wrong.

g-dg commented 4 years ago

I've noticed in my further testing that this issue is actually really hard to reproduce. My latest test that caused the issue was to run it and resize the terminal window several times a minute. One of the times I resized the window, it froze and started filling up the error log. Since then, I haven't been able to reproduce it using any similar techniques.

Screenshots:

Running normally, even after a bunch of tests where I tried to reproduce the issue: Screenshot

Unfortunately, I did not think to take a screenshot of the time when it last had the issue, but it looked just like normal, except the entire bottom 3rd or so of the screen was cut off and just blank (likely due to me resizing just before).

Config:

In case it helps, this is the contents of the config file when the issue happened:

#? Config file for bashtop v. 0.9.15

#* Color theme, looks for a .theme file in "$HOME/.config/bashtop/themes" and "$HOME/.config/bashtop/user_themes", "Default" for builtin default theme
color_theme="Default"

#* Update time in milliseconds, increases automatically if set below internal loops processing time, recommended 2000 ms or above for better sample times for graphs
update_ms="5000"

#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu responsive"
#* "cpu lazy" updates sorting over time, "cpu responsive" updates sorting directly
proc_sorting="cpu lazy"

#* Reverse sorting order, "true" or "false"
proc_reversed="false"

#* Show processes as a tree
proc_tree="false"

#* Check cpu temperature, only works if "sensors", "vcgencmd" or "osx-cpu-temp" commands is available
check_temp="true"

#* Draw a clock at top of screen, formatting according to strftime, empty string to disable
draw_clock="%X"

#* Update main ui when menus are showing, set this to false if the menus is flickering too much for comfort
background_update="true"

#* Custom cpu model name, empty string to disable
custom_cpu_name=""

#* Enable error logging to "$HOME/.config/bashtop/error.log", "true" or "false"
error_logging="true"

#* Show color gradient in process list, "true" or "false"
proc_gradient="true"

#* If process cpu usage should be of the core it's running on or usage of the total available cpu power
proc_per_core="true"

#* Optional filter for shown disks, should be names of mountpoints, "root" replaces "/", separate multiple values with space
disks_filter=""

#* Enable check for new version from github.com/aristocratos/bashtop at start
update_check="true"

#* Enable graphs with double the horizontal resolution, increases cpu usage
hires_graphs="false"

#* Enable the use of psutil python3 module for data collection, default on OSX
use_psutil="true"

Debug Info

I will email the debug info. However, note that the issue did not seem to occur at this time (i.e. the error log did not get errors in it).

These test were run in v0.9.15 (bd83b73). I will be updating to the current version for further tests.

aristocratos commented 4 years ago

It wasn't clear that issue wasn't happening at every launch. The debug run would only be helpful if the issue was consistent. I've added a error check in the graph function which should prevent it from getting into a infinite loop. Regarding the error.log size, the file gets cut down to 500 lines if longer than that at start so shouldn't be able to grow to GB sizes unless left in a broken state for a long time. And by your description the issue doesn't seem to occur without user interaction. So shouldn't be a problem after v0.9.16.

I will close this for now, but if happens again and you can reopen the issue.

mrsimoes commented 1 year ago

Something similar still on 0.9.25 The same four lines over and over:

/snap/bashtop/504/usr/bin/bashtop: line 1334: ((: .0 : syntax error: operand expected (error token is ".0 ") /snap/bashtop/504/usr/bin/bashtop: line 1337: ((: .0 : syntax error: operand expected (error token is ".0 ") /snap/bashtop/504/usr/bin/bashtop: line 1347: ((: .0 : syntax error: operand expected (error token is ".0 ") /snap/bashtop/504/usr/bin/bashtop: line 1353: ((: .0 : syntax error: operand expected (error token is ".0 ")