Package: xosview
Version: 1.18-1
Severity: normal

Hello,

Now that GNU/Hurd supports >2G memory, xosview needs to be fixed :)

The attached patch turns the page count into double before multiplying
by the page size, to avoid being truncated by the 32bit size of the page
count.

Samuel

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 
'testing-debug'), (500, 'buildd-unstable'), (500, 'unstable'), (500, 'stable'), 
(500, 'oldstable'), (1, 'experimental-debug'), (1, 'buildd-experimental'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.8.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages xosview depends on:
ii  libc6       2.24-5
ii  libgcc1     1:7-20161112-1
ii  libstdc++6  7-20161112-1
ii  libx11-6    2:1.6.3-1
ii  libxpm4     1:3.5.11-1+b1

Versions of packages xosview recommends:
ii  xfonts-base  1:1.0.4+nmu1

xosview suggests no packages.

-- no debconf information

-- 
Samuel
/* Halley */

        (Halley's comment.)
Index: xosview-1.18/gnu/memmeter.cc
===================================================================
--- xosview-1.18.orig/gnu/memmeter.cc
+++ xosview-1.18/gnu/memmeter.cc
@@ -52,10 +52,10 @@ void MemMeter::getmeminfo( void ){
     return;
   }
 
-  fields_[0] = vmstats.active_count * vmstats.pagesize;
-  fields_[1] = vmstats.inactive_count * vmstats.pagesize;;
-  fields_[2] = vmstats.wire_count * vmstats.pagesize;;
-  fields_[3] = vmstats.free_count * vmstats.pagesize;;
+  fields_[0] = (double) vmstats.active_count * vmstats.pagesize;
+  fields_[1] = (double) vmstats.inactive_count * vmstats.pagesize;;
+  fields_[2] = (double) vmstats.wire_count * vmstats.pagesize;;
+  fields_[3] = (double) vmstats.free_count * vmstats.pagesize;;
   total_ = fields_[0] + fields_[1] + fields_[2] + fields_[3];
 
   FieldMeterDecay::setUsed (total_ - fields_[3], total_);

Reply via email to