← Back to team overview

kernel-packages team mailing list archive

[Bug 1215513] Re: System locks up, requires hard reset

 

Posts #51 and #53 are wrong: this bug is NOT FIXED in either 3.2.0-54.82
or 3.8.0-31.46 from the 12.04 (precise) repositories. There might be
something fixed about zram in there (as suggested by the changelog), but
the last sector of /dev/zram0 is still bad (as reported in #43), and
this will lead to crashes if /dev/zram0 is used 'blindly' to create a
swap partition.

NOTE1: Before all, if you're running one of these kernels ('uname -a',
last number is shown later in the line) and if 'swapon -s' shows
/dev/zram0, do immediately a 'sudo swapoff /dev/zram0'. Otherwise your
machine can crash at any time.

NOTE2: Potentially all 12.04 & derivative installations that include the
package lupin-casper (and have not altered the zram configuration) will
experience the bug.

I performed a clean install of Mint 13, followed by a switch to the 12.04.3 stack (as explained here: https://wiki.ubuntu.com/Kernel/LTSEnablementStack). I also switched an Ubuntu 12.04.2 to 12.04.3. Here are my findings. If you only want a summary of workarounds, scroll to the bottom. Ref:
http://askubuntu.com/questions/346545/how-to-detect-which-init-script-starts-zram

FINDINGS:

1. Package versions: A Mint 13 clean install is based on 12.04.(0 or 1).
Using updates only gets you up to 3.2.0-54.82. A Mint 13 switched to the
12.04.3 stack gets you up to 3.8.0-31.46. An Ubuntu 12.04.2 switched to
12.04.3 get you up to 3.8.0-31.46 as well.

2. zram is broken in both 3.2.0-54.82 and 3.8.0-31.46, as explained in
#43: the last sector of /dev/zram0 is bad. However, you might not notice
this because zram is not always used by default (see 3 below). To check
zram is broken, first make sure it's loaded (but not for swapping!! see
NOTE1 above):

  lsmod | grep zram

If it doesn't show, do this to create a 1GB zram:

  sudo modprobe zram
  echo '1024^3' | bc | sudo tee /sys/block/zram0/disksize

With zram loaded, run:

  sudo dd if=/dev/zram0 of=/dev/null bs=4096

I get:
dd: reading `/dev/zram0': Input/output error
262143+0 records in
262143+0 records out
1073737728 bytes (1.1 GB) copied, 0.400378 s, 2.7 GB/s

Compare the 262143 above with:

  sudo fdisk -l /dev/zram0 | grep -o "total [0-9]* sectors"

I get:
total 262144 sectors

3. zram usage: The zram-config package is NOT installed by default by either Mint 13 or Ubuntu 12.04. Regardless of that(!), in some configurations, zram is loaded by the initramfs image. By default, Mint 13 DOES use zram, whereas Ubuntu 12.04 DOES NOT use zram.
- check if module loaded: 'lsmod | grep zram'
- check if zram is used for swap: 'swapon -s | grep zram' (if it is, see NOTE1 above)
- check if zram-config package installed: 'dpkg -l zram-config'

4. If zram is loaded by initramfs, the zram-config package is useless.
By the time /etc/init/zram-config.conf runs, the zram module is already
loaded, so 'modprobe' won't do anything, and setting the size by writing
to /sys/block/zram0/disksize will not work. Thus, the solution in
#43/#45/#49 won't work. If you really want zram-config to take over zram
allocation, you need to add:

  # remove swaps
  for dev in $(swapon -s | grep /dev/zram | cut -d ' ' -f 1); do
    swapoff $dev || exit 1
  done
  # remove module
  if lsmod | grep -q zram; then
    rmmod zram || exit 1
  fi

just before:

  modprobe zram $MODPROBE_ARGS

Note, the version I have sets up one zram per CPU core. Not sure why
you'd need that. If you don't, also replace:

  NRDEVICES=$(grep -c ^processor /proc/cpuinfo | sed 's/^0$/1/')

by:

  #NRDEVICES=$(grep -c ^processor /proc/cpuinfo | sed 's/^0$/1/')
  NRDEVICES=1

Also, don't forget to add '-c' to mkswap, as explained in #43.

5. The culprit which makes the difference between Mint 13 using zram in initramfs and Ubuntu 12.04 not using it is the package lupin-casper. This one depends on casper, which contains the file /usr/share/initramfs-tools/conf.d/compcache. This file contains only:
COMPCACHE_SIZE="50%"
If this file is absent, the script /usr/share/initramfs-tools/hooks/compcache (part of initramfs-tools) won't do anything, because its 'eval' will return 'number=""; suffix=""', which will trigger early termination just below 'eval'. If the COMPCACHE_SIZE setting file is present, the script will add zram to the initramfs. Thus, potentially all 12.04 & derivative installations which include lupin-casper will experience the bug. Furthermore, you might get the bug by installing lupin-casper later on, before the bug is fixed.

WORKAROUNDS: (either one should be enough!)

1. Disable zram.
Pro: Definitely clears the zram bug.
Con: Need to undo changes by hand to re-enable it later on, once the zram bug is fixed.

1a. Add at the top of /etc/rc.local:
swapoff /dev/zram0
rmmod zram

1b. Blacklist zram and run 'update-initramfs'.

1c. Find zram.ko and rename it to zram.ko.DONTUSE and run 'update-
initramfs' (thx Dan)

2. Use zram, but avoid the last sector. For this you need to make sure the relevant 'mkswap' runs with '-c' (see #43).
Pro: zram still used; potential fix in kernel will be integrated seamlessly.
Cons: You take a chance that nothing else (other than the last sector) is bad about zram; dmesg is still polluted by "Buffer I/O error on device /dev/zram0".

2a. If zram loaded by initramfs: inside /usr/share/initramfs-
tools/hooks/compcache find and replace:

  /sbin/mkswap "/dev/$device" >/dev/null

by:

  /sbin/mkswap -c "/dev/$device" >/dev/null

2b. If zram loaded by zram-config package: inside /etc/init/zram-
config.conf find and replace:

  mkswap /dev/zram${DEVNUMBER}

by:

  mkswap -c /dev/zram${DEVNUMBER}

To decide between 2a and 2b, read note 4.

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1215513

Title:
  System locks up, requires hard reset

Status in “linux” package in Ubuntu:
  Fix Released
Status in “linux” source package in Precise:
  Fix Released
Status in “linux” source package in Quantal:
  Fix Released
Status in “linux” source package in Raring:
  Fix Released
Status in “linux” source package in Saucy:
  Fix Released

Bug description:
  Since I started using 3.8.0-29 I experienced system lock ups at random
  times. First one was while running Virtualbox (windows guest) but
  later have been without virtualbox running for example while shutting
  down or while reading a webpage.

  I could not find any relevant log, but I'd post any log file
  considered useful.

  This has hapened in 2 different machines (the one im reporting from is
  intel with intel graphics and the other is AMD with radeon graphics).
  Both 64 bits.

  Up until 3.8.0-27 inclusive I had not had a lockup in years in any of
  those machines. I have been running Ubuntu 64 bit since at least 2008
  in one of them.

  ProblemType: Bug
  DistroRelease: Ubuntu 13.04
  Package: linux-image-3.8.0-29-generic 3.8.0-29.42
  ProcVersionSignature: Ubuntu 3.8.0-29.42-generic 3.8.13.5
  Uname: Linux 3.8.0-29-generic x86_64
  ApportVersion: 2.9.2-0ubuntu8.3
  Architecture: amd64
  AudioDevicesInUse:
   USER        PID ACCESS COMMAND
   /dev/snd/controlC0:  fede       1829 F.... pulseaudio
  CRDA: Error: command ['iw', 'reg', 'get'] failed with exit code 1: nl80211 not found.
  CurrentDmesg:
   
  Date: Thu Aug 22 12:49:35 2013
  HibernationDevice: RESUME=UUID=ee5b2280-eed3-41e2-8675-103fbdd703d1
  InstallationDate: Installed on 2012-12-03 (261 days ago)
  InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
  IwConfig:
   eth0      no wireless extensions.
   
   lo        no wireless extensions.
  Lsusb:
   Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
   Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
   Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
   Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
   Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  MarkForUpload: True
  ProcFB: 0 inteldrmfb
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.8.0-29-generic root=UUID=0d34a8a5-2002-47e8-9128-a35623612ec1 ro quiet splash vt.handoff=7
  RelatedPackageVersions:
   linux-restricted-modules-3.8.0-29-generic N/A
   linux-backports-modules-3.8.0-29-generic  N/A
   linux-firmware                            1.106
  RfKill:
   
  SourcePackage: linux
  StagingDrivers: zram
  UpgradeStatus: Upgraded to raring on 2013-04-25 (118 days ago)
  dmi.bios.date: 09/11/2006
  dmi.bios.vendor: Intel Corp.
  dmi.bios.version: TS94610J.86A.0047.2006.0911.0110
  dmi.board.asset.tag: Base Board Asset Tag
  dmi.board.name: D946GZIS
  dmi.board.vendor: Intel Corporation
  dmi.board.version: AAD66165-501
  dmi.chassis.type: 2
  dmi.modalias: dmi:bvnIntelCorp.:bvrTS94610J.86A.0047.2006.0911.0110:bd09/11/2006:svn:pn:pvr:rvnIntelCorporation:rnD946GZIS:rvrAAD66165-501:cvn:ct2:cvr:

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1215513/+subscriptions


References