Package: uswsusp
Version: 1.0+20110509-2
Severity: normal

The configuration file generated after the first install contains this line:

image size = 2.86942e+09

which is bogus (the program expects an unsigned int, so the value is truncated).
This is generated in uswsusp.config:55 by:

IMAGESIZE=`awk '$1 == "MemTotal:" {print int($2*1024*0.46)}' /proc/meminfo 2> 
/dev/null`

My system has 6GB of RAM:

$ grep MemTotal /proc/meminfo
MemTotal:        6091988 kB

So the expression overflows the 'int' and is printed as floating point.
The following statement outputs an integer, but the result is somewhat off
(maybe it gets truncated internally):

awk '$1 == "MemTotal:" {printf("%lu\n", $2*1024*0.46)}' /proc/meminfo

The shell (I've tried both dash and bash) is able to compute the correct value,
like this:

IMAGESIZE=$((`awk '$1 == "MemTotal:" {print $2}' /proc/meminfo` * 1024 / 100 * 
46))

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (600, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.4.0 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages uswsusp depends on:
ii  debconf [debconf-2.0]  1.5.43
ii  libc6                  2.13-33
ii  libgcrypt11            1.5.0-3
ii  liblzo2-2              2.06-1
ii  libpci3                1:3.1.9-3
ii  libx86-1               1.1+ds1-9

Versions of packages uswsusp recommends:
ii  initramfs-tools  0.106
ii  mount            2.20.1-5

uswsusp suggests no packages.

-- debconf information:
  uswsusp/compute_checksum: false
  uswsusp/no_snapshot:
  uswsusp/suspend_loglevel:
  uswsusp/no_swap:
  uswsusp/resume_offset:
  uswsusp/early_writeout: true
  uswsusp/image_size: 2.86942e+09
  uswsusp/compress: true
  uswsusp/create_RSA_key: false
  uswsusp/snapshot_device:
  uswsusp/RSA_key_file: /etc/uswsusp.key
  uswsusp/max_loglevel:
  uswsusp/resume_device: /dev/dm-1
  uswsusp/shutdown_method: platform
  uswsusp/encrypt: false
  uswsusp/splash: true
  uswsusp/RSA_key_bits: 1024
  uswsusp/continue_without_swap: true



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to