Bug 575644 - abrt erroneously aborts with "Low free disk space detected"
Summary: abrt erroneously aborts with "Low free disk space detected"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: abrt
Version: 12
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Jiri Moskovcak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-03-21 22:15 UTC by James Ralston
Modified: 2015-02-01 22:51 UTC (History)
8 users (show)

Fixed In Version: abrt-1.0.9-1.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-04-13 01:45:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patch to improve error messages related to low disk space (1.18 KB, application/octet-stream)
2010-03-21 22:15 UTC, James Ralston
no flags Details
patch to improve error messages related to low disk space (1.18 KB, patch)
2010-03-21 22:17 UTC, James Ralston
no flags Details | Diff

Description James Ralston 2010-03-21 22:15:58 UTC
Created attachment 401605 [details]
patch to improve error messages related to low disk space

$ df -k /var/cache
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/os-cache   1032088    312212    667448  32% /var/cache

$ grep Max /etc/abrt/abrt.conf 
# Max size for crash storage [MiB]
MaxCrashReportsSize = 1000

But:

2010-03-21T16:51:19.001856-04:00 farslayer abrt[7759]: Low free disk space detected, aborting dump

I am seeing this problem on multiple systems.

But: this error message is next to useless, as it doesn't even say what filesystem it is considering, let alone what the threshold value for a "low free disk" space condition is.

To try to get to the bottom of this, I created the attached patch. It applies cleanly to F12/F13/rawhide abrt, and makes the check_free_space() return useful error messages: in particular, check_free_space() now warns in statvfs() fails, and will say exactly how much free space it wants where.

But here's the curious thing: when I built and installed local abrt-* packages with this patch, I no longer get the erroneous "Low free disk space detected" messages! But I cannot see how the code after my patch is *effectively* any different than the code before the patch!

At any rate, not only does this patch make abrt's error messages useful, it appears to fix a bug with erroneous "Low free disk space detected" messages that I (and perhaps others) are experienced. This bug prevents abrt from working at all.

Please apply this patch and rebuild for F12/F13/rawhide. Thanks.

Comment 1 James Ralston 2010-03-21 22:17:20 UTC
Created attachment 401606 [details]
patch to improve error messages related to low disk space

Stupid Bugzilla didn't realize original attachment was a patch; reattaching.

Comment 2 James Ralston 2010-03-21 22:23:16 UTC
Ah, forgot to mention: abrt-1.0.8-2.fc12 is the version that has the "Low free disk space detected" bug. I built a local version, abrt-1.0.8-2.0.fc12, with this patch, and it works fine.

I don't have any F13alpha/rawhide hosts at the moment, so I can't test them.

Comment 3 Denys Vlasenko 2010-04-02 12:04:58 UTC
# patch -p1 </tmp/attachment.patch --dry-run
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- abrt-1.0.8/src/Hooks/hooklib.cpp.check_free_space	2010-02-11 17:52:28.000000000 -0500
|+++ abrt-1.0.8/src/Hooks/hooklib.cpp.check_free_space	2010-03-21 17:47:44.723231289 -0400
--------------------------
File to patch:


+      perror_msg_and_die ("aborting dump: statvfs() failed for %s: %s", DEBUG_DUMPS_DIR, strerror(errno));

perror_xyz() already prints strerror(errno), you are doing it twice here.


+    fs_actual_free_mb = vfs.f_bfree * vfs.f_bsize / (1024 * 1024);

long * long can easily overflow on 32 bits.


+      perror_msg_and_die ("aborting dump: want %uMiB (MaxCrashReportsSize / 4) free space on %s, but only %uMiB is available\n", fs_want_free_mb, DEBUG_DUMPS_DIR, fs_actual_f...

*p*error? why? it will print errno, which will contain something bogus at this point.


What patch does change is that f_bfree is not divided by (2^20/4). Apparently that was rounding it down too strongly: if blocksize (f_bsize) is 4k, then (2^20/4) blocks is 1Gb!

I propose this:

+    /* fs_free_mb_x4 ~= vfs.f_bfree * vfs.f_bsize * 4, expressed in MBytes.
+     * Need to neither overflow nor round f_bfree down too much. */
+    unsigned long fs_free_mb_x4 = ((unsigned long long)vfs.f_bfree / (1024/4)) * vfs.f_bsize / 1024;
+    if (fs_free_mb_x4 < setting_MaxCrashReportsSize)
+    {
+        error_msg_and_die("aborting dump: only %uMiB is available on %s\n", fs_free_mb_x4 / 4, DEBUG_DUMPS_DIR);
     }

This rounds down only to nearest 256 blocks.

Comment 4 Denys Vlasenko 2010-04-02 12:17:01 UTC
Replaced %u with %lu and applied to git.

Comment 5 Fedora Update System 2010-04-06 18:54:44 UTC
abrt-1.0.9-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/abrt-1.0.9-1.fc13

Comment 6 Fedora Update System 2010-04-07 20:56:16 UTC
abrt-1.0.9-1.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update abrt'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/abrt-1.0.9-1.fc13

Comment 7 Fedora Update System 2010-04-13 01:44:26 UTC
abrt-1.0.9-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2010-04-15 13:33:49 UTC
abrt-1.0.9-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/abrt-1.0.9-1.fc12

Comment 9 Fedora Update System 2010-04-23 22:52:35 UTC
abrt-1.0.9-1.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.