Fix to MXS-70: https://mariadb.atlassian.net/browse/MXS-70
Added assert information to error log.
This commit is contained in:
@ -93,12 +93,12 @@ if(PROFILE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "${FLAGS}")
|
set(CMAKE_C_FLAGS "${FLAGS}")
|
||||||
set(CMAKE_C_FLAGS_DEBUG "${DEBUG_FLAGS} -DSS_DEBUG")
|
set(CMAKE_C_FLAGS_DEBUG "${DEBUG_FLAGS} -DSS_DEBUG -DLOG_ASSERT")
|
||||||
set(CMAKE_C_FLAGS_RELEASE "")
|
set(CMAKE_C_FLAGS_RELEASE "")
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-ggdb")
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-ggdb")
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${FLAGS}")
|
set(CMAKE_CXX_FLAGS "${FLAGS}")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${DEBUG_FLAGS} -DSS_DEBUG")
|
set(CMAKE_CXX_FLAGS_DEBUG "${DEBUG_FLAGS} -DSS_DEBUG -DLOG_ASSERT")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "")
|
set(CMAKE_CXX_FLAGS_RELEASE "")
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-ggdb")
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-ggdb")
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ if(BUILD_TESTS OR BUILD_TOOLS)
|
|||||||
elseif(WITH_TCMALLOC)
|
elseif(WITH_TCMALLOC)
|
||||||
target_link_libraries(fullcore ${TCMALLOC_LIBRARIES})
|
target_link_libraries(fullcore ${TCMALLOC_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(fullcore ${CURL_LIBRARIES} log_manager utils pthread ${EMBEDDED_LIB} ${PCRE_LINK_FLAGS} ssl aio rt crypt dl crypto inih z m stdc++)
|
target_link_libraries(fullcore ${CURL_LIBRARIES} utils log_manager pthread ${EMBEDDED_LIB} ${PCRE_LINK_FLAGS} ssl aio rt crypt dl crypto inih z m stdc++)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(maxscale atomic.c buffer.c spinlock.c gateway.c
|
add_executable(maxscale atomic.c buffer.c spinlock.c gateway.c
|
||||||
|
@ -15,11 +15,11 @@ add_executable(test_adminusers testadminusers.c)
|
|||||||
add_executable(testmemlog testmemlog.c)
|
add_executable(testmemlog testmemlog.c)
|
||||||
add_executable(testfeedback testfeedback.c)
|
add_executable(testfeedback testfeedback.c)
|
||||||
target_link_libraries(test_mysql_users MySQLClient fullcore)
|
target_link_libraries(test_mysql_users MySQLClient fullcore)
|
||||||
target_link_libraries(test_hash fullcore)
|
target_link_libraries(test_hash fullcore log_manager)
|
||||||
target_link_libraries(test_hint fullcore)
|
target_link_libraries(test_hint fullcore log_manager)
|
||||||
target_link_libraries(test_spinlock fullcore)
|
target_link_libraries(test_spinlock fullcore log_manager)
|
||||||
target_link_libraries(test_filter fullcore)
|
target_link_libraries(test_filter fullcore)
|
||||||
target_link_libraries(test_buffer fullcore)
|
target_link_libraries(test_buffer fullcore log_manager)
|
||||||
target_link_libraries(test_dcb fullcore)
|
target_link_libraries(test_dcb fullcore)
|
||||||
target_link_libraries(test_modutil fullcore)
|
target_link_libraries(test_modutil fullcore)
|
||||||
target_link_libraries(test_poll fullcore)
|
target_link_libraries(test_poll fullcore)
|
||||||
@ -27,7 +27,7 @@ target_link_libraries(test_service fullcore)
|
|||||||
target_link_libraries(test_server fullcore)
|
target_link_libraries(test_server fullcore)
|
||||||
target_link_libraries(test_users fullcore)
|
target_link_libraries(test_users fullcore)
|
||||||
target_link_libraries(test_adminusers fullcore)
|
target_link_libraries(test_adminusers fullcore)
|
||||||
target_link_libraries(testmemlog fullcore)
|
target_link_libraries(testmemlog fullcore log_manager)
|
||||||
target_link_libraries(testfeedback fullcore)
|
target_link_libraries(testfeedback fullcore)
|
||||||
add_test(Internal-TestMySQLUsers test_mysql_users)
|
add_test(Internal-TestMySQLUsers test_mysql_users)
|
||||||
add_test(Internal-TestHash test_hash)
|
add_test(Internal-TestHash test_hash)
|
||||||
|
@ -464,9 +464,9 @@ bool check_time(char* str)
|
|||||||
|
|
||||||
|
|
||||||
#ifdef SS_DEBUG
|
#ifdef SS_DEBUG
|
||||||
#define CHK_TIMES(t)(ss_dassert(t->tm_sec > -1 && t->tm_sec < 62 \
|
#define CHK_TIMES(t) ss_dassert(t->tm_sec > -1 && t->tm_sec < 62 \
|
||||||
&& t->tm_min > -1 && t->tm_min < 60 \
|
&& t->tm_min > -1 && t->tm_min < 60 \
|
||||||
&& t->tm_hour > -1 && t->tm_hour < 24))
|
&& t->tm_hour > -1 && t->tm_hour < 24)
|
||||||
#else
|
#else
|
||||||
#define CHK_TIMES(t)
|
#define CHK_TIMES(t)
|
||||||
#endif
|
#endif
|
||||||
|
@ -1883,7 +1883,6 @@ static int routeQuery(
|
|||||||
bool succp = false;
|
bool succp = false;
|
||||||
|
|
||||||
CHK_CLIENT_RSES(router_cli_ses);
|
CHK_CLIENT_RSES(router_cli_ses);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GWBUF is called "type undefined" when the incoming data isn't parsed
|
* GWBUF is called "type undefined" when the incoming data isn't parsed
|
||||||
* and MySQL packets haven't been extracted to separate buffers.
|
* and MySQL packets haven't been extracted to separate buffers.
|
||||||
@ -3716,13 +3715,11 @@ static GWBUF* sescmd_cursor_process_replies(
|
|||||||
mysql_sescmd_t* scmd;
|
mysql_sescmd_t* scmd;
|
||||||
sescmd_cursor_t* scur;
|
sescmd_cursor_t* scur;
|
||||||
ROUTER_CLIENT_SES* ses;
|
ROUTER_CLIENT_SES* ses;
|
||||||
ROUTER_INSTANCE* router;
|
|
||||||
|
|
||||||
scur = &bref->bref_sescmd_cur;
|
scur = &bref->bref_sescmd_cur;
|
||||||
ss_dassert(SPINLOCK_IS_LOCKED(&(scur->scmd_cur_rses->rses_lock)));
|
ss_dassert(SPINLOCK_IS_LOCKED(&(scur->scmd_cur_rses->rses_lock)));
|
||||||
scmd = sescmd_cursor_get_command(scur);
|
scmd = sescmd_cursor_get_command(scur);
|
||||||
ses = (*scur->scmd_cur_ptr_property)->rses_prop_rsession;
|
ses = (*scur->scmd_cur_ptr_property)->rses_prop_rsession;
|
||||||
router = ses->router;
|
|
||||||
CHK_GWBUF(replybuf);
|
CHK_GWBUF(replybuf);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
add_library(utils skygw_utils.cc)
|
add_library(utils skygw_utils.cc)
|
||||||
target_link_libraries(utils stdc++)
|
add_dependencies(utils log_manager)
|
||||||
|
target_link_libraries(utils stdc++ log_manager)
|
||||||
|
@ -50,7 +50,21 @@
|
|||||||
# define ss_prof(exp)
|
# define ss_prof(exp)
|
||||||
#endif /* SS_DEBUG || SS_PROF */
|
#endif /* SS_DEBUG || SS_PROF */
|
||||||
|
|
||||||
#if defined(SS_DEBUG)
|
#if defined(SS_DEBUG) && defined(LOG_ASSERT)
|
||||||
|
#include <log_manager.h>
|
||||||
|
# define ss_dassert(exp) if(!(exp)){(skygw_log_write(LE,\
|
||||||
|
"debug assert %s:%d\n", \
|
||||||
|
(char*)__FILE__, \
|
||||||
|
__LINE__));skygw_log_sync_all();assert(exp);}
|
||||||
|
#define ss_info_dassert(exp,info) if(!(exp)){(skygw_log_write(LE,\
|
||||||
|
"debug assert %s:%d %s\n", \
|
||||||
|
(char*)__FILE__, \
|
||||||
|
__LINE__,info));skygw_log_sync_all();assert(exp);}
|
||||||
|
# define ss_debug(exp) exp
|
||||||
|
# define ss_dfprintf fprintf
|
||||||
|
# define ss_dfflush fflush
|
||||||
|
# define ss_dfwrite fwrite
|
||||||
|
#elif defined(SS_DEBUG)
|
||||||
|
|
||||||
# define ss_debug(exp) exp
|
# define ss_debug(exp) exp
|
||||||
# define ss_dfprintf fprintf
|
# define ss_dfprintf fprintf
|
||||||
|
Reference in New Issue
Block a user