[MDEV-19700] Crash with slowlog enabled Created: 2019-06-05  Updated: 2019-10-09

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.3.15, 10.4.6
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Chris Williams Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: crash
Environment:

FreeBSD 11.2 amd64


Attachments: File crash.cpp     Text File lldb-10.4.txt     File my.cnf     File test-db.sql     File test.sql    

 Description   

I've encountered a reproducible crash in 10.4.6 (hangs in 10.3.14/15/16).

Workaround:
Disable slow query log

Information:
Crashes and hang happens in debug and release builds.
Executing the attached query using mariadb c++ connector (crash.cpp) against 10.4.6 causes a crash
Executing the same query via the command line (test.sql) works correctly.
Executing the same expanded query (without parameters) works correctly (c++ connector, and command-line).
I repeated the same test on 10.3.14/15/16, and cpu goes to 90%, client never gets a reply... no timeout. Can supply debug trace.

After further investigation, the crash happens under the following conditions:
slow-query-log is enabled
using libmaridb.so.3 (test program attached)

Command Line:
[as used with attached files]
./mysqld --defaults-file=../../my.cnf -u mysql --basedir="${PWD}" --datadir=/tmp/mysql-data/10.4 --socket=/var/run/mysql/.sock --debug
[after further investigation...]
./mysqld --no-defaults -u mysql --basedir="${PWD}" --datadir=/tmp/mysql-data/10.4 --socket=/var/run/mysql/.sock --slow-query-log --debug

Attached Files:
lldb-10.4.txt: lldb session
mysqld-10.5.trace.tgz: mysqld.trace (15MB) (omitted after further investigation, can send on request)
my.cnf: Used config
test-db.sql: Database causing the issue
crash.cpp: Test program exhibiting the issue
test.sql: SQL for same query, that works correctly when executed from mysql command line.

System: FreeBSD 11.2-STABLE FreeBSD 11.2-STABLE #21 r346749: Fri Apr 26 15:55:57 UTC 2019 /usr/obj/usr/src/sys/GENERIC amd64
Building:

  1. cmake . \
    -DCONC_WITH_SSL=ON \
    -DCONC_WITH_UNIT_TESTS=OFF \
    -DCONNECT_WITH_JDBC=OFF \
    -DCONNECT_WITH_MONGO=OFF \
    -DCONNECT_WITH_ODBC=ON \
    -DCONNECT_WITH_VCT=ON \
    -DENABLED_PROFILING=OFF \
    -DPLUGIN_MROONGA=NO \
    -DPLUGIN_ROCKSDB=NO \
    -DWITH_INNODB_SNAPPY=OFF \
    -DPLUGIN_ROCKSDB=NO \
    -DPLUGIN_SPIDER=NO \
    -DPLUGIN_TOKUDB=NO \
    -DCMAKE_BUILD_TYPE=Debug
  2. cmake --build . --config Debug – -j8

Notes:
I investigated this after encountering no response from the 10.3.14 after adding some indexes to the `feature` table and modifying a query.


Generated at Thu Feb 08 08:53:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.