FS#7692 - pacman eats 100% cpu after disk space is exhausted

Attached to Project: Pacman
Opened by Brano (bb) - Friday, 27 July 2007, 22:25 GMT
Last edited by Dan McGee (toofishes) - Thursday, 20 January 2011, 21:07 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Dan McGee (toofishes)
Architecture All
Severity Medium
Priority Normal
Reported Version 3.0.5
Due in Version 3.5.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
When installing package using pacman and disk space is reached then pacman report some errors and stay eating 100% of cpu and pacman process does not finish after quite long time (till killing it).

Tail of reported errors:
error: could not extract /usr/share/applications/oraclexe-restore.desktop (No space left on device)
error: could not extract /usr/share/applications/oraclexe-runsql.desktop (No space left on device)
error: could not extract /usr/share/applications/oraclexe-dbhp.desktop (No space left on device)
error: could not extract /usr/share/applications/oraclexe-getstarted.desktop (No space left on device)
error: could not extract /usr/share/applications/oraclexe-stopdb.desktop (No space left on device)
error: could not extract /usr/share/gnome/ (No space left on device)
error: could not extract /usr/share/gnome/vfolders/ (No such file or directory)
error: could not extract /usr/share/gnome/vfolders/oraclexe-gethelp.directory (No such file or directory)
error: could not extract /usr/share/gnome/vfolders/oraclexe-10g.directory (No such file or directory)
error: errors occurred while installing oracle_xe
error: could not open file /var/lib/pacman/local//oracle_xe-10.2.0.1-1/desc: No such file or directory
error: could not update database entry oracle_xe-10.2.0.1-1
error: failed to commit transaction (could not update database)
error: failed to release transaction (could not commit transaction)


Steps to Reproduce:
Try to install package (e.g. "pacman -A packagename.pkg.tar.gz") when there is not enough disk space available on disk.
This task depends upon

Closed by  Dan McGee (toofishes)
Thursday, 20 January 2011, 21:07 GMT
Reason for closing:  Fixed
Additional comments about closing:  Diskspace problem should be solved.
Comment by Roman Kyrylych (Romashka) - Saturday, 28 July 2007, 12:23 GMT
IIRC disk space checking was temporarily removed because it was not done right anyway.
Comment by Dan McGee (toofishes) - Saturday, 28 July 2007, 12:39 GMT
Roman- this isn't quite what that was, however.

Can you reproduce this by chance with --debug or --debug=3 output? That would probably be helpful.
Comment by Brano (bb) - Saturday, 28 July 2007, 15:57 GMT
The relevant part with --debug=3 is:

error: could not extract /testdir/141/testfile (No such file or directory)
debug: logaction called: error: could not extract /testdir/141/testfile (No such file or directory)
debug: decompression progress: 91.370011% (108416 / 118656)
debug: extracting /testdir/291/
error: could not extract /testdir/291/ (No space left on device)
debug: logaction called: error: could not extract /testdir/291/ (No space left on device)
debug: decompression progress: 91.370011% (108416 / 118656)
debug: extracting /testdir/291/testfile
error: could not extract /testdir/291/testfile (No such file or directory)
debug: logaction called: error: could not extract /testdir/291/testfile (No such file or directory)
error: errors occurred while installing mydummy
debug: logaction called: errors occurred while installing mydummy
debug: updating database
debug: adding database entry 'mydummy'
debug: writing mydummy-1-1 DESC information back to db
error: could not open file /var/lib/pacman/local//mydummy-1-1/desc: No such file or directory
error: could not update database entry mydummy-1-1
debug: logaction called: could not update database entry mydummy-1-1
debug: returning error 14 from _alpm_add_commit : could not update database
debug: returning error 22 from alpm_db_unregister : transaction already initialized
debug: removing DB current, 3 remaining...
debug: returning error 22 from alpm_db_unregister : transaction already initialized
debug: removing DB current, 3 remaining...
debug: returning error 22 from alpm_db_unregister : transaction already initialized
debug: removing DB current, 3 remaining...
debug: returning error 22 from alpm_db_unregister : transaction already initialized
debug: removing DB current, 3 remaining...


Last 2 lines are repeating forever.
One more remark, I have all on one filesystem (ext3) except the /home
Comment by Xavier (shining) - Sunday, 29 July 2007, 09:33 GMT
I already mentioned this issue on the ML, pacman will loop each time a transaction fails :
http://www.archlinux.org/pipermail/pacman-dev/2007-July/008726.html
last patch I proposed :
http://www.archlinux.org/pipermail/pacman-dev/2007-July/008970.html
However, nobody commented on the issue or reviewed the patch I proposed.

But that only explains the looping, and it's more general than this no space left issue.
If the partition gets filled while pacman is installing a package, it'll most likely result in a not so clean state : package half extracted, entry not added to database,...
But freeing some space and reinstalling the package should fix everything.
Comment by Dan McGee (toofishes) - Friday, 28 September 2007, 17:48 GMT
This comes down to the whole concept of a true transaction, which we don't currently do. Until then, I don't know how much we can do about this. Xavier and Aaron, any comments?
Comment by Aaron Griffin (phrakture) - Friday, 28 September 2007, 19:29 GMT
My only comment is this line here:

error: failed to release transaction (could not commit transaction)

That just seems silly. If release can't commit it, it should still be able to release it, yes?

This makes me think of java's File.close() functions which throw exceptions - wtf is the point?
Comment by Xavier (shining) - Friday, 28 September 2007, 19:56 GMT
Btw, the loop problem should be fixed now in git (this wasn't mentioned yet in this bug report).

I made a few commits for fixing this bug, but then found a better solution, which mostly reverted my previous commits :
http://projects.archlinux.org/git/?p=pacman.git;a=commit;h=b0aa51059233849b0a7ef8d6a851750776ce6645

I believe that the above message : "error: failed to release transaction (could not commit transaction)"
was caused by the trick to handle interrupted transaction with ctrl+c.

I moved this code to a new alpm_trans_interrupt() function, so alpm_trans_release() shouldn't fail because of that anymore.
However, alpm_trans_release() still has sanity checks, so it can still fail. Not sure if it's a big problem..


About the actual disk space problem, I don't really have an opinion. It's probably rather a long term fix indeed :P
Comment by Tomas Mudrunka (harvie) - Tuesday, 04 November 2008, 22:08 GMT

Loading...