[MDEV-22214] Windows: crash when mariadbd.exe tries to load plugin which is linked to mysqld.exe Created: 2020-04-10 Updated: 2020-04-12 Resolved: 2020-04-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Platform Windows |
| Affects Version/s: | 10.5 |
| Fix Version/s: | 10.5.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Vladislav Vaintroub | Assignee: | Vladislav Vaintroub |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
Example : https://ci.appveyor.com/project/rasmushoj/server/builds/32088322 There is a weird mix of mariadbd.exe and mysqld.exe in the crashes, in scenarious where plugins are used. Take a look how Create_tmp_table::add_schema_fields() from mariadbd.exe calls Type_handler_longlong::make_schema_field() from mysqld.exe below
Interestingly, this does not happen on buildbot, which has a slightly more recent Windows What happens is that one executable (mariadbd.exe) , e.g loads a shared library (plugin), which is "linked" to another executable(mysqld.exe), and on some reason some functions will then be taken from another exe. This can't work well, but on some reason it does on buildbot. Perhaps more recent Windows OS loader figures out that mysqld.exe is a hardlink to mariadbd.exe. |
| Comments |
| Comment by Vladislav Vaintroub [ 2020-04-10 ] |
|
delayloading server exe, with custom loader, that does not try to load a new ".exe", but uses a new one could be a workaround However using a large DLL, with the whole server functionality, to which both the "stub" server exe , and all bad plugins link, would eliminate the issue. We should also get rid of various GetProcAddress(GetModuleHandle(NULL), "name") random hacks for determining variable addresses, and replace it with regular MYSQL_PLUGIN_IMPORT. the hacks are random, because they are selectively used by some plugins, and not by the others. It will also simplify the coding, and get rid of possibility of accessing null pointers, on Windows. |
| Comment by Sergei Golubchik [ 2020-04-12 ] |
|
This is pushed already. Should the issue be closed or did the push happen by mistake? |
| Comment by Vladislav Vaintroub [ 2020-04-12 ] |
|
Nope, not a mistake. |