Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
-
MXS-SPRINT-51
Description
In MXS-1529, each thread maintain a sqlite instance, openwith SQLITE_OPEN_NOMUTEX,
But I saw a stack :
#0 0x00007f1c1067df4d in __lll_lock_wait () from /lib64/libpthread.so.0
#1 0x00007f1c10679d02 in _L_lock_791 () from /lib64/libpthread.so.0
#2 0x00007f1c10679c08 in pthread_mutex_lock () from /lib64/libpthread.so.0
#3 0x00007f1c0a52d9fc in sqlite3Malloc () from /lib64/libsqlite3.so.0
#4 0x00007f1c0a52db41 in sqlite3DbMallocRaw () from /lib64/libsqlite3.so.0
#5 0x00007f1c0a56d5cf in exprAnalyze () from /lib64/libsqlite3.so.0
#6 0x00007f1c0a56e238 in exprAnalyzeAll () from /lib64/libsqlite3.so.0
#7 0x00007f1c0a56541d in sqlite3WhereBegin () from /lib64/libsqlite3.so.0
#8 0x00007f1c0a568755 in sqlite3Select () from /lib64/libsqlite3.so.0
#9 0x00007f1c0a57ab1a in sqlite3Parser () from /lib64/libsqlite3.so.0
#10 0x00007f1c0a57eb29 in sqlite3RunParser () from /lib64/libsqlite3.so.0
#11 0x00007f1c0a57f12a in sqlite3Prepare () from /lib64/libsqlite3.so.0
#12 0x00007f1c0a57f425 in sqlite3LockAndPrepare () from /lib64/libsqlite3.so.0
#13 0x00007f1c0a57f6c8 in sqlite3_prepare_v2 () from /lib64/libsqlite3.so.0
#14 0x00007f1c0a57f785 in sqlite3_exec () from /lib64/libsqlite3.so.0
#15 0x00007f1c0a7ce19c in validate_mysql_user (instance=instance@entry=0x7174e0, dcb=dcb@entry=0x7f1b7ff4f210, session=session@entry=0x7f1b7ff4f650, scramble=scramble@entry=0x7f1b7ff4f4d0 "@1QYXE+i?ZT-*?>8U\037
H", scramble_len=scramble_len@entry=20) at /home/wuzang.hdp/Code/MaxScale/server/modules/authenticator/MySQLAuth/dbusers.c:208
#16 0x00007f1c0a7cd18d in mysql_auth_authenticate (dcb=0x7f1b7ff4f210) at /home/wuzang.hdp/Code/MaxScale/server/modules/authenticator/MySQLAuth/mysql_auth.c:288
#17 0x00007f1c0a10a91d in gw_read_do_authentication (nbytes_read=<optimized out>, read_buffer=0x7f1b7f
Found in query_classifier/qc_sqlite/sqlite-src-3110100/src/main.c
/* Remove harmful bits from the flags parameter
**
- The SQLITE_OPEN_NOMUTEX and SQLITE_OPEN_FULLMUTEX flags were
- dealt with in the previous code block. Besides these, the only
- valid input flags for sqlite3_open_v2() are SQLITE_OPEN_READONLY,
- SQLITE_OPEN_READWRITE, SQLITE_OPEN_CREATE, SQLITE_OPEN_SHAREDCACHE,
- SQLITE_OPEN_PRIVATECACHE, and some reserved bits. Silently mask
- off all other flags.
*/
flags &= ~( SQLITE_OPEN_DELETEONCLOSE |
SQLITE_OPEN_EXCLUSIVE |
SQLITE_OPEN_MAIN_DB |
SQLITE_OPEN_TEMP_DB |
SQLITE_OPEN_TRANSIENT_DB |
SQLITE_OPEN_MAIN_JOURNAL |
SQLITE_OPEN_TEMP_JOURNAL |
SQLITE_OPEN_SUBJOURNAL |
SQLITE_OPEN_MASTER_JOURNAL |
SQLITE_OPEN_NOMUTEX |
SQLITE_OPEN_FULLMUTEX |
SQLITE_OPEN_WAL
);
So set flag SQLITE_OPEN_NOMUTEX is useless;