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

Bad DOUBLE retruned when built with gcc -ffast-math [strings/dtoa.c issue?]

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Fix
    • 10.1.19, 10.1.22, 10.1.23
    • N/A
    • Compiling
    • Linux RHEL 7.x ; also 6.x
      HP 370 server
       Cpu: Xeon E5 4620 ; also happens with many others

      All versions of mariadb since 10.0 to current 10.1

    Description

      A linux/gcc (4.4 or 4.8 or 5.3) optimized build fails returning correct correct values for DOUBLE cells.

      To repro:

      1. make a gcc optimized build; flags -march=native -O3 -mavx -mfpmath=sse -msse2 -msse4 -fomit-frame-pointer -ffast-math

      2. Create a table with a single DOUBLE field.

      3. Insert a number like 132 bill (132000000000) . Select it back and you will get non numeric output (a ":" or other character will appear in the number returned)

      The problem goes away when you build without the -ffast-math flag is not used

      The problem appears to be in dtoa.c in strings/

      I believe code should work properly, even when --fast-math is passed.

      As an aside, there are faster publicly available atod and dtoa options (as well as itoa and atoi) compare to the ones mariadb uses. Those could give notable speedup for both server and client code and should be possibly reviewed and considered. See e.g.:
      https://github.com/miloyip/dtoa-benchmark

      Attachments

        Activity

          People

            serg Sergei Golubchik
            tehcnomagos Tech Magos
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.