Commit 5f267b47 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix bugs found by application verifier :

- Fix  active lock in freed memory in ha_archive (share mutex was not released prior to free())
- Do not attempt vio_fastsend or vio_keepalive on named pipes and shared memory.
parent 8a376ae2
...@@ -357,6 +357,7 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc) ...@@ -357,6 +357,7 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc)
{ {
*rc= my_errno ? my_errno : -1; *rc= my_errno ? my_errno : -1;
pthread_mutex_unlock(&archive_mutex); pthread_mutex_unlock(&archive_mutex);
pthread_mutex_destroy(&share->mutex);
my_free(share, MYF(0)); my_free(share, MYF(0));
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
} }
......
...@@ -193,6 +193,11 @@ int vio_fastsend(Vio * vio __attribute__((unused))) ...@@ -193,6 +193,11 @@ int vio_fastsend(Vio * vio __attribute__((unused)))
int r=0; int r=0;
DBUG_ENTER("vio_fastsend"); DBUG_ENTER("vio_fastsend");
if (vio->type == VIO_TYPE_NAMEDPIPE ||vio->type == VIO_TYPE_SHARED_MEMORY)
{
DBUG_RETURN(0);
}
#if defined(IPTOS_THROUGHPUT) #if defined(IPTOS_THROUGHPUT)
{ {
int tos = IPTOS_THROUGHPUT; int tos = IPTOS_THROUGHPUT;
...@@ -228,7 +233,7 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive) ...@@ -228,7 +233,7 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive)
DBUG_ENTER("vio_keepalive"); DBUG_ENTER("vio_keepalive");
DBUG_PRINT("enter", ("sd: %d set_keep_alive: %d", vio->sd, (int) DBUG_PRINT("enter", ("sd: %d set_keep_alive: %d", vio->sd, (int)
set_keep_alive)); set_keep_alive));
if (vio->type != VIO_TYPE_NAMEDPIPE) if (vio->type != VIO_TYPE_NAMEDPIPE && vio->type != VIO_TYPE_SHARED_MEMORY)
{ {
if (set_keep_alive) if (set_keep_alive)
opt = 1; opt = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment