← Back to team overview

maria-developers team mailing list archive

Re: 9c2570e6c42: MDEV-22422: Assertion `! is_set()' failed in Diagnostics_area::set_eof_status

 

Hi, Rucha!

On Oct 21, Rucha Deodhar wrote:
> revision-id: 9c2570e6c42 (mariadb-10.1.43-279-g9c2570e6c42)
> parent(s): 5768f57d243
> author: Rucha Deodhar <rucha.deodhar@xxxxxxxxxxx>
> committer: Rucha Deodhar <rucha.deodhar@xxxxxxxxxxx>
> timestamp: 2020-09-22 17:18:37 +0530
> message:
> 
> MDEV-22422: Assertion `! is_set()' failed in Diagnostics_area::set_eof_status
> 
> Analysis: The error is not returned when the statement can't be used.
> And so we still go on to search for keywords.
> Fix: Return the error state.
> 
> diff --git a/mysql-test/t/errors.test b/mysql-test/t/errors.test
> index 55461002fd4..e2b10559299 100644
> --- a/mysql-test/t/errors.test
> +++ b/mysql-test/t/errors.test
> @@ -213,3 +213,22 @@ select * from seq_1_to_1000;
>  --enable_result_log
>  # We may not be able to execute any more queries with this connection
>  # because of too little memory#
> +
> +--echo #
> +--echo # 10.1 Test
> +--echo #
> +--echo # MDEV-22422: Assertion `! is_set()' failed in
> +--echo # Diagnostics_area::set_eof_status
> +--echo #
> +
> +SET @saved_max_session_mem_used = @@max_session_mem_used;
> +
> +SET max_session_mem_used = 50000;
> +--error ER_OPTION_PREVENTS_STATEMENT
> +help 'it is going to crash';
> +
> +SET @@max_session_mem_used=@saved_max_session_mem_used;
> +
> +--echo #
> +--echo # End of 10.1 Test
> +--echo #
> diff --git a/sql/sql_help.cc b/sql/sql_help.cc
> index cd9da566e51..654a3915b29 100644
> --- a/sql/sql_help.cc
> +++ b/sql/sql_help.cc
> @@ -736,6 +736,9 @@ static bool mysqld_help_internal(THD *thd, const char *mask)
>  			      &name, &description, &example);
>    delete select;
>  
> +  if (thd->is_error())
> +    goto error;

does the error happen during the first

  count_topics= search_topics()

?

There are lots of places below that look kind of fragile too. May be
they're safe. Or may be by increasing max_session_mem_used somewhat you
can get mysqld_help_internal to crash below again and again?

Could you look into that please?

>    if (count_topics == 0)
>    {
>      int UNINIT_VAR(key_id);
> 
Regards,
Sergei
VP of MariaDB Server Engineering
and security@xxxxxxxxxxx