GnuCash
Contact   Instructions
Bug 797588 - Gnucash segfaults when using mysql backend with empty password
Summary: Gnucash segfaults when using mysql backend with empty password
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Backend - SQL (show other bugs)
Version: 3.8
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: core
QA Contact: core
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-18 19:57 EST by romain
Modified: 2020-01-19 17:07 EST (History)
3 users (show)

See Also:


Attachments
gnucash log file (16.34 MB, text/plain)
2020-01-18 19:57 EST, romain
no flags Details
macos report (77.49 KB, text/plain)
2020-01-18 22:30 EST, romain
no flags Details

Description romain 2020-01-18 19:57:52 EST
Created attachment 373539 [details]
gnucash log file

MySQL database before
---------------------
> MariaDB [gnucash]> SHOW TABLES;
> Empty set (0.001 sec)



How to reproduce
----------------
1/ Starts Gnucash:
> /Applications/Gnucash.app/Contents/MacOS/Gnucash --debug --logto gnucash.log --nofile

2/ Create a new file and save to MySQL
New file > Next... > Save using mysql



Output on console
-----------------
> Application Path /Applications/Gnucash.app/Contents/MacOS/Gnucash
> 
> (process:12987): gnc.gui-WARNING **: 19:46:07.187: [mac_find_close_country()] Apple Locale is set to a value en_FR not supported by the C runtime
> 
> (process:12987): gnc.gui-WARNING **: 19:46:07.189: [mac_find_close_country()] Using fr_FR instead.
> 
> (process:12987): gnc.gui-WARNING **: 19:46:07.190: [mac_set_languages()] Language list: en:fr
> Segmentation fault: 11


MySQL database after
--------------------
> MariaDB [gnucash]> SHOW TABLES;
> +-------------------+
> | Tables_in_gnucash |
> +-------------------+
> | gnclock           |
> +-------------------+
> 1 row in set (0.001 sec)
> 
> MariaDB [gnucash]> SELECT * FROM gnclock;
> +--------------------+-------+
> | Hostname           | PID   |
> +--------------------+-------+
> | laptop807872.local | 12987 |
> +--------------------+-------+
> 1 row in set (0.000 sec)



See logfile attached
Comment 1 romain 2020-01-18 22:30:34 EST
Created attachment 373540 [details]
macos report
Comment 2 John Ralls 2020-01-18 23:15:06 EST
Are you setting a password? It's crashing in strlen(password).
Comment 3 romain 2020-01-19 11:31:21 EST
Ha, that's it, so simple! I was doing a quick test on a localhost db (with root/no password).

I'll edit the bug report title to make it clear that using an empty password (which is bad, I know ;)), makes gnucash segfault.

Thx for the help!
Comment 4 John Ralls 2020-01-19 17:07:50 EST
Simple to fix, too. It will be in the next release.

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