[MDEV-4815] Calling mysql_library_init twice in same process SEGFAULTs Created: 2013-07-25  Updated: 2013-07-29  Due: 2013-07-25  Resolved: 2013-07-29

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.32
Fix Version/s: 5.5.33

Type: Bug Priority: Critical
Reporter: Vilho Raatikka Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 1
Labels: None
Environment:

libmysqld on Linux linux-yxkl.site 3.7.10-1.16-desktop #1 SMP PREEMPT Fri May 31 20:21:23 UTC 2013 (97c14ba) x86_64 x86_64 x86_64 GNU/Linux



 Description   

Reason is that static variable init_settings struct is not reset in mysql_library_end. More detailed description below.

Test to reproduce:

mysql_library_init(...)
mysql_library_end()
mysql_library_init(...)

In dbug.c there is a static varibale init_done. Once set to TRUE in code_state(), it remains TRUE. In code_state there is an important operations behind it, for example, setting the outfile for struct init_settings.

if init_settings.outfile is NULL server will end up SEGFAULT due to null-pointer reference in dbug.c:_db_flush. Problem is that outfile is set to NULL when mysql_library_end is called in DBUGCloseFile. Thus, once mysql_library_end is called embedded server can't be used anymore because init_settings struct won't be reinitialized.

The ability to use embedded server for several purposes is crucial for gateway, thus, I'd respect your insight on this.


Generated at Thu Feb 08 06:59:24 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.