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

mysqld segfaults on FreeBSD 10.1 i386 when built with clang 3.4

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.15
    • 10.0.20
    • Compiling
    • FreeBSD i386bsd 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 22:51:51 UTC 2014 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386
    • 10.0.20

    Description

      From: spil.oss@gmail.com
      To: maria-developers@lists.launchpad.net
      subject: mysqld 10.0.15 segfaults on FreeBSD i386 clang 3.4

      >Description:
      When MariaDB is built with clang 3.4 on FreeBSD i386 (which is
      the default compiler) the server will segfault the moment a
      client connects to it. Same behaviour is observed with clang
      3.5. Built with clang 3.3 on 10.1 runs without segfaults.
      Built on FreeBSD 10.0 (which comes with clang 3.3) runs OK.
      >How-To-Repeat:
      Use FreeBSD 10.1 i386
      Use port to build MariaDB 10.0 or 5.5
      Connect to server using client

      >Fix:
      Build with clang 3.3 or build using Pourdiere (uses 10.0 jail)

      >Submitter-Id: <submitter ID>
      >Originator: Bernard Spil
      >Organization:
      FreeBSD MariaDB 10.0 port committer
      >MySQL support: none
      >Synopsis: MariaDB segfaults on i386 FreeBSD
      >Severity: non-critical
      >Priority: low
      >Category: mysql
      >Class: sw-bug
      >Release: mysql-10.0.15 (FreeBSD Ports)

      >C compiler: clang 3.4
      >C++ compiler: clang 3.4
      >Environment:
      FreeBSD 10.1 GENERIC i386 Celeron U4100 Dual Core 4GB
      System: FreeBSD i386bsd 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 22:51:51 UTC 2014 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386

      Some paths: /usr/bin/perl /usr/bin/make /usr/local/bin/gmake /usr/bin/cc

      Compilation info (call): CC='/usr/bin/cc' CFLAGS='-O2 -pipe -fstack-protector -fno-strict-aliasing -O2 -g -DNDEBUG -DDBUG_OFF' CXX='/usr/bin/c++' CXXFLAGS='-O2 -pipe -fstack-protector -fno-strict-aliasing -O2 -g -DNDEBUG -DDBUG_O
      FF' LDFLAGS='' ASFLAGS=''
      Compilation info (used): CC='/usr/bin/cc' CFLAGS='-O2 -pipe -fstack-protector -fno-strict-aliasing -O2 -g -DNDEBUG -DDBUG_OFF' CXX='/usr/bin/c++' CXXFLAGS='-O2 -pipe -fstack-protector -fno-strict-aliasing -O2 -g -DNDEBUG -DDBUG_O
      FF' LDFLAGS='' ASFLAGS=''
      LIBC:
      rrr- 1 root wheel 1427444 Nov 11 23:52 /lib/libc.so.7
      rrr- 1 root wheel 2833712 Nov 11 23:52 /usr/lib/libc.a
      rrr- 1 root wheel 166 Nov 11 23:52 /usr/lib/libc.so

      Perl: This is perl 5, version 18, subversion 4 (v5.18.4) built for i386-freebsd-thread-multi-64int

      Attachments

        Issue Links

          Activity

            spil Bernard Spil created issue -
            spil Bernard Spil added a comment -

            Created bug 196399 on FreeBSD bugzilla
            https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196399

            spil Bernard Spil added a comment - Created bug 196399 on FreeBSD bugzilla https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196399
            spil Bernard Spil added a comment - - edited

            Uploaded mariadb-bug-clang34segfaultMDEV-7398-2.tgz to ftp.askmonty.org/private
            $ tar cvzf mariadb-bug-clang34segfaultMDEV-7398.tgz mysqld.core README i386bsd.err /usr/local/libexec/mysqld gdb.txt
            a mysqld.core
            a README
            a i386bsd.err
            tar: Removing leading '/' from member names
            a usr/local/libexec/mysqld
            a gdb.txt

            spil Bernard Spil added a comment - - edited Uploaded mariadb-bug-clang34segfaultMDEV-7398-2.tgz to ftp.askmonty.org/private $ tar cvzf mariadb-bug-clang34segfaultMDEV-7398.tgz mysqld.core README i386bsd.err /usr/local/libexec/mysqld gdb.txt a mysqld.core a README a i386bsd.err tar: Removing leading '/' from member names a usr/local/libexec/mysqld a gdb.txt
            serg Sergei Golubchik made changes -
            Field Original Value New Value
            serg Sergei Golubchik made changes -
            Fix Version/s 10.0 [ 16000 ]
            Fix Version/s 5.5 [ 15800 ]

            I'm getting a crash also, with just as useless coredump; but apparently, we should wait for the FreeBSD fix?

            elenst Elena Stepanova added a comment - I'm getting a crash also, with just as useless coredump; but apparently, we should wait for the FreeBSD fix?
            elenst Elena Stepanova made changes -
            Labels verified
            spil Bernard Spil added a comment -

            This has now been confirmed to occur with clang 3.6.0rc3 as well
            https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196399#c5

            Can someone try this on a different (i.e. non-FreeBSD) platform as well?

            spil Bernard Spil added a comment - This has now been confirmed to occur with clang 3.6.0rc3 as well https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196399#c5 Can someone try this on a different (i.e. non-FreeBSD) platform as well?
            danblack Daniel Black added a comment - - edited

            spil https://travis-ci.org/openquery/mariadb-server/builds/59973991 10.0 git head, with patches on gcc-4.9 and clang-3.4 on ubuntu 12.04

            Having a cause/test case would obviously help validate this more.

            Update: url change - ABI checks under clang were faulty

            danblack Daniel Black added a comment - - edited spil https://travis-ci.org/openquery/mariadb-server/builds/59973991 10.0 git head, with patches on gcc-4.9 and clang-3.4 on ubuntu 12.04 Having a cause/test case would obviously help validate this more. Update: url change - ABI checks under clang were faulty
            danblack Daniel Black added a comment -

            Seemed to be getting enough random failures. While the link the previous comment, with patches applied, survived running the test suite until the 50 minute timeout killed it.

            On the 10.0 trunk failures occurred quite quickly in the test suite https://travis-ci.org/openquery/mariadb-server/jobs/59991034

            From the failed test run mysqld in debug mode and the var directory including 10 failures has been in the private uploads as travis-ci.org-59991034#117.2-3a193ec2491b...e47656b2abf2-openquery-mariadb-server.tar.bz2

            danblack Daniel Black added a comment - Seemed to be getting enough random failures. While the link the previous comment, with patches applied, survived running the test suite until the 50 minute timeout killed it. On the 10.0 trunk failures occurred quite quickly in the test suite https://travis-ci.org/openquery/mariadb-server/jobs/59991034 From the failed test run mysqld in debug mode and the var directory including 10 failures has been in the private uploads as travis-ci.org-59991034#117.2-3a193ec2491b...e47656b2abf2-openquery-mariadb-server.tar.bz2
            danblack Daniel Black added a comment -

            https://github.com/MariaDB/server/pull/51 is the same patches from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196399

            Have these made it into ports? Any feed back on them?

            danblack Daniel Black added a comment - https://github.com/MariaDB/server/pull/51 is the same patches from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196399 Have these made it into ports? Any feed back on them?
            danblack Daniel Black made changes -
            danblack Daniel Black added a comment -

            Split test cases out so that they might finish: with patches: https://travis-ci.org/openquery/mariadb-server/builds/60093722 regarding 141.1 - I saw sum_distinct-big fail in something else may not be related.

            without patches: https://travis-ci.org/openquery/mariadb-server/builds/60083380 lots of clang failures.

            danblack Daniel Black added a comment - Split test cases out so that they might finish: with patches: https://travis-ci.org/openquery/mariadb-server/builds/60093722 regarding 141.1 - I saw sum_distinct-big fail in something else may not be related. without patches: https://travis-ci.org/openquery/mariadb-server/builds/60083380 lots of clang failures.
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            ratzpo Rasmus Johansson (Inactive) made changes -
            Workflow MariaDB v2 [ 59099 ] MariaDB v3 [ 65795 ]
            serg Sergei Golubchik made changes -
            Status Open [ 1 ] In Progress [ 3 ]

            spil, could you please see if the patch is for fine for you? I've tested it manually, but we don't have working freebsd in buildbot at the moment. It is here. Note that it's 5.5 patch, C11 atomic operations are only used in 10.0 and up.

            serg Sergei Golubchik added a comment - spil , could you please see if the patch is for fine for you? I've tested it manually, but we don't have working freebsd in buildbot at the moment. It is here . Note that it's 5.5 patch, C11 atomic operations are only used in 10.0 and up.
            serg Sergei Golubchik made changes -
            Status In Progress [ 3 ] In Review [ 10002 ]

            spil, and this is the 10.0 patch for atomics.

            serg Sergei Golubchik added a comment - spil , and this is the 10.0 patch for atomics.
            spil Bernard Spil added a comment -

            Thanks! Testing... Now where's my i386 VM...

            spil Bernard Spil added a comment - Thanks! Testing... Now where's my i386 VM...
            spil Bernard Spil added a comment - - edited

            Seems to have improved a bit but still segfaults.
            Build 10.0.19 on FreeBSD-10.1-i386 OK
            Start OK
            Connect client OK
            use mysql -> segfault and daemon restarts
            (before the daemon would not restart)

            spil Bernard Spil added a comment - - edited Seems to have improved a bit but still segfaults. Build 10.0.19 on FreeBSD-10.1-i386 OK Start OK Connect client OK use mysql -> segfault and daemon restarts (before the daemon would not restart)

            Trying 9.2 with clang 3.4. mariadb-5.5 doesn't crash for me even without any patches.
            mariadb-10.0 does crash on startup if innodb or xtradb are enabled. with the patches it seems to work, tests pass.
            I'll remove 5.5 from "affected versions".

            serg Sergei Golubchik added a comment - Trying 9.2 with clang 3.4. mariadb-5.5 doesn't crash for me even without any patches. mariadb-10.0 does crash on startup if innodb or xtradb are enabled. with the patches it seems to work, tests pass. I'll remove 5.5 from "affected versions".
            serg Sergei Golubchik made changes -
            Fix Version/s 5.5 [ 15800 ]
            serg Sergei Golubchik made changes -
            Affects Version/s 5.5.40 [ 17100 ]
            spil Bernard Spil added a comment - - edited

            Does the system produce build logs? I'd like to look at the build script you're using as well.

            Furthermore, you should update the build host, FreeBSD 9.2 has been End-of-Life for quite a long time
            https://www.freebsd.org/security/security.html#sup

            spil Bernard Spil added a comment - - edited Does the system produce build logs? I'd like to look at the build script you're using as well. Furthermore, you should update the build host, FreeBSD 9.2 has been End-of-Life for quite a long time https://www.freebsd.org/security/security.html#sup
            serg Sergei Golubchik made changes -
            Sprint 10.0.20 [ 5 ]
            serg Sergei Golubchik made changes -
            Rank Ranked higher
            serg Sergei Golubchik made changes -
            Fix Version/s 10.0.20 [ 19201 ]
            Fix Version/s 10.0 [ 16000 ]
            Resolution Fixed [ 1 ]
            Status In Review [ 10002 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 65795 ] MariaDB v4 [ 148672 ]

            People

              serg Sergei Golubchik
              spil Bernard Spil
              Votes:
              1 Vote for this issue
              Watchers:
              6 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.