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

ASAN error in mariadb client with \c

Details

    Description

      Welcome to the MariaDB monitor.  Commands end with ; or \g.
      Your MariaDB connection id is 10
      Server version: 10.11.10-MariaDB Source distribution
       
      Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
       
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
       
      MariaDB [(none)]> c
          -> \c
      =================================================================
      ==505004==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x50e000002ca0 at pc 0x0000004cbee8 bp 0x7ffdd587fd10 sp 0x7ffdd587f4d8
      READ of size 137 at 0x50e000002ca0 thread T0
          #0 0x4cbee7 in strdup (/home/dan/repos/build-mariadb-server-10.11/client/mariadb+0x4cbee7) (BuildId: aa0149a747a2d118d0a2e0ec405914b2591af196)
          #1 0x7f91ef87f0d8  (/lib64/libedit.so.0+0x190d8) (BuildId: b74fa9389766acce34b5e7401fba60dbbdd1dc3e)
          #2 0x7f91ef88595a in history (/lib64/libedit.so.0+0x1f95a) (BuildId: b74fa9389766acce34b5e7401fba60dbbdd1dc3e)
          #3 0x7f91ef88846e in add_history (/lib64/libedit.so.0+0x2246e) (BuildId: b74fa9389766acce34b5e7401fba60dbbdd1dc3e)
          #4 0x5366b1 in fix_history(String*) /home/dan/repos/mariadb-server-10.11/client/mysql.cc:2881:5
          #5 0x530b99 in com_clear(String*, char*) /home/dan/repos/mariadb-server-10.11/client/mysql.cc:3409:5
          #6 0x52c31c in add_line(String&, char*, unsigned long, char*, bool*, bool) /home/dan/repos/mariadb-server-10.11/client/mysql.cc:2591:13
          #7 0x52c31c in read_and_execute(bool) /home/dan/repos/mariadb-server-10.11/client/mysql.cc:2345:9
          #8 0x5268d3 in main /home/dan/repos/mariadb-server-10.11/client/mysql.cc:1386:23
          #9 0x7f91eec39087 in __libc_start_call_main (/lib64/libc.so.6+0x2a087) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)
          #10 0x7f91eec3914a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2a14a) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)
          #11 0x449194 in _start (/home/dan/repos/build-mariadb-server-10.11/client/mariadb+0x449194) (BuildId: aa0149a747a2d118d0a2e0ec405914b2591af196)
       
      0x50e000002ca0 is located 0 bytes after 160-byte region [0x50e000002c00,0x50e000002ca0)
      allocated by thread T0 here:
          #0 0x4e3fe3 in malloc (/home/dan/repos/build-mariadb-server-10.11/client/mariadb+0x4e3fe3) (BuildId: aa0149a747a2d118d0a2e0ec405914b2591af196)
          #1 0x5e3390 in my_malloc /home/dan/repos/mariadb-server-10.11/mysys/my_malloc.c:92:29
          #2 0x545da7 in Binary_string::realloc_raw(unsigned long) /home/dan/repos/mariadb-server-10.11/sql/sql_string.cc:104:32
          #3 0x545da7 in Binary_string::realloc_with_extra(unsigned long) /home/dan/repos/mariadb-server-10.11/sql/sql_string.h:820:9
          #4 0x540ba3 in Binary_string::realloc_with_extra_if_needed(unsigned long) /home/dan/repos/mariadb-server-10.11/sql/sql_string.h:832:12
          #5 0x540ba3 in Binary_string::append(char const*, unsigned long) /home/dan/repos/mariadb-server-10.11/sql/sql_string.h:670:9
          #6 0x540ba3 in String::append(char const*, unsigned long) /home/dan/repos/mariadb-server-10.11/sql/sql_string.cc:568:25
          #7 0x53653a in fix_history(String*) /home/dan/repos/mariadb-server-10.11/client/mysql.cc:2876:20
          #8 0x530b99 in com_clear(String*, char*) /home/dan/repos/mariadb-server-10.11/client/mysql.cc:3409:5
          #9 0x52c31c in add_line(String&, char*, unsigned long, char*, bool*, bool) /home/dan/repos/mariadb-server-10.11/client/mysql.cc:2591:13
          #10 0x52c31c in read_and_execute(bool) /home/dan/repos/mariadb-server-10.11/client/mysql.cc:2345:9
          #11 0x5268d3 in main /home/dan/repos/mariadb-server-10.11/client/mysql.cc:1386:23
          #12 0x7f91eec39087 in __libc_start_call_main (/lib64/libc.so.6+0x2a087) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)
          #13 0x7f91eec3914a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x2a14a) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)
          #14 0x449194 in _start (/home/dan/repos/build-mariadb-server-10.11/client/mariadb+0x449194) (BuildId: aa0149a747a2d118d0a2e0ec405914b2591af196)
       
      SUMMARY: AddressSanitizer: heap-buffer-overflow (/home/dan/repos/build-mariadb-server-10.11/client/mariadb+0x4cbee7) (BuildId: aa0149a747a2d118d0a2e0ec405914b2591af196) in strdup
      Shadow bytes around the buggy address:
        0x50e000002a00: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
        0x50e000002a80: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa
        0x50e000002b00: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
        0x50e000002b80: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa
        0x50e000002c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      =>0x50e000002c80: 00 00 00 00[fa]fa fa fa fa fa fa fa fa fa fa fa
        0x50e000002d00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x50e000002d80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x50e000002e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x50e000002e80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
        0x50e000002f00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      Shadow byte legend (one shadow byte represents 8 application bytes):
        Addressable:           00
        Partially addressable: 01 02 03 04 05 06 07 
        Heap left redzone:       fa
        Freed heap region:       fd
        Stack left redzone:      f1
        Stack mid redzone:       f2
        Stack right redzone:     f3
        Stack after return:      f5
        Stack use after scope:   f8
        Global redzone:          f9
        Global init order:       f6
        Poisoned by user:        f7
        Container overflow:      fc
        Array cookie:            ac
        Intra object redzone:    bb
        ASan internal:           fe
        Left alloca redzone:     ca
        Right alloca redzone:    cb
      ==505004==ABORTING
      

      Attachments

        Activity

          alice Alice Sherepa added a comment -

          also on 10.6-11.6, but not on 10.5

          10.6 e8db5c8760a763ac89781652204e82f801a028b1

          =================================================================
          ==556606==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6120000173d4 at pc 0x7f739be37292 bp 0x7fff21e2e2a0 sp 0x7fff21e2da48
          READ of size 141 at 0x6120000173d4 thread T0
              #0 0x7f739be37291 in __interceptor_strlen ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:461
              #1 0x55cdcf1ba3da in alloc_history_entry /10.6/src/extra/readline/history.c:221
              #2 0x55cdcf1ba9bb in add_history /10.6/src/extra/readline/history.c:309
              #3 0x55cdcf073111 in fix_history /10.6/src/client/mysql.cc:2775
              #4 0x55cdcf075fff in com_clear /10.6/src/client/mysql.cc:3303
              #5 0x55cdcf071278 in add_line /10.6/src/client/mysql.cc:2485
              #6 0x55cdcf06fc03 in read_and_execute /10.6/src/client/mysql.cc:2236
              #7 0x55cdcf06d54c in main /10.6/src/client/mysql.cc:1297
              #8 0x7f739b415082 in __libc_start_main ../csu/libc-start.c:308
              #9 0x55cdcf06b64d in _start (/10.6/bld/client/mariadb+0x10164d) (BuildId: 44bfe674fff6bb59d741958c122bf425a84abf99)
           
          0x6120000173d4 is located 0 bytes after 276-byte region [0x6120000172c0,0x6120000173d4)
          allocated by thread T0 here:
              #0 0x7f739beac8ff in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69
              #1 0x55cdcf172702 in sf_malloc /10.6/src/mysys/safemalloc.c:126
              #2 0x55cdcf1601ec in my_malloc /10.6/src/mysys/my_malloc.c:91
              #3 0x55cdcf086d48 in Binary_string::realloc_raw(unsigned long) /10.6/src/sql/sql_string.cc:104
              #4 0x55cdcf08424c in Binary_string::realloc_with_extra(unsigned long) /10.6/src/sql/sql_string.h:820
              #5 0x55cdcf0843a4 in Binary_string::realloc_with_extra_if_needed(unsigned long) /10.6/src/sql/sql_string.h:832
              #6 0x55cdcf083947 in Binary_string::append(char const*, unsigned long) /10.6/src/sql/sql_string.h:670
              #7 0x55cdcf0899fb in String::append(char const*, unsigned long) /10.6/src/sql/sql_string.cc:568
              #8 0x55cdcf07309b in fix_history /10.6/src/client/mysql.cc:2770
              #9 0x55cdcf075fff in com_clear /10.6/src/client/mysql.cc:3303
              #10 0x55cdcf071278 in add_line /10.6/src/client/mysql.cc:2485
              #11 0x55cdcf06fc03 in read_and_execute /10.6/src/client/mysql.cc:2236
              #12 0x55cdcf06d54c in main /10.6/src/client/mysql.cc:1297
              #13 0x7f739b415082 in __libc_start_main ../csu/libc-start.c:308
           
          SUMMARY: AddressSanitizer: heap-buffer-overflow ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:461 in __interceptor_strlen
          Shadow bytes around the buggy address:
            0x612000017100: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
            0x612000017180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
            0x612000017200: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa
            0x612000017280: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
            0x612000017300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
          =>0x612000017380: 00 00 00 00 00 00 00 00 00 00[04]fa fa fa fa fa
            0x612000017400: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
            0x612000017480: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
            0x612000017500: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
            0x612000017580: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
            0x612000017600: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
          Shadow byte legend (one shadow byte represents 8 application bytes):
            Addressable:           00
            Partially addressable: 01 02 03 04 05 06 07 
            Heap left redzone:       fa
            Freed heap region:       fd
            Stack left redzone:      f1
            Stack mid redzone:       f2
            Stack right redzone:     f3
            Stack after return:      f5
            Stack use after scope:   f8
            Global redzone:          f9
            Global init order:       f6
            Poisoned by user:        f7
            Container overflow:      fc
            Array cookie:            ac
            Intra object redzone:    bb
            ASan internal:           fe
            Left alloca redzone:     ca
            Right alloca redzone:    cb
          ==556606==ABORTING
          

          alice Alice Sherepa added a comment - also on 10.6-11.6, but not on 10.5 10.6 e8db5c8760a763ac89781652204e82f801a028b1 ================================================================= ==556606==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6120000173d4 at pc 0x7f739be37292 bp 0x7fff21e2e2a0 sp 0x7fff21e2da48 READ of size 141 at 0x6120000173d4 thread T0 #0 0x7f739be37291 in __interceptor_strlen ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:461 #1 0x55cdcf1ba3da in alloc_history_entry /10.6/src/extra/readline/history.c:221 #2 0x55cdcf1ba9bb in add_history /10.6/src/extra/readline/history.c:309 #3 0x55cdcf073111 in fix_history /10.6/src/client/mysql.cc:2775 #4 0x55cdcf075fff in com_clear /10.6/src/client/mysql.cc:3303 #5 0x55cdcf071278 in add_line /10.6/src/client/mysql.cc:2485 #6 0x55cdcf06fc03 in read_and_execute /10.6/src/client/mysql.cc:2236 #7 0x55cdcf06d54c in main /10.6/src/client/mysql.cc:1297 #8 0x7f739b415082 in __libc_start_main ../csu/libc-start.c:308 #9 0x55cdcf06b64d in _start (/10.6/bld/client/mariadb+0x10164d) (BuildId: 44bfe674fff6bb59d741958c122bf425a84abf99)   0x6120000173d4 is located 0 bytes after 276-byte region [0x6120000172c0,0x6120000173d4) allocated by thread T0 here: #0 0x7f739beac8ff in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x55cdcf172702 in sf_malloc /10.6/src/mysys/safemalloc.c:126 #2 0x55cdcf1601ec in my_malloc /10.6/src/mysys/my_malloc.c:91 #3 0x55cdcf086d48 in Binary_string::realloc_raw(unsigned long) /10.6/src/sql/sql_string.cc:104 #4 0x55cdcf08424c in Binary_string::realloc_with_extra(unsigned long) /10.6/src/sql/sql_string.h:820 #5 0x55cdcf0843a4 in Binary_string::realloc_with_extra_if_needed(unsigned long) /10.6/src/sql/sql_string.h:832 #6 0x55cdcf083947 in Binary_string::append(char const*, unsigned long) /10.6/src/sql/sql_string.h:670 #7 0x55cdcf0899fb in String::append(char const*, unsigned long) /10.6/src/sql/sql_string.cc:568 #8 0x55cdcf07309b in fix_history /10.6/src/client/mysql.cc:2770 #9 0x55cdcf075fff in com_clear /10.6/src/client/mysql.cc:3303 #10 0x55cdcf071278 in add_line /10.6/src/client/mysql.cc:2485 #11 0x55cdcf06fc03 in read_and_execute /10.6/src/client/mysql.cc:2236 #12 0x55cdcf06d54c in main /10.6/src/client/mysql.cc:1297 #13 0x7f739b415082 in __libc_start_main ../csu/libc-start.c:308   SUMMARY: AddressSanitizer: heap-buffer-overflow ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:461 in __interceptor_strlen Shadow bytes around the buggy address: 0x612000017100: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x612000017180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x612000017200: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa 0x612000017280: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x612000017300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x612000017380: 00 00 00 00 00 00 00 00 00 00[04]fa fa fa fa fa 0x612000017400: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x612000017480: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x612000017500: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x612000017580: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x612000017600: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==556606==ABORTING

          People

            serg Sergei Golubchik
            danblack Daniel Black
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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