Bug 2361420

Summary: Digikam coredumps using mariadb-connectorc-c. Regression
Product: [Fedora] Fedora Reporter: Ian Dall <ian>
Component: mariadb-connector-cAssignee: Pavol Sloboda <psloboda>
Status: ASSIGNED --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 42CC: ljavorsk, mmuzila, mschorm
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ian Dall 2025-04-21 07:45:07 UTC
Description of problem:
Digikam, if configured to use mysql, coredumps (SIGSEGV) immediately on startup.  

Version-Release number of selected component (if applicable):

mariadb-connector-c-3.4.4-2.fc42

How reproducible:

Always

Steps to Reproduce:
1. Configure digikam with Database "MySQL Server"
2. Restart digikam
3.

Actual results:
digikam exits with a SIGSEGV fault.

Expected results:
Splash screen followed by normal startup

Additional info:

I am not using ssl and am using "mysql-native-password".

This appears to be fault in mariadb-connector rather than digikam. Downgrading to mariadb-connector-c-3.3.10-1.fc41 works with the same version of digikam.

Also, the running `gdb digikam` then (after receiving the SIGSEGV) reveals that the crash occurs because ma_hash_input is called with ctx=0x0, which in turn is because ma_hash_new(2) returns NULL, as if mariadb-connector-c has been built without support for any hash algorithms.

The mariadb CLI application works fine, but perhaps it uses libmysqlclient rather than mariadb-connector-c.

Comment 1 Michal Schorm 2025-04-28 14:34:23 UTC
Hi,
we will take a look.

Comment 2 Pavol Sloboda 2025-04-29 07:38:32 UTC
Hi,

I did not manage to recreate the bug using your description, could you please provide more info?
For example the architecture you are on or the version of digikam you are using?

Comment 3 Pavol Sloboda 2025-04-29 13:53:03 UTC
First i tried to reproduce it using mariadb-10.11.11-6.fc42, which did not result in said error.

But using 8.0.41-2.fc42 I have ,managed to recreate the bug by running:
mysql --default-auth=mysql_native_password
and then following this guide to set up the database: 
https://docs.digikam.org/en/setup_application/database_settings.html#the-mysql-internal-server
afterwards trying to set up digikam with MySQL Server results in a sigabort.

Comment 4 Pavol Sloboda 2025-04-30 15:06:44 UTC
I have tested and identified the code that causes the bug to occur and opened a ticket on the mariadb-connector-c
upstream jira:

https://jira.mariadb.org/browse/CONC-769