Running RQG outer_join test leads to crash

Bug #524025 reported by Hakan Küçükyılmaz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
High
Sergey Petrunia

Bug Description

Running RQG outer_join test crashes MariaDB. The crash happens on Linux 64-bit and Mac OS X Intel 64-bit. This crash happens with the patch for fixing Bug LP#523593

I attached the full stack trace from a Linux run.

How to repeat

* Get latest Random Query Generator from lp:randgen
* Get latest MariaDB from lp:maria
I tested with revno: 2818, timestamp: Wed 2010-02-17 21:10:02 +0100
* Compile MariaDB with BUILD/compile-amd64-max
* Run the RQG test like

time perl runall.pl \
  --basedir=${HOME}/work/monty_program/maria \
  --gendata=conf/outer_join.zz \
  --grammar=conf/outer_join.yy \
  --queries=1000000 \
  --threads=1

Stack trace on Mac OS X
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x11261d590
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
# 20:42:09 datadir is /Users/hakan/work/monty_program/maria/mysql-test/var/master-data/
# 20:42:09 binary is /Users/hakan/work/monty_program/maria/mysql-test//../sql/mysqld
# 20:42:09 bindir is /Users/hakan/work/monty_program/maria/mysql-test//../sql
# 20:42:09 core is /cores/core.68773
# 20:42:13 Reading symbols for shared libraries .... done
# 20:42:13 Reading symbols for shared libraries . done
# 20:42:13 Reading symbols for shared libraries .... done
# 20:42:13 #0 0x00007fff86e8e9e2 in select$DARWIN_EXTSN ()
# 20:42:13 #0 0x00007fff86e8e9e2 in select$DARWIN_EXTSN ()
# 20:42:13 #1 0x00000001000f8522 in handle_connections_sockets (arg=<value temporarily unavailable, due to optimizations>) at mysqld.cc:5197
# 20:42:13 #2 0x00000001000f936f in main (argc=<value temporarily unavailable, due to optimizations>, argv=<value temporarily unavailable, due to optimizations>) at mysqld.cc:4668
Previous frame inner to this frame (gdb could not unwind past this frame)
# 20:42:16 Reading symbols for shared libraries .... done
# 20:42:16 Reading symbols for shared libraries . done
# 20:42:16 Reading symbols for shared libraries .... done
# 20:42:16 #0 0x00007fff86e8e9e2 in select$DARWIN_EXTSN ()
# 20:42:16
# 20:42:16 Thread 24 (core thread 23):
# 20:42:16 #0 0x00007fff86e8c250 in pthread_get_stackaddr_np ()
# 20:42:16 #1 0x00007fff86ebe9c1 in backtrace ()
# 20:42:16 #2 0x00007fff86ebe967 in backtrace ()
# 20:42:16 #3 0x00000001004f7809 in my_print_stacktrace (stack_bottom=0x1 <Address 0x1 out of bounds>, thread_stack=294912) at stacktrace.c:111
# 20:42:16 #4 0x00000001000f24e2 in handle_segfault (sig=11) at mysqld.cc:2584
# 20:42:16 #5 <signal handler called>
# 20:42:16 #6 set_position (join=0x106056618, idx=<value temporarily unavailable, due to optimizations>, table=0x1063c1dd0, key=<value temporarily unavailable, due to optimizations>) at sql_select.cc:4150
# 20:42:16 #7 0x000000010028964f in eliminate_tables_for_list (join=0x106056618, join_list=<value temporarily unavailable, due to optimizations>, list_tables=255, on_expr=0x0, tables_used_elsewhere=31) at opt_table_elimination.cc:1785
# 20:42:16 #8 0x0000000100171ff1 in make_join_statistics (join=<value temporarily unavailable, due to optimizations>, tables_arg=0x106099878, conds=0x106316fe8, keyuse_array=0x106057be0) at sql_select.cc:2708
# 20:42:16 #9 0x00000001150f1ef0 in ?? ()
# 20:42:16

Tags: rqg
Revision history for this message
Hakan Küçükyılmaz (hakan-askmonty) wrote :
Revision history for this message
Hakan Küçükyılmaz (hakan-askmonty) wrote :
Revision history for this message
Sergey Petrunia (sergefp) wrote :

Query that causes the crash:

SELECT
  table3.col_int AS field1,
  table1.col_int AS field2,
  table1.col_int_key AS field3,
  table1.pk AS field4,
  table1.col_int AS field5,
  table2.col_int AS field6
FROM
  CC AS table1
  LEFT OUTER JOIN
  K AS table2
  LEFT JOIN Z AS table3
  RIGHT JOIN H AS table4
  LEFT JOIN M AS table5 ON table4.pk = table5.pk
  LEFT JOIN A AS table6 ON table5.col_int_key = table6.pk
  ON table3.col_int_key = table5.pk
  ON table2.col_varchar_1024_latin1_key = table5.col_varchar_10_utf8_key
  LEFT JOIN O AS table7 ON table2.pk = table7.col_int
  ON table1.col_varchar_10_latin1 = table5.col_varchar_1024_latin1_key
  LEFT JOIN E AS table8 ON table3.col_int = table8.col_int
WHERE
  table1.col_int_key < table2.pk
HAVING
  field4 != 6

Revision history for this message
Sergey Petrunia (sergefp) wrote :

Test dataset from RQG.

Revision history for this message
Sergey Petrunia (sergefp) wrote :
Changed in maria:
status: New → In Progress
importance: Undecided → Medium
importance: Medium → High
assignee: nobody → Sergey Petrunia (sergefp)
Revision history for this message
Sergey Petrunia (sergefp) wrote :

With the fix applied, outer_join.yy will still crash the server. That crash seems to an unrelated problem as it can be repeated in mainline 5.1, too, with the same stack trace. See http://bugs.mysql.com/bug.php?id=51780.

Changed in maria:
status: In Progress → Fix Committed
Revision history for this message
Sergey Petrunia (sergefp) wrote :

The fix was pushed into 5.2 some time ago.

Changed in maria:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.