Bug #118122 Exception Loading keyring_file.dll on Windows in v8.0.41
Submitted: 6 May 16:07 Modified: 7 May 12:01
Reporter: Doug Fresh Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:8.0.41 OS:Windows (Windows 11)
Assigned to: CPU Architecture:x86

[6 May 16:07] Doug Fresh
Description:
With keyring_file.dll enabled in my.ini version 8.0.41 throws an exception at startup:

2025-05-06T14:57:58.967591Z 0 [Warning] [MY-000081] [Server] option 'net_buffer_length': unsigned value 8388608 adjusted to 1048576.
2025-05-06T14:57:58.967615Z 0 [Warning] [MY-010086] [Server] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2025-05-06T14:57:58.967817Z 0 [System] [MY-010116] [Server] C:\work\development\server\svc\mysql\bin\CIPDev.DB.exe (mysqld 8.0.41) starting as process 24820
2025-05-06T14:57:58Z UTC - mysqld got exception 0xc0000005 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
2e299ec
7ff7c050fc02    mysqld.exe!?fs_character_set@@YAPEAUCHARSET_INFO@@XZ()
7ff7c050cb11    mysqld.exe!?dirname_length@@YA_KPEBD@Z()
7ff7c050cbc6    mysqld.exe!?dirname_part@@YA_KPEADPEBDPEA_K@Z()
7fffefb249c0    keyring_file.dll!???
7fffefb2b4f9    keyring_file.dll!???
7ff7d9094f7e    CIPDev.DB.exe!?plugin_foreach_with_mask@@YA_NPEAVTHD@@PEAP6A_N0PEAUst_plugin_int@@PEAX@ZHI2@Z()
7ff7d9094603    CIPDev.DB.exe!?plugin_foreach_with_mask@@YA_NPEAVTHD@@PEAP6A_N0PEAUst_plugin_int@@PEAX@ZHI2@Z()
7ff7d9097171    CIPDev.DB.exe!?plugin_register_early_plugins@@YA_NPEAHPEAPEADH@Z()
7ff7d902a112    CIPDev.DB.exe!?init_common_variables@@YAHXZ()
7ff7d90354f6    CIPDev.DB.exe!?win_main@@YAHHPEAPEAD@Z()
7ff7d902eca5    CIPDev.DB.exe!?mysql_service@@YAHPEAX@Z()
7ff7d902f2ab    CIPDev.DB.exe!?mysqld_main@@YAHHPEAPEAD@Z()
7ff7da933884    CIPDev.DB.exe!?vio_write_shared_memory@@YA_KPEAUVio@@PEBE_K@Z()
7ff80d1de8d7    KERNEL32.DLL!BaseThreadInitThunk()
7ff80d7714fc    ntdll.dll!RtlUserThreadStart()

I also tested this on 8.0.21 and 8.0.36 with the same exception.  Checking our release history this previously worked in 5.7.x and POSSIBLY 8.0.15 but I do not have a test case for 8.0.15 at this time.

How to repeat:
Add the following to configuration:

[mysqld]
early-plugin-load=keyring_file.dll
component_keyring_file_data ="C:/test/keyring"

Then start mysqld to observe the exception.  I ran manually with --console --standalone in my description above.

It seems to be the early-plugin-load directive.  component_keyring_file_data can be removed and the results are the same.
[7 May 12:01] Doug Fresh
I found the solution (or workaround) and lowered this to Non-Critical.  In case anyone finds this useful in the future ... I had renamed mysqld.exe to another name which works fine otherwise except it causes encryption at rest to throw an exception at initialization.  I am unsure why, but if you have this exception check the name of the executable you are running mysqld under; it must be mysqld.exe or it will throw this exception.
[7 May 12:13] MySQL Verification Team
Thank you for the feedback.