Bug 249762 - Kmymoney+mysql
Summary: Kmymoney+mysql
Status: RESOLVED DUPLICATE of bug 250300
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-01 17:10 UTC by martin welsh
Modified: 2010-12-08 12:58 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description martin welsh 2010-09-01 17:10:14 UTC
Application: kmymoney (4.5.0)
KDE Platform Version: 4.4.2 (KDE 4.4.2)
Qt Version: 4.6.2
Operating System: Linux 2.6.32-21-generic i686
Distribution: Linux Mint 9 Isadora

-- Information about the crash:
Mysql database startup fails and cauese Kmymoney to crash.
Mysql database beleived to be in place.

The crash can be reproduced every time.

 -- Backtrace:
Application: KMyMoney (kmymoney), signal: Illegal instruction
[KCrash Handler]
#6  0x0075d4f4 in ?? () from /lib/tls/i686/cmov/libc.so.6
#7  0x085309ab in MyMoneyStorageSql::close (this=0xa336538, logoff=true) at /build/buildd/kmymoney-4.5/kmymoney/mymoney/storage/mymoneystoragesql.cpp:229
#8  0x0854d66f in MyMoneyStorageSql::~MyMoneyStorageSql() ()
#9  0x0810beab in ~KSharedPtr (this=0x9fc4658, url=...) at /usr/include/ksharedptr.h:90
#10 KMyMoneyView::openDatabase (this=0x9fc4658, url=...) at /build/buildd/kmymoney-4.5/kmymoney/views/kmymoneyview.cpp:877
#11 0x0810c83f in KMyMoneyView::readFile (this=0x9fc4658, url=...) at /build/buildd/kmymoney-4.5/kmymoney/views/kmymoneyview.cpp:597
#12 0x080d4c87 in KMyMoneyApp::slotFileOpenRecent (this=0x9e5c590, url=...) at /build/buildd/kmymoney-4.5/kmymoney/kmymoney.cpp:1502
#13 0x0808bcd5 in main (argc=1, argv=0xbffe3f04) at /build/buildd/kmymoney-4.5/kmymoney/main.cpp:247

Reported using DrKonqi
Comment 1 Fernando Vilas 2010-09-02 15:35:36 UTC
By "Mysql database beleived to be in place", do you mean that you did a "save as database" from an existing .kmy file?

The line where it is failing is on a call to MyMoneyStorageSql::writeFileInfo. It never gets there, though.
Comment 2 martin welsh 2010-09-02 17:17:33 UTC
On 02/09/10 14:35, Fernando Vilas wrote:
> https://bugs.kde.org/show_bug.cgi?id=249762
>
>
>
>
>
> --- Comment #1 from Fernando Vilas<fvilas iname com>   2010-09-02 15:35:36 ---
> By "Mysql database beleived to be in place", do you mean that you did a "save
> as database" from an existing .kmy file?
>
> The line where it is failing is on a call to MyMoneyStorageSql::writeFileInfo.
> It never gets there, though.
>
>    
The bug report was instigated by repeat crashes.
A database |K|MyMoney was created and permissions were granted to the 
kmymoney user outwith the Kmymoney programme.
The kmymoney file was then downloaded to the database and I deduce that 
this happened by the progress line displayed at the bottom of the screen 
after the command
was issued.
When you reload the KMymoney programme you are presented with a form so 
that you can recall the data.  If I enter my password (the only entry 
left active) and press the go button the bug is produced.

"mysql KMyMoney -u kmymoney user -p
show tables:"

produces;
> +---------------------------+
> | Tables_in_KMyMoney        |
> +---------------------------+
> | kmmAccounts               |
> | kmmBalances               |
> | kmmBudgetConfig           |
> | kmmCurrencies             |
> | kmmFileInfo               |
> | kmmInstitutions           |
> | kmmKeyValuePairs          |
> | kmmPayees                 |
> | kmmPrices                 |
> | kmmReportConfig           |
> | kmmSchedulePaymentHistory |
> | kmmSchedules              |
> | kmmSecurities             |
> | kmmSplits                 |
> | kmmTransactions           |
> +---------------------------+
> 15 rows in set (0.00 sec)

I hope that helps.

ps what is the mysql command that shows the table contents?

martin welsh
Comment 3 Fernando Vilas 2010-09-02 22:27:30 UTC
Can you provide the output from 'cat /proc/cpuinfo'? 

There was a bug related the the CMOV instruction a while back. It is the only thing that I have been able to find related to the point of failure in the backtrace above.
Comment 4 martin welsh 2010-09-03 20:12:32 UTC
On 02/09/10 21:27, Fernando Vilas wrote:
> https://bugs.kde.org/show_bug.cgi?id=249762
>
>
> Fernando Vilas<fvilas@iname.com>  changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |fvilas@iname.com
>
>
>
>
> --- Comment #3 from Fernando Vilas<fvilas iname com>   2010-09-02 22:27:30 ---
> Can you provide the output from 'cat /proc/cpuinfo'?
>
> There was a bug related the the CMOV instruction a while back. It is the only
> thing that I have been able to find related to the point of failure in the
> backtrace above.
>
>    
Here with cat /proc/cpuinfo as root after trying to start KMyMoney 
database retreival using kmymoney user password.
> windows martin # cat /proc/cpuinfo
> processor    : 0
> vendor_id    : AuthenticAMD
> cpu family    : 15
> model        : 75
> model name    : AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
> stepping    : 2
> cpu MHz        : 1000.000
> cache size    : 512 KB
> physical id    : 0
> siblings    : 2
> core id        : 0
> cpu cores    : 2
> apicid        : 0
> initial apicid    : 0
> fdiv_bug    : no
> hlt_bug        : no
> f00f_bug    : no
> coma_bug    : no
> fpu        : yes
> fpu_exception    : yes
> cpuid level    : 1
> wp        : yes
> flags        : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca 
> cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt 
> rdtscp lm 3dnowext 3dnow extd_apicid pni cx16 lahf_lm cmp_legacy svm 
> extapic cr8_legacy
> bogomips    : 2010.33
> clflush size    : 64
> cache_alignment    : 64
> address sizes    : 40 bits physical, 48 bits virtual
> power management: ts fid vid ttp tm stc
>
> processor    : 1
> vendor_id    : AuthenticAMD
> cpu family    : 15
> model        : 75
> model name    : AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
> stepping    : 2
> cpu MHz        : 1000.000
> cache size    : 512 KB
> physical id    : 0
> siblings    : 2
> core id        : 1
> cpu cores    : 2
> apicid        : 1
> initial apicid    : 1
> fdiv_bug    : no
> hlt_bug        : no
> f00f_bug    : no
> coma_bug    : no
> fpu        : yes
> fpu_exception    : yes
> cpuid level    : 1
> wp        : yes
> flags        : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca 
> cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt 
> rdtscp lm 3dnowext 3dnow extd_apicid pni cx16 lahf_lm cmp_legacy svm 
> extapic cr8_legacy
> bogomips    : 2010.33
> clflush size    : 64
> cache_alignment    : 64
> address sizes    : 40 bits physical, 48 bits virtual
> power management: ts fid vid ttp tm stc
>
I hope that helps.  I am happy to help with diagnosis.

martin
Comment 5 lnxusr 2010-09-10 07:04:19 UTC
I'm not sure my problem is related to this bug or not, but here's what happens to me while trying to use a mysql database.

I started out with a working kmymoney file and exported it to my mysql server.  Everything went fine there.  After closing kmymoney and restarting, I get an error window stating "Cannot open database sql://<myusername>@<myserver>/?driver=QMYSQL&secure=yes" (items enclsoed in '<>' are, of course, my info) and the details are:

Error in function int MyMoneyStorageSql::upgradeDb() : Error retrieving file info(version)
Driver = QMYSQL, Host = <myserver>, User = <myusername>, Database = 
Driver Error: 
Database Error No -1: 
Text:  
Error type 0
Executed: SELECT version FROM kmmFileInfo;
Query error No 1046: No database selected QMYSQL: Unable to execute query
Error type 2

I've compiled from source, so don't get a backtrace when it crashes, but the console output is the same as the details above.

Now, if I start kmymoney with the -n switch, I can open the mysql database from 'File-Open database'.  If, however, I try to use 'File-Open Recent' selecting the sql I get the same error window and details and kmymoney crashes.

I've edited mymoneystoragesql.cpp and hardcoded the database name at line 145 and it no longer crashes.  It seems wherever dbName is getting it's value from is an empty string or returning an error.
Comment 6 Tony B 2010-09-10 10:51:43 UTC
It certainly looks like we have a problem with passworded databases. This was a recent enhancement and something may have got lost in the port to KDE4. I'll look into it.

Does everything work okay if you remove the mysql password?
Comment 7 lnxusr 2010-09-10 13:31:04 UTC
@Tony:  Yes, it works fine if I remove the password.  I made sure I used the unmodified kmymoney.

Again though, it's only when kmymoney itself tries to open the database, either through the 'File-Open Recent' menu or on start up auto-loading the database.  Using 'File-Open database' works just fine.
Comment 8 Tony B 2010-09-12 17:35:18 UTC
Part of the problem here lies in the pseudo-URL we use. Where you have a
passworded database, the URL contains an ampersand (&) character. This is now
being interpreted, correctly I suspect, as the end of the command, hence the
following 'secure=yes', which indicates a password is needed, is getting
dropped. Try enclosing the URL in single quotes as follows:

kmymoney 'sql://<user>@localhost/KMyMoney?driver=QMYSQL&secure=yes'

I need to look at how we handle the matter of the recent files list.

There also seems to be a problem if we have more than one KMM database with different names. This seems to be a mysql problem only; further investigation in progress!
Comment 9 Alvaro Soliverez 2010-09-15 12:01:35 UTC
Is this bug similar to BUG 250300?
Comment 10 Fernando Vilas 2010-09-16 02:52:57 UTC
The conversation was, but the original bug was not. I cannot duplicate the original bug, but I have not tried Linux Mint yet.
Comment 11 lnxusr 2010-09-16 06:43:22 UTC
@Tony:  Enclosing the URL in single quotes gives the same results - the database name is still blank.
Comment 12 martin welsh 2010-09-16 10:01:27 UTC
On 16/09/10 01:52, Fernando Vilas wrote:
> https://bugs.kde.org/show_bug.cgi?id=249762
>
>
>
>
>
> --- Comment #10 from Fernando Vilas<fvilas iname com>   2010-09-16 02:52:57 ---
> The conversation was, but the original bug was not. I cannot duplicate the
> original bug, but I have not tried Linux Mint yet.
>
>    
Linux Mint is a user friendly Ubuntu.  I am using version 9.

martin welsh
Comment 13 Tony B 2010-09-16 16:02:04 UTC
 @ lnxusr - This should be fixed in the SVN version, a one-line patch to kselectdatabasedlg.cpp
Comment 14 lnxusr 2010-09-16 18:40:26 UTC
How do I checkout the svn?  All I can find is the web svn interface or instructions for KMyMoney2 csv.  No instructions for svn checkout, and I've never used svn before.
Comment 15 MK 2010-09-16 19:34:56 UTC
Just install the subversion package of your distro and do
svn co svn://anonsvn.kde.org/home/kde/trunk/extragear/office/kmymoney kmymoney
Comment 16 lnxusr 2010-09-18 07:25:02 UTC
Works great now.  Thank you.  I can now use my accounts between my laptop and desktop without having to manually transfer the data back and forth.
Comment 17 Cristian Oneț 2010-12-08 12:58:14 UTC
Closing this as duplicate since the fix mentioned by Tony (for the other bug) solved the reporter's problem.

*** This bug has been marked as a duplicate of bug 250300 ***