Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-2213

LP:909635 - MariaDB crashes in write_tail on a select from UTF8 tables with a simple join and order by

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      Hi guys

      We've found a query that crashes MariaDB both 5.2.9 and 5.2.10. This query is generated by CMS Joomla with Virtuemart plugin.

      Used platform: Debian GNU/Linux Squeeze amd64.

      The query:

      SELECT SQL_CALC_FOUND_ROWS * FROM `i1rsk_virtuemart_products_ru_ru` as l JOIN `i1rsk_virtuemart_products` AS p using (`virtuemart_product_id`) LEFT JOIN `i1rsk_virtuemart_product_categories` ON p.`virtuemart_product_id` = `i1rsk_virtuemart_product_categories`.`virtuemart_product_id` LEFT JOIN `i1rsk_virtuemart_categories_ru_ru` as c ON c.`virtuemart_category_id` = `i1rsk_virtuemart_product_categories`.`virtuemart_category_id` WHERE ( p.`published`="1" AND `i1rsk_virtuemart_product_categories`.`virtuemart_category_id` = 5) ORDER BY product_name ASC LIMIT 0, 10;

      I can also provide a test sql dump of database to reproduce this problem, but I can't be published, so I'd prefer to send it to someone's e-mail directly if possible.

      After executing this query, MariaDB crashes with the following information written in log:

      111229 9:28:14 [ERROR] mysqld got signal 11 ;
      This could be because you hit a bug. It is also possible that this binary
      or one of the libraries it was linked against is corrupt, improperly built,
      or misconfigured. This error can also be caused by malfunctioning hardware.
      We will try our best to scrape up some info that will hopefully help diagnose
      the problem, but since we have already crashed, something is definitely wrong
      and this may fail.

      key_buffer_size=0
      read_buffer_size=131072
      max_used_connections=1
      max_threads=402
      threads_connected=1
      It is possible that mysqld could use up to
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 879704 K
      bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.

      Thread pointer: 0x7f15067c6ef0
      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...
      stack_bottom = 0x7f14e7b57e98 thread_stack 0x48000
      /usr/sbin/mysqld(my_print_stacktrace+0x2e) [0x7f1503b171be]
      /usr/sbin/mysqld(handle_segfault+0x405) [0x7f15037535d5]
      /lib/libpthread.so.0(+0xef60) [0x7f1501d44f60]
      /lib/libc.so.6(memcpy+0xa0) [0x7f15012b67f0]
      /usr/sbin/mysqld(+0x5910ca) [0x7f15039860ca]
      /usr/sbin/mysqld(+0x591fc0) [0x7f1503986fc0]
      /usr/sbin/mysqld(_ma_write_init_block_record+0x149) [0x7f15039890b9]
      /usr/sbin/mysqld(maria_write+0x6f7) [0x7f1503951c27]
      /usr/sbin/mysqld(handler::ha_write_row(unsigned char*)+0x3c) [0x7f15038488ec]
      /usr/sbin/mysqld(+0x3d08f8) [0x7f15037c58f8]
      /usr/sbin/mysqld(+0x3be77e) [0x7f15037b377e]
      /usr/sbin/mysqld(sub_select(JOIN*, st_join_table*, bool)+0x206) [0x7f15037bf2c6]
      /usr/sbin/mysqld(+0x3be77e) [0x7f15037b377e]
      /usr/sbin/mysqld(sub_select(JOIN*, st_join_table*, bool)+0x206) [0x7f15037bf2c6]
      /usr/sbin/mysqld(+0x3be77e) [0x7f15037b377e]
      /usr/sbin/mysqld(sub_select(JOIN*, st_join_table*, bool)+0x206) [0x7f15037bf2c6]
      /usr/sbin/mysqld(+0x3be77e) [0x7f15037b377e]
      /usr/sbin/mysqld(sub_select(JOIN*, st_join_table*, bool)+0x6e) [0x7f15037bf12e]
      /usr/sbin/mysqld(+0x3ca537) [0x7f15037bf537]
      /usr/sbin/mysqld(JOIN::exec()+0x4c1) [0x7f15037d1901]
      /usr/sbin/mysqld(mysql_select(THD*, Item**, TABLE_LIST, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*)+0x12a) [0x7f15037d381a]
      /usr/sbin/mysqld(handle_select(THD*, st_lex*, select_result*, unsigned long)+0x15d) [0x7f15037d424d]
      /usr/sbin/mysqld(+0x369b0a) [0x7f150375eb0a]
      /usr/sbin/mysqld(mysql_execute_command(THD*)+0x40e) [0x7f1503760e4e]
      /usr/sbin/mysqld(mysql_parse(THD*, char*, unsigned int, char const**)+0x2c1) [0x7f1503766501]
      /usr/sbin/mysqld(dispatch_command(enum_server_command, THD*, char*, unsigned int)+0xcfb) [0x7f150376765b]
      /usr/sbin/mysqld(do_command(THD*)+0xf4) [0x7f1503768174]
      /usr/sbin/mysqld(handle_one_connection+0x14b) [0x7f150375a55b]
      /lib/libpthread.so.0(+0x68ba) [0x7f1501d3c8ba]
      /lib/libc.so.6(clone+0x6d) [0x7f150130602d]

      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7f15067e9278): SELECT SQL_CALC_FOUND_ROWS * FROM `i1rsk_virtuemart_products_ru_ru` as l JOIN `i1rsk_virtuemart_products` AS p using (`virtuemart_product_id`) LEFT JOIN `i1rsk_virtuemart_product_categories` ON p.`virtuemart_product_id` = `i1rsk_virtuemart_product_categories`.`virtuemart_product_id` LEFT JOIN `i1rsk_virtuemart_categories_ru_ru` as c ON c.`virtuemart_category_id` = `i1rsk_virtuemart_product_categories`.`virtuemart_category_id` WHERE ( p.`published`="1" AND `i1rsk_virtuemart_product_categories`.`virtuemart_category_id` = 5) ORDER BY product_name ASC LIMIT 0, 10
      Connection ID (thread ID): 12
      Status: NOT_KILLED

      Attachments

        Activity

          People

            monty Michael Widenius
            antonkhalikov Anton Khalikov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.