Bug #60167 "Attempt to read or write protected memory" if MariaDB service is installed
Submitted: 18 Feb 2011 13:06 Modified: 2 Dec 2012 17:48
Reporter: Vladislav Vaintroub Email Updates:
Status: Closed Impact on me:
Category:MySQL Workbench: Administration Severity:S3 (Non-critical)
Version:5.2.31-CE OS:Windows
Assigned to: CPU Architecture:Any

[18 Feb 2011 13:06] Vladislav Vaintroub
I installed mariadb 5.2.4 from zip archive
here http://askmonty.org/wiki/MariaDB:Download:MariaDB_5.2.4

and registered as service

C:\mariadb-5.2.4-win32>bin\mysqld.exe --install MariaDB "--defaults-file=C:\mari
Service successfully installed.

The service starts without problems.

When I use WB to register a new instance, using "new server instance", and click through to "Management and OS" .  Here, WB brings  "Attempt to read or write protected memory" popup and encourages to report a bug.

How to repeat:
Follow the steps in description.
[18 Feb 2011 13:09] Vladislav Vaintroub
popup that encouraged me to report this bug

Attachment: wb.png (image/x-png, text), 68.40 KiB.

[18 Feb 2011 13:52] Peter Laursen
There are lots (I think at least 20) of similar reports with the 'official' MySQL server.  I doubt this is MariaDB related at all. 

(not a MySQL person)
[18 Feb 2011 14:54] Vladislav Vaintroub
mysql 5.5.9 worked ok for me.
[18 Feb 2011 15:04] Vladislav Vaintroub
FWIW, the service configuration 

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>sc qc mariadb
[SC] QueryServiceConfig SUCCESS

        TYPE               : 10  WIN32_OWN_PROCESS
        START_TYPE         : 2   AUTO_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : C:\mariadb-5.2.4-win32\bin\mysqld.exe --defaults-fi
le=C:\mariadb-5.2.4-win32\my-large.ini MariaDB
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : MariaDB
        DEPENDENCIES       :
        SERVICE_START_NAME : LocalSystem
[18 Feb 2011 15:15] Peter Laursen
A simple search finding similar issues from the last 1-2 weeks: 


I have seen those reports repeating themselves for months. I am serious when I say I think that there are 20 or more identical/similar reports with 5.2.31. And they mostly get marked as 'QA testing' and nothing happens. So seems it is not easy to identify what is going on.
[18 Feb 2011 19:22] Peter Laursen
Also see: http://bugs.mysql.com/bug.php?id=60170
[18 Feb 2011 21:50] Alfredo Kojima
Do you have any mysql services installed?
[18 Feb 2011 21:54] Alfredo Kojima
Clarifying, I meant whether you have any mysql services actually named as mysql. What if your MariaDB service is renamed to, say, mysqltest?
[19 Feb 2011 0:42] Vladislav Vaintroub
I renamed it to mysqlfoo. As if by magic, this instance was detected, I even did not have to register new instance myself. This is a nice behavior, would be great if it did not dependent on "mysql" prefix in name.
[24 Feb 2011 20:59] Alfredo Kojima
We need some way to know if a service belongs to MySQL, the default MySQL installer uses mysql as service name. Anything else could be anything else :)
[24 Feb 2011 21:19] Peter Laursen
I think it is fairly OK to assume the prefix 'mysql' in the first place.  But user should have an option to add more services to the 'pool of services' considered by WB. That is why I proposed a 'more' button.
[24 Feb 2011 21:35] Vladislav Vaintroub
Would not parsed binPath of the service be sufficient?

It is a command line, parsable with CommandLineToArgvW(). The executable is mysqld, mysqld-nt, mysqld.exe, mysqld-nt.exe.

Optional command line parameter is --defaults-file=<path>. There is another command line parameter that is the same as service name. That sounds like much better heuristic to me:

binPath:  path\to\mysqld(_nt)?(.exe)? [--defaults-file=<path>] <servicename>

MySQL documentation for "mysqld --install" never mentioned anything about name choice for the service :)
[26 Feb 2011 13:14] Valeriy Kravchuk
OK, so looks like:

1. MySQL Workbench should be smarter when searching for Windows service that represents MySQL server.

2. It should not crash when does not find a service (this is a topic of other bug reports)
[2 Dec 2012 17:48] Vladislav Vaintroub