swapon hangs when using file on kernels 2.6.28-13 and 2.6.28-11 but works perfect on kernel 2.6.27.11

Bug #366397 reported by Luis Lumbreras Picazo
24
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

I have tested a lot, changing VFAT (FAT32) umask, uid and gid on /etc/fstab, allways happens the same:
On kernels 2.6.28.13 and 2.6.28.11 swapon /media/SWAP/pagefile.sys hags, so at boot time it stops and Ctrl+Alt+Sup is only way to continue
On kernel 2.6.27-11 swapon /media/SWAP/pagefile.sys works perfectly.

Since i can select what kernel to load thanks to grub i can do the next test with this results:

-Boot selecting kernel 2.6.28-13 -> swapon hangs the PC at boot time when activating swap area on file.
-Reboot with Ctrl+Alt+Sup
-Boot selecting kernel 2.6.28-13 -> swapon hangs the PC at boot time when activating swap area on file.
-Reboot with Ctrl+Alt+Sup
... so on as i select kernel 2.6.28-13 ...

-Boot selecting kernel 2.6.28-11 -> swapon hangs the PC at boot time when activating swap area on file.
-Reboot with Ctrl+Alt+Sup
-Boot selecting kernel 2.6.28-11 -> swapon hangs the PC at boot time when activating swap area on file.
-Reboot with Ctrl+Alt+Sup
... so on as i select kernel 2.6.28-11 ...

-Boot selecting kernel 2.6.27-11 -> swapon works perfect at boot time and activate swap area on file.
-Shutdown Ubuntu 9.04 normaly

-Boot selecting kernel 2.6.28-11 -> swapon hangs the PC at boot time when activating swap area on file.
-Reboot with Ctrl+Alt+Sup
-Boot selecting kernel 2.6.28-11 -> swapon hangs the PC at boot time when activating swap area on file.
-Reboot with Ctrl+Alt+Sup
... so on as i select kernel 2.6.28-11 ...

-Boot selecting kernel 2.6.28-11 -> swapon hangs the PC at boot time when activating swap area on file.
-Reboot with Ctrl+Alt+Sup
-Boot selecting kernel 2.6.28-11 -> swapon hangs the PC at boot time when activating swap area on file.
-Reboot with Ctrl+Alt+Sup
... so on as i select kernel 2.6.28-11 ...

-Boot selecting kernel 2.6.27-11 -> swapon works perfect at boot time and activate swap area on file.
-Shutdown Ubuntu 9.04 normaly

So i can see it only occurs when kernel 2.6.28-11 is selected and also when kernel 2.6.28-13 is selected.

Also i have commented swapon line, so i can boot with kernels 2.6.28-11 and 2.6.28-13, then i go to a prompt and type:

[Booting 2.6.28-13]
$uname -s -n -r -m
Linux ubuntu 2.6.28-13-generic i686
$sudo swapon -s
[sudo] password for usuario:
Filename Type Size Used Priority
$sudo mkswap /media/SWAP/pagefile.sys
$sudo swapon /media/SWAP/pagefile.sys
<--< It hangs on swapon and console must be terminated, unable to kill swapon process, neither with kill -9

[Booting 2.6.28-11]
$uname -s -n -r -m
Linux ubuntu 2.6.28-11-generic i686
$sudo swapon -s
[sudo] password for usuario:
Filename Type Size Used Priority
$sudo mkswap /media/SWAP/pagefile.sys
$sudo swapon /media/SWAP/pagefile.sys
<--< It hangs on swapon and console must be terminated, unable to kill swapon process, neither with kill -9

If i do the same but selecting kernel 2.6.27-11 at boot time i get:
$uname -s -n -r -m
Linux ubuntu 2.6.27-11-generic i686
$sudo swapon -s
[sudo] password for usuario:
Filename Type Size Used Priority
$sudo mkswap /media/SWAP/pagefile.sys
$sudo swapon /media/SWAP/pagefile.sys
$sudo swapon -s
Filename Type Size Used Priority
/media/SWAP/pagefile.sys file 4186104 0 -1
$

Obviously /media/SWAP is mounted as on both cases as:
/dev/sda1 on /media/SWAP type vfat (rw,utf8,umask=007,uid=0,gid=0)

Also the file pagefile.sys is defragmented.

I have also done the next just to avoid any possible of being the content of the file:
$sudo umount /media/SWAP
$sudo mkfs.vfat -F 32 -n PAGEFILE -v /dev/sda1
$sudo mount /dev/sda1 /media/SWAP
$sudo dd bs=1MB cont=4081 if=/dev/zero of=/media/SWAP/pagefile.sys
$sudo mkswap /media/SWAP/pagefiles.sys
$swapon /media/SWAP/pagefile.sys
If i do this on kernel 2.6.27-11 works perfect but if done in kernels 2.6.28-13 and 2.6.28-11 it hangs on swapon

I think it is a kernel bug.

Also i had tried to put sync command between commands, but same occurs swapon hangs on kernels 2.6.28-13 and 2.6.28-11 but on kernel 2.6.27-11 works fine.

Hope this info could help to solve such bug.

Thanks.

P.D.: If i had the oportunity i will check exactly the same, but with a file size exactly of 4GB (4096MB) instead of actual size of 4081MB, it is supposed not to affect, but who knows!

Revision history for this message
Kirill (jia3ep) wrote :

Same problem. Swapon seems to be hangs for infinite time.

Revision history for this message
Albert Darenberg (albert-darenberg) wrote :

I can confirm this. I have noticed that I can speed up the process by pressing a few times the return key. But the system still hangs for at least 20 seconds.

Revision history for this message
Elliot (elliot-orwells) wrote :

As Albert Darenberg pointed in bug #367260, both bugs are probably caused by the same problem.

Revision history for this message
Henri Cook (henricook) wrote :

I'm pretty sure I have this error on boot (I've been using alt+sysrq+r+s+e to get out of it, controversially)

I can however mount my swap from the terminal:

henri@osiris:/etc$ uname -a
Linux osiris 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux
henri@osiris:/etc$ sudo cryptsetup luksOpen /dev/sdc5 sdc5_crypt
henri@osiris:/etc$ sudo swapon -a

<works - 'top' reflects i now have swap>

Why this doesn't work on boot I don't know, could the OP tell me where to comment out swap starting on boot? Maybe I can add the manual swap mount to /etc/rc.local as a workaround...

Revision history for this message
jeday (nsv-renome-smart) wrote :

Hello all,
I think I had this problem too, but I left 'sudo swapon /media/hda5/pagefile.sys' for night at work - and at morning swapfile was mounted.

I cant say how much time it was used but - result is swap was mounted.

Revision history for this message
jeday (nsv-renome-smart) wrote :

sorry forgot,

jeday@jeday-desktop:/var$ uname -a
Linux jeday-desktop 2.6.28-12-generic #43-Ubuntu SMP Fri May 1 19:27:06 UTC 2009 i686 GNU/Linux
jeday@jeday-desktop:/var$ cat /proc/swaps
Filename Type Size Used Priority
/media/disk-1/pagefile.sys file 2095096 21400 -1
jeday@jeday-desktop:/var$

Revision history for this message
Rich (rincebrain) wrote :

This sounds like a job for git bisect.

Anybody know if this happens in vanilla 2.6.28?

description: updated
summary: - swapon hangs when using file on kernel 2.6.28-11 but works perfect on
- kernel 2.6.27.11
+ swapon hangs when using file on kernels 2.6.28-13 and 2.6.28-11 but
+ works perfect on kernel 2.6.27.11
description: updated
Revision history for this message
angros47 (angros47) wrote :

Can confirm it. It affects even 2.6.28-14

Revision history for this message
Tristan (tristan-ley-laposte) wrote :

Hello. I can confirm too...
me@desktop:~$ uname -ar
Linux desktop 2.6.28-14-generic #47-Ubuntu SMP Sat Jul 25 01:19:55 UTC 2009 x86_64 GNU/Linux

Revision history for this message
wing (wingsuit) wrote :

Can confirm it also on 2.6.28-15-generic i686

attached misc info about my system and also strace of swapon command (hopefully it helps)

Revision history for this message
wing (wingsuit) wrote :

bug #374127 looks like a duplicate to this bug, seems to me it might affect all wubi installations that use swap file, correct me if i'm wrong.

Revision history for this message
japlin (jmaplin) wrote :

Confirmed for 2.6.28-15-generic AMD64

To reproduce:
mkfs.vfat /dev/sda4
mount /dev/sda4 /swap
dd if=/dev/zero of=/swap/pagefile.sys bs=1024*1024 count=2048
mkswap /swap/pagefile.sys
swapon /swap/pagefile.sys

Hangs indefinitely.

affects: ubuntu → linux (Ubuntu)
Revision history for this message
Jeremy Foshee (jeremyfoshee) wrote :

Hi Luis,

This bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? Can you try with the latest development release of Ubuntu? ISO CD images are available from http://cdimage.ubuntu.com/releases/ .

If it remains an issue, could you run the following command from a Terminal (Applications->Accessories->Terminal). It will automatically gather and attach updated debug information to this report.

apport-collect -p linux 366397

Also, if you could test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text. Please let us know your results.

Thanks in advance.

    [This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

tags: added: needs-kernel-logs
tags: added: needs-upstream-testing
tags: added: kj-triage
Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Luis Lumbreras Picazo (luis-lumbreras-picazo) wrote : Re: [Bug 366397] Re: swapon hangs when using file on kernels 2.6.28-13 and 2.6.28-11 but works perfect on kernel 2.6.27.11

Sorry me, since a lot of time i do not use anymore SWAP on files,... since i
detected the error.

Now i do not have such FAT32 partition with "pagefile.sys", now i use a
dedicated SWAP partition, so i am afraid i can not check it on new kernels,
sorry.

If i have time i will try to see if i can re-check it on my old PC... with
last kernel from Ubuntu... but i can not know when i will have time to do
it, since i must re-format... and reinstall all from scratch.

Now i have all my Linux using full HDDs in Linux Raid 0 configurations... so
it will be very diffucult to me to make a hole for a FAT32 parttiion... one
PC with Two HDDs, the other with Three HDDs, all in Raid 0... as follows:

-Each start part of each HDD for / (Raid0)
-Little part of each HDD for SWAP (No Raid0, instead same priority)
-Rest of each HDD for /media/MyDATA (Raid0)

Speed is much greater,... too much better speed...

So i am afraid if i want to use a full 4GB FAT32 partition with a
"pagefile.sys" file been used as SWAP i must destroy Raid 0 configuration...
and i do not want to need to reinstall my whole Linux and applications... so
i am afraid i can not re-check it anymore, sorry.

But anyone can do such re-check... anyone who has a non Raid0 system...

The steps:
-Create a 4GB primary parttition
-Format it as FAT32
-Boot Windows and let it create a "pagefile.sys" as greater as it lets, nar
4GB but not 4GB -> if i do not remember bad between 4050MiB and 4090MiB, of
course size is not a power of 2
-Restart
-Run Linux and configure it to use such file as the only SWAP to be used
-At next boot it hangs... or better said swapon is what hangs

I could see such error on some kernels 2.6.28-11 and up till i decided to
use dedicated partitions, and Raid0 fo / and /media/MyDATA...

Sorry, now i can not check it again if i do not re-format my HDDs loosing
all Linux configuration and applications installed... but if i have time i
will try to see if i can try with old external USB HDD i have... it has one
FAT32 partition with more than 4GB free space on it, so maybe... but will
not be the exact same test... so not sure if can be considered a valid test.

Now i am trying to solve other problems, like poweroff on Ubuntu Karmic
64bits on a HP Pavilion tx2620es (32bit version power off correctly, while
64bit version does all except final power cut, so still remain on and must
be pressed near 4sec the power button to power off it completly) and some
other problems... so i do not have much time left to test something i will
not use anymore: SWAP on a file.

Sorry for any inconvenience... but why not someone else do such tests? For
me now it will imply to throught out all my Linux installation system,
configuration and applications... since now i use Linux Raid0 by software
for / ... etc.

Revision history for this message
Jeremy Foshee (jeremyfoshee) wrote :

This bug report was marked as Incomplete and has not had any updated comments for quite some time. As a result this bug is being closed. Please reopen if this is still an issue in the current Ubuntu release http://www.ubuntu.com/getubuntu/download . Also, please be sure to provide any requested information that may have been missing. To reopen the bug, click on the current status under the Status column and change the status back to "New". Thanks.

[This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

tags: added: kj-expired
Changed in linux (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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