OverflowError when machine suspends and resumes after a longer while

Bug #1866619 reported by Zygmunt Krynicki
42
This bug affects 9 people
Affects Status Importance Assigned to Milestone
dstat (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I was running dstat and suspended my laptop. After a longer while (day) I opened the lid and saw dstat crashed on OverflowError.

  2 1 97 0 0| 0 80k| 0 0 | 0 0 | 477 1395 Traceback (most recent call last):
  File "/usr/bin/dstat", line 2842, in <module>
    main()
  File "/usr/bin/dstat", line 2687, in main
    scheduler.run()
  File "/usr/lib/python3.8/sched.py", line 151, in run
    action(*argument, **kwargs)
  File "/usr/bin/dstat", line 2799, in perform
    line = line + o.show() + o.showend(totlist, vislist)
  File "/usr/bin/dstat", line 519, in show
    line = line + cprintlist(self.val[name], ctype, self.width, scale)
  File "/usr/bin/dstat", line 2087, in cprintlist
    ret = ret + sep + cprint(var, ctype, width, scale)
  File "/usr/bin/dstat", line 2137, in cprint
    ret, c = dchg(var, width, base)
  File "/usr/bin/dstat", line 2037, in dchg
    ret = str(int(round(var)))
OverflowError: cannot convert float infinity to integer

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: dstat 0.7.4-4
ProcVersionSignature: Ubuntu 5.4.0-14.17-generic 5.4.18
Uname: Linux 5.4.0-14-generic x86_64
ApportVersion: 2.20.11-0ubuntu18
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Mon Mar 9 12:46:58 2020
Dependencies: python3-six 1.14.0-2
InstallationDate: Installed on 2020-01-09 (59 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Alpha amd64 (20200106)
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=pl_PL.UTF-8
 SHELL=/bin/bash
SourcePackage: dstat
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Zygmunt Krynicki (zyga) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dstat (Ubuntu):
status: New → Confirmed
Revision history for this message
rojer (rojer9) wrote :

Happens quite often on Focal for me.

Revision history for this message
Jimmy Engelbrecht (jimmy927) wrote :

This happens to me all the time, can barely use the tool as it is now.
happens on AMD EPYC 7502P 32-Core Processor with high load.

Revision history for this message
Jimmy Engelbrecht (jimmy927) wrote :

This will solve the issue:

--- /usr/bin/dstat.orig 2020-06-05 08:54:42.376561626 +0200
+++ /usr/bin/dstat 2020-06-05 09:05:08.316386102 +0200
@@ -2034,6 +2034,8 @@
     "Convert decimal to string given base and length"
     c = 0
     while True:
+ if var == float('inf'):
+ return 'Inf', c
         ret = str(int(round(var)))
         if len(ret) <= width:
             break
@@ -2168,10 +2170,13 @@

     ### Add unit to output
     if unit:
- if c != -1 and round(var) != 0:
- ret += cunit + units[c]
- else:
- ret += char['space']
+ try:
+ if c != -1 and round(var) != 0:
+ ret += cunit + units[c]
+ else:
+ ret += char['space']
+ except OverflowError:
+ pass

     return ret

It will produce output like this:

usr sys idl wai stl| read writ| recv send| in out | int csw
 11 3 86 0 0|1407B 1294k| 0 0 | 0 0 | 26k 59k
 44 8 48 0 0| 0 6176k|3442k 5642k| 0 0 | 70k 243k
 36 7 57 0 0| 0 2768k|1533k 2351k| 0 0 | 58k 206k
 34 7 59 0 0| 0 14M|3895k 5211k| 0 0 | 63k 210k
 28 7 66 0 0| 0 16M|3484k 5652k| 0 0 | 61k 184k
 27 5 68 0 0| 0 2848k|1648k 2375k| 0 0 | 54k 177k
 36 7 58 0 0| 0 1480k|1637k 2267k| 0 0 | 63k 220k
 34 7 60 0 0| 0 2856k|1375k 1936k| 0 0 | 56k 213k
 35 7 57 0 0| 0 51M| 836k 1084k| 0 0 | 57k 237k
 36 7 57 0 0| 0 1000k| 884k 1159k| 0 0 | 52k 237k
 35 7 58 0 0| 0 2136k|1157k 1686k| 0 0 | 55k 233k
 38 8 54 0 0| 0 2208k|1046k 1468k| 0 0 | 56k 240k
 39 8 53 0 0| 0 2264k|5581k 10M| 0 0 | 61k 244k
 38 9 54 0 0| 0 6592k| 34M 63M| 0 0 | 63k 245k
 23 51 25 0 0| 0 19M|1787k 1000k| 0 0 | 201k 241k
 20 4 76 0 0| 0 4592k| 12M 4517k| 0 0 | 55k 111k
 15 3 82 0 0| 0 2632k| 12M 3742k| 0 0 | 52k 113k
 16 2 82 0 0| 0 1796k| 12M 3586k| 0 0 | 56k 100k
 16 3 81 0 0| 0 28M|8235k 1948k| 0 0 | 58k 106k
 17 3 80 0 0| 0 4496k| 15M 4639k| 0 0 | 53k 127k
 19 11 70 0 0| 0 4712k|9915k Inf| 0 0 | 53k 134k
 22 6 72 0 0| 0 8672k| Inf Inf| 0 0 | 57k 163k
 18 4 78 0 0| 0 11M| Inf Inf| 0 0 | 55k 126k
 13 4 83 0 0| 0 8672k| Inf Inf| 0 0 | 54k 122k
 14 4 82 0 0| 0 9056k| Inf Inf| 0 0 | 55k 127k
 13 3 84 0 0| 0 8960k| Inf Inf| 0 0 | 57k 101k
 17 4 80 0 0| 0 8360k| Inf Inf| 0 0 | 55k 127k
 29 23 48 0 0| 0 40M| 437k 1027k| 0 0 | 132k 413k
 29 8 63 0 0| 0 3952k|1790k 1617k| 0 0 | 74k 219k
 42 12 47 0 0| 0 9368k|3705k 6440k| 0 0 | 83k 239k
 50 10 40 0 0| 0 8160k|2555k 2673k| 0 0 | 74k 204k

Revision history for this message
Jimmy Engelbrecht (jimmy927) wrote :

It will produce output like this:

usr sys idl wai stl| read writ| recv send| in out | int csw
 11 3 86 0 0|1407B 1294k| 0 0 | 0 0 | 26k 59k
 44 8 48 0 0| 0 6176k|3442k 5642k| 0 0 | 70k 243k
 36 7 57 0 0| 0 2768k|1533k 2351k| 0 0 | 58k 206k
 34 7 59 0 0| 0 14M|3895k 5211k| 0 0 | 63k 210k
 28 7 66 0 0| 0 16M|3484k 5652k| 0 0 | 61k 184k
 27 5 68 0 0| 0 2848k|1648k 2375k| 0 0 | 54k 177k
 36 7 58 0 0| 0 1480k|1637k 2267k| 0 0 | 63k 220k
 34 7 60 0 0| 0 2856k|1375k 1936k| 0 0 | 56k 213k
 35 7 57 0 0| 0 51M| 836k 1084k| 0 0 | 57k 237k
 36 7 57 0 0| 0 1000k| 884k 1159k| 0 0 | 52k 237k
 35 7 58 0 0| 0 2136k|1157k 1686k| 0 0 | 55k 233k
 38 8 54 0 0| 0 2208k|1046k 1468k| 0 0 | 56k 240k
 39 8 53 0 0| 0 2264k|5581k 10M| 0 0 | 61k 244k
 38 9 54 0 0| 0 6592k| 34M 63M| 0 0 | 63k 245k
 23 51 25 0 0| 0 19M|1787k 1000k| 0 0 | 201k 241k
 20 4 76 0 0| 0 4592k| 12M 4517k| 0 0 | 55k 111k
 15 3 82 0 0| 0 2632k| 12M 3742k| 0 0 | 52k 113k
 16 2 82 0 0| 0 1796k| 12M 3586k| 0 0 | 56k 100k
 16 3 81 0 0| 0 28M|8235k 1948k| 0 0 | 58k 106k
 17 3 80 0 0| 0 4496k| 15M 4639k| 0 0 | 53k 127k
 19 11 70 0 0| 0 4712k|9915k Inf| 0 0 | 53k 134k
 22 6 72 0 0| 0 8672k| Inf Inf| 0 0 | 57k 163k
 18 4 78 0 0| 0 11M| Inf Inf| 0 0 | 55k 126k
 13 4 83 0 0| 0 8672k| Inf Inf| 0 0 | 54k 122k
 14 4 82 0 0| 0 9056k| Inf Inf| 0 0 | 55k 127k
 13 3 84 0 0| 0 8960k| Inf Inf| 0 0 | 57k 101k
 17 4 80 0 0| 0 8360k| Inf Inf| 0 0 | 55k 127k
 29 23 48 0 0| 0 40M| 437k 1027k| 0 0 | 132k 413k
 29 8 63 0 0| 0 3952k|1790k 1617k| 0 0 | 74k 219k
 42 12 47 0 0| 0 9368k|3705k 6440k| 0 0 | 83k 239k
 50 10 40 0 0| 0 8160k|2555k 2673k| 0 0 | 74k 204k

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Riccardo Pittau (rpittau) wrote :
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Someone with upload access just needs to apply the patch and send it upstream.

Revision history for this message
Luiz Fernando (ryche.rising) wrote :

As of 2021/02/11, dstat is still spitting this error.

Revision history for this message
yurij (yurijvs) wrote :

yeah, it's so difficult to fix it with exiting patch file more than 10 month.

Revision history for this message
Jim Kleckner (jek-ubuntu) wrote :

I manually applied this and it worked fine, thanks.

It is worth noting that the upstream package has been archived [1]:

From [1]:

DSTAT development has been terminated

Due to actions taken by RedHat to hijack the DSTAT name, further development of this project has ceased. Development of this project is taking place on the Dool fork [2].

So long and thanks for all the fish

[1] https://github.com/dstat-real/dstat

[2] https://github.com/scottchiefbaker/dool

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Patches

Remote bug watches

Bug watches keep track of this bug in other bug trackers.