Bug 91424 - Crashing if out of diskspace
Summary: Crashing if out of diskspace
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Scan (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-16 02:10 UTC by Felix Möller
Modified: 2023-04-08 20:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 8.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Möller 2004-10-16 02:10:46 UTC
Version:           CVS 2004-10-05 (using KDE KDE 3.2.1)
Installed from:    SuSE RPMs
Compiler:          gcc 3.3.1 
OS:                Linux

Hi,

Digikam started crashing today every few minutes, this was really strange to me so I looked at the console debugging output and found the problem:  I happened to ran out of diskspace.

The Output:
digikam: ImagePluginLoader: Loaded plugin ImagePlugin_Despeckle
digikam: ImagePlugin_Charcoal plugin loaded
digikam: ImagePluginLoader: Loaded plugin ImagePlugin_Charcoal
digikam: WARNING: [bool AlbumDB::execSql(const QString&, QStringList*, bool)] sqlite_step error: database is full on query: BEGIN TRANSACTION;
libpng error: Read Error
libpng error: Write Error
libpng error: Read Error
libpng error: Write Error
libpng error: Write Error
gdbm fatal: write error


I think it would be nice to give the user a little info that there is not enough space left instead of the application just crashing.

Felix
Comment 1 Renchi Raju 2004-10-18 04:09:40 UTC
do you have a backtrace available for the crash?
Comment 2 Felix Möller 2004-10-18 21:25:44 UTC
It wasn't an actual crash the application just closed itself.

I just reproduced the problem by filling up my disk again with:
dd if=/dev/zero of=tmp bs=8096

As soon as you go into an folder - where no thumbnails have been generated yet, the application closes itself.

On the Console you can  just find the following lines:
libpng error: Write Error
libpng error: Write Error
gdbm fatal: write error

It seems to be just gdbm related, sqlite doeesn't have problem with full disks:
digikam: WARNING: [bool AlbumDB::execSql(const QString&, QStringList*, bool)] sqlite_step error: database is full on query: REPLACE INTO ImageTags VALUES('IMG_1366.JPG', 6, 8);

Please instruct me how to give you more detailed information.

HTH
Felix
Comment 3 Renchi Raju 2004-10-18 22:56:54 UTC
CVS commit by pahlibar: 


override default gdbm fatal function to prevent app from exiting if user
runs out of diskspace
CCMAIL: 91424-done@bugs.kde.org


  M +8 -1      thumbdb.cpp   1.6


--- kdeextragear-3/digikam/digikam/thumbdb.cpp  #1.5:1.6
@@ -30,4 +30,5 @@
 #include <kmdcodec.h>
 #include <kdebug.h>
+#include <kdebug.h>
 
 extern "C"
@@ -41,4 +42,10 @@ extern "C"
 #include "thumbdb.h"
 
+void digikam_gdbm_fatal_func(char* val)
+{
+    kdWarning() << "GDBM fatal error occured: "
+                << val << endl;
+}
+
 class ThumbDBPriv
 {
@@ -70,5 +77,5 @@ ThumbDB::ThumbDB()
     const char* path = encPath; 
     d->db = gdbm_open((char*)path, 0, GDBM_WRCREAT|GDBM_FAST,
-                      0666, 0);
+                      0666, (void (*)()) digikam_gdbm_fatal_func);
      if (!d->db)
          kdWarning() << "Failed to open Thumbnail DB file: " << dbPath << endl;