diff --git a/deps/Makefile b/deps/Makefile index 9f0069454..7eb74c0b5 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -58,6 +58,7 @@ re2/re2/obj/libre2.a: cd re2 && tar -zxf re2-20140304.tgz cd re2/re2 && sed -i -e 's/-O3 -g /-O3 -fPIC /' Makefile # cd re2 && patch re2/util/mutex.h < mutex.h.patch + cd re2/re2 && sed -i -e 's/-O3 /-O3 -DMEMORY_SANITIZER /' Makefile cd re2/re2 && CC=${CC} CXX=${CXX} ${MAKE} re2: re2/re2/obj/libre2.a diff --git a/lib/MySQL_Thread.cpp b/lib/MySQL_Thread.cpp index c1c8d3b10..2ea3b9d1b 100644 --- a/lib/MySQL_Thread.cpp +++ b/lib/MySQL_Thread.cpp @@ -2499,8 +2499,10 @@ __run_skip_2: } } else { //spin_wrlock(&GloMTH->rwlock_resumes); + VALGRIND_DISABLE_ERROR_REPORTING; pthread_mutex_lock(&thr->myexchange.mutex_resumes); - if (shutdown==0 && thr->shudown==0 && thr->myexchange.resume_mysql_sessions->len) { + VALGRIND_ENABLE_ERROR_REPORTING; + if (shutdown==0 && thr->shutdown==0 && thr->myexchange.resume_mysql_sessions->len) { //unsigned int w=rand()%(GloMTH->num_threads); //w++; unsigned char c=0; @@ -2511,7 +2513,9 @@ __run_skip_2: } } //spin_wrunlock(&GloMTH->rwlock_resumes); + VALGRIND_DISABLE_ERROR_REPORTING; pthread_mutex_unlock(&thr->myexchange.mutex_resumes); + VALGRIND_ENABLE_ERROR_REPORTING; } } else { // iterate through all sessions and process the session logic diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index 9d8ce966e..0bc840ebb 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -2409,7 +2409,10 @@ __end_while_pool: char *add=NULL; char *port=NULL; close(fds[i].fd); c_split_2(socket_names[i], ":" , &add, &port); - if (atoi(port)==0) { unlink(socket_names[i]); } + if (atoi(port)==0) { + if (socket_names[i]) + unlink(socket_names[i]); + } } free(arg); return NULL; diff --git a/src/main.cpp b/src/main.cpp index b8a888a0f..a7da9e7c7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -128,9 +128,11 @@ using namespace std; static volatile int load_; //__thread l_sfp *__thr_sfp=NULL; - -//const char *malloc_conf = "xmalloc:true,lg_tcache_max:16,purge:decay"; -const char *malloc_conf = "xmalloc:true,lg_chunk:18,lg_tcache_max:12,purge:ratio"; +//#ifdef DEBUG +//const char *malloc_conf = "xmalloc:true,lg_tcache_max:16,purge:decay,junk:true,tcache:false"; +//#else +const char *malloc_conf = "xmalloc:true,lg_tcache_max:16,purge:decay"; +//#endif /* DEBUG */ //const char *malloc_conf = "prof_leak:true,lg_prof_sample:0,prof_final:true,xmalloc:true,lg_tcache_max:16"; int listen_fd;