← Back to team overview

maria-developers team mailing list archive

Re: [Maria-discuss] Problem with MariaDb as a Windows service

 

Hi!

>>>>> "Alex" == Alex Budovski <abudovski@xxxxxxxxx> writes:

Alex> Looks like the relevant code change and resulting bug was introduced
Alex> in Rev: 2502.1070.1

Alex> revno: 2502.1070.1
Alex> branch nick: 5.1-bugteam-bug29751
Alex> timestamp: Wed 2010-08-25 15:47:45 +0700  // the date looks recent enough.
Alex> message:
Alex>   Fixed bug #29751 - do not rename the error log at FLUSH LOGS.
Alex>   Added open log file with FILE_SHARE_DELETE flag on Windows.

Alex> I tracked it down to line 4649 of mysqld.cc:

Alex> #ifdef __WIN__
Alex>   if (!opt_console)
Alex>   {
Alex>     if (reopen_fstreams(log_error_file, stdout, stderr))  // ** this
Alex> fails when run as a service/without console.
Alex>       unireg_abort(1);  // ** application terminates here!
Alex>     setbuf(stderr, NULL);
Alex>     FreeConsole();
Alex>   }
Alex> #endif

Alex> Hence the SCM reports that the service terminated unexpectedly.

Alex> The problem is that when a process does not have a console allocated
Alex> to it, the standard C streams stdout, stderr, etc, are not valid, and
Alex> hence _fileno (used inside reopen_fstreams returns -2), which in turn
Alex> causes dup2() to fail, and reopen_fstreams() to fail.

Thanks for the good bug report.

I am just now merging MySQL 5.1.53 into MariaDB and they have fixed
reopen_fstreams() to take care of this issue.

We hope to be able to release 5.1.53 in a few days. After that I will
merge the change to MariaDB 5.2 and do a release of this.

Regards,
Monty



References