Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 455134

Summary: app=office/gnucash with dev-db/libdbi - "The library "libdbi" installed on your system doesn't correctly store large numbers. [...]" on x86
Product: Gentoo Linux Reporter: step <step247>
Component: Current packagesAssignee: GNOME Office (OBSOLETE) <gnome-office+disabled>
Status: RESOLVED FIXED    
Severity: normal CC: harold, robbat2, tl, x86
Priority: Normal    
Version: unspecified   
Hardware: x86   
OS: Linux   
See Also: https://bugzilla.gnome.org/show_bug.cgi?id=611936
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 465716, 486476    
Bug Blocks:    
Attachments: The libdbi-0.9.0 ebuild I used
The libdbi-drivers-0.9.0 ebuild I used

Description step 2013-02-02 14:45:37 UTC
gnucash whines about The library "libdbi" installed on your system doesn't correctly store large numbers.  This means GnuCash cannot use SQL databases correctly.  Gnucash will not open or save to SQL databases until this is fixed by installing a different version of "libdbi".  Please see https://bugzilla.gnome.org/show_bug.cgi?id=611936 for more information.



[D] dev-db/libdbi
     Available versions:  0.8.1 0.8.3 ~0.8.4 {{doc}}
     Installed versions:  0.8.4(16:26:30 02.02.2013)(-doc -static-libs)
     Homepage:            http://libdbi.sourceforge.net/
     Description:         libdbi implements a database-independent abstraction layer in C, similar to the DBI/DBD layer in Perl.

[D] dev-db/libdbi-drivers
     Available versions:  0.8.1-r1 0.8.1-r2 0.8.3 ~0.8.3-r1 ~0.8.3-r2 {{bindist doc firebird mysql oci8 postgres sqlite (+)sqlite3}}
     Installed versions:  0.8.3-r2(16:26:48 02.02.2013)(mysql sqlite -bindist -doc -firebird -oci8 -postgres -static-libs)
     Homepage:            http://libdbi-drivers.sourceforge.net/
     Description:         The libdbi-drivers project maintains drivers for libdbi.

[I] app-office/gnucash
     Available versions:  2.4.8 2.4.10 {{chipcard cxx debug +doc hbci mysql ofx postgres python quotes sqlite webkit}}
     Installed versions:  2.4.10(22:13:15 23.01.2013)(cxx doc mysql -chipcard -debug -hbci -ofx -postgres -python -quotes -sqlite -webkit)
Comment 1 Pacho Ramos gentoo-dev 2013-02-02 16:59:00 UTC
should be fixed in libdbi-0.8.4

*** This bug has been marked as a duplicate of bug 376555 ***
Comment 2 step 2013-02-12 12:46:02 UTC
(In reply to comment #1)
> should be fixed in libdbi-0.8.4
> 
> *** This bug has been marked as a duplicate of bug 376555 ***

As you can see, I have dev-db/libdbi-0.8.4 installed
Any advice is welcome.
Comment 3 Pacho Ramos gentoo-dev 2013-02-12 19:39:30 UTC
Your system looks strange as it shows that libdbi versions as testing (~) while they are stable for some time

emerge --info is needed then
Comment 4 step 2013-03-06 12:32:54 UTC
# emerge --info
Portage 2.1.11.55 (default/linux/x86/13.0/desktop/kde, gcc-4.6.3, glibc-2.15-r3, 3.5.7-gentoo i686)
=================================================================
System uname: Linux-3.5.7-gentoo-i686-Intel-R-_Core-TM-2_Duo_CPU_E8400_@_3.00GHz-with-gentoo-2.1
KiB Mem:     4145820 total,   1267016 free
KiB Swap:    1004056 total,    985360 free
Timestamp of tree: Wed, 06 Mar 2013 09:15:01 +0000
ld GNU ld (GNU Binutils) 2.22
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/ccache:          3.1.9
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo webapp-experimental perl-experimental astronomy bitcoin my_local_AMD_SDK_overlay
Installed sets: @system
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=nocona -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="ftp://trumpetti.atm.tut.fi/gentoo/ ftp://ftp.ing.umu.se/linux/gentoo/ http://gentoo.osuosl.org/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ "
LANG="et_EE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/webapps-experimental /var/lib/layman/perl-experimental /var/lib/layman/astronomy /var/lib/layman/bitcoin /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa apache berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gpm iconv icu ipv6 jpeg kde kipi lcms ldap libnotify mad matroska midi mng modules mp3 mp4 mpeg mudflap mysql ncurses nls nptl ogg opengl openmp pam pango pcre pdf phonon php plasma png policykit postgresql ppds qt3 qt3support qt4 readline sdl semantic-desktop session smp spell ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb v4l2 vorbis win32codecs wxwidgets x264 x86 xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="fglrx" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 5 Pacho Ramos gentoo-dev 2013-03-06 19:33:50 UTC
Please show "emerge -pv libdbi libdbi-drivers gnucash"
Comment 6 step 2013-03-07 17:20:45 UTC
(In reply to comment #5)
> Please show "emerge -pv libdbi libdbi-drivers gnucash"

$ emerge -pv libdbi libdbi-drivers gnucash

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] dev-db/libdbi-0.8.4  USE="-doc -static-libs" 0 kB
[ebuild   R    ] dev-db/libdbi-drivers-0.8.3-r2  USE="mysql sqlite -bindist -doc -firebird -oci8 -postgres -static-libs" 0 kB
[ebuild   R    ] app-office/gnucash-2.4.10  USE="cxx doc sqlite -chipcard -debug -hbci -mysql -ofx -postgres -python -quotes -webkit" 0 kB

Total: 3 packages (3 reinstalls), Size of downloads: 0 kB
Comment 7 Pacho Ramos gentoo-dev 2013-03-07 20:46:23 UTC
Please explain me steps to follow for getting that gnucash warning. Also test with app-office/gnucash-2.4.11-r1
Comment 8 step 2013-03-07 21:12:15 UTC
start gnucash, 
select Save As, 
select sqlite3 as format
and I get the error
Comment 9 step 2013-03-07 22:11:42 UTC
$ cat  /tmp/gnucash.trace 
* 00:09:36  WARN <gnc.backend.dbi> [conn_test_dbi_library()] Test_DBI_Library: LongLong Failed -9223372036854775807 !=  0
* 00:09:36  WARN <gnc.backend.dbi> [conn_test_dbi_library()] Test_DBI_Library: Unsigned longlong Failed 9223372036854775807 != 0
* 00:09:36  WARN <gnc.backend.dbi> [conn_test_dbi_library()] Test_DBI_Library: Double Failed     1,797692e+307 !=      0,000000e+00
* 00:09:37  CRIT <gnc.engine.sx> gnc_sx_get_sxes_referencing_account: assertion `sxactions != NULL' failed
* 00:09:39  WARN <GLib-GObject> instance of invalid non-instantiatable type `<invalid>'
* 00:09:39  CRIT <GLib-GObject> g_signal_handlers_destroy: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
* 00:09:39  CRIT <GLib-GObject> g_object_unref: assertion `G_IS_OBJECT (object)' failed
* 00:09:39  CRIT <GLib> g_hash_table_foreach: assertion `version == hash_table->version' failed
* 00:09:39  CRIT <GLib> g_hash_table_foreach: assertion `version == hash_table->version' failed
* 00:09:39  CRIT <GLib> g_hash_table_foreach: assertion `version == hash_table->version' failed
* 00:09:39  CRIT <GLib> g_hash_table_foreach: assertion `version == hash_table->version' failed
* 00:09:39  CRIT <GLib> g_hash_table_foreach: assertion `version == hash_table->version' failed
Comment 10 step 2013-03-11 19:44:02 UTC
what is most annoying, those versions work fine in kubuntu.
Comment 11 step 2013-04-07 08:09:31 UTC
I am at dev-db/sqlite 3.7.15.2 

$ tail /tmp/gnucash.trace 
* 11:04:39  WARN <gnc.backend.dbi> [conn_test_dbi_library()] Test_DBI_Library: LongLong Failed -9223372036854775807 !=  0
* 11:04:39  WARN <gnc.backend.dbi> [conn_test_dbi_library()] Test_DBI_Library: Unsigned longlong Failed 9223372036854775807 != 0
* 11:04:39  WARN <gnc.backend.dbi> [conn_test_dbi_library()] Test_DBI_Library: Double Failed     1,797692e+307 !=      0,000000e+00
* 11:05:06  CRIT <gnc.engine.sx> gnc_sx_get_sxes_referencing_account: assertion `sxactions != NULL' failed

and 

"The library "libdbi" installed on your system doesn't correctly store large numbers.  This means GnuCash cannot use SQL databases correctly.  Gnucash will not open or save to SQL databases until this is fixed by installing a different version of "libdbi".  Please see https://bugzilla.gnome.org/show_bug.cgi?id=611936 for more information."

Is it possible that some type of test is actually failing caused by some type (gentoo specific) permission errors?
Comment 12 Pacho Ramos gentoo-dev 2013-04-07 08:50:46 UTC
+*gnucash-2.4.12 (07 Apr 2013)
+
+  07 Apr 2013; Pacho Ramos <pacho@gentoo.org> +gnucash-2.4.12.ebuild,
+  -gnucash-2.4.10.ebuild:
+  Version bump, set libdbi* dependencies to versions I have just confirmed work
+  for me (#455134 by step), drop old.
+

Please try with 2.4.12
Comment 13 Tobias Leupold 2013-04-07 17:51:01 UTC
I can confirm this bug on my x86 machine (with dev-db/libdbi-0.8.4 and dev-db/libdbi-drivers-0.8.3-r2 installed).

Interestingly, I do not see the bug on my amd64 machine with the very same versions.

After the upgrade to app-office/gnucash-2.4.12 everything still works on the amd64 host, but it still does not on the x86 host. I still see the error message mentionned by step when opening an SQlite GnuCash file.
Comment 14 Pacho Ramos gentoo-dev 2013-04-07 17:55:52 UTC
I cannot test on x86, not sure if any gnome team member will be able to :/
Comment 15 step 2013-04-08 19:17:54 UTC
Is there a reliable libdbi test I can run "manually"?
Comment 16 Tobias Leupold 2013-04-12 14:00:34 UTC
Perhaps this is actually a libdbi problem on x86 and not a GnuCash issue? I'm not a developer, but the traceback above looks to me like GnuCash just does some checks if the storage backend does work properly and sees that it does not.
Comment 17 Tobias Leupold 2013-04-12 14:55:38 UTC
I don't have a fix for the problem with the current portage versions, but the current stable versions 0.9.0 of libdbi and libdbi-drivers fixes the problem and make (at least) app-office/gnucash-2.4.12 work again with sqlite3.

I simply created an overlay and copied libdbi-0.8.4.ebuild to libdbi-0.9.0.ebuild and libdbi-drivers-0.8.3-r2.ebuild to libdbi-drivers-0.9.0.ebuild. I had to do some minor fixes in the libdbi-drivers and remove all the patching from both ebuild so I could compile them.

After installing the 0.9.0 versions, GnuCash worked, without having to recompile it.

I'll attach the ebuilds I used but I'm pretty sure they are not "clean" enough for portage yet. But at least, they do the job ;-)
Comment 18 Tobias Leupold 2013-04-12 14:56:12 UTC
Created attachment 345382 [details]
The libdbi-0.9.0 ebuild I used
Comment 19 Tobias Leupold 2013-04-12 14:56:38 UTC
Created attachment 345384 [details]
The libdbi-drivers-0.9.0 ebuild I used
Comment 20 Pacho Ramos gentoo-dev 2013-04-12 18:18:26 UTC
Thanks for the investigation, will be handled in bug 465716 as libdbi is maintained by different people
Comment 21 Harold Anderson 2013-11-10 08:04:55 UTC
From the Gnucash documentation:

 Q: Should I use the XML or database backend?

    A: Until GnuCash supports simultaneous multiuser use almost all users are better off with the XML backend. 

I wonder if it makes more sense to move 2.4.13 and 2.4.12 to stable status, and to somehow make the use of the sqlite, mysql, and postgresql flags not recommended.
Comment 22 Tobias Leupold 2013-11-10 13:58:00 UTC
I use the SQLite backend for the accounting of my business and it works just fine. It has the real big advantage that I can simply get out data by just querying the database (in my case by a Python script that calculates different stuff). With XML, gthis would also be possible, but with way more programming to do.

As this is obviously an issue with libdbi on x86 (isn't it?!), I think there are two reasonable solutions:

1. Simply make libdbi-0.9.0 stable. Won't hopefully affect amd64 and solve the problem for x86.

2. Make libdbi-0.9.0 a dependency if we're on x86 and the sqlite USE flag is set.
Comment 23 Pacho Ramos gentoo-dev 2013-12-24 13:12:27 UTC
This is solved in latest version that needs fixed libdbi