Details

    Description

      Originally spotted with mysql-5.6.24 (http://bugs.mysql.com/bug.php?id=76654), but mariadb 10.0.17 seems to have the same issue:

      Description:
      When building mysql-5.6.24 with gcc 5.0 on Fedora 22 or later some tests fail on big integers operations, for example bigint test case.

      Full build log is available here:
      https://kojipkgs.fedoraproject.org//work/tasks/3420/9443420/build.log

      How to repeat:
      Run bigint test or a small reproducer:

        MySQL [(none)]> select -(-9223372036854775808);
        +-------------------------+
        | -(-9223372036854775808) |
        +-------------------------+
        |               854775808 |
        +-------------------------+

      Which is obviously wrong.

      Attachments

        Activity

          hhorak Honza Horak created issue -
          hhorak Honza Horak added a comment -

          See the mysql bug report, which contains a patch (not tested with mariadb yet though).

          hhorak Honza Horak added a comment - See the mysql bug report, which contains a patch (not tested with mariadb yet though).
          hhorak Honza Horak added a comment -

          mysql's patch without whitespace changes.

          hhorak Honza Horak added a comment - mysql's patch without whitespace changes.
          hhorak Honza Horak made changes -
          Field Original Value New Value
          Attachment mariadb-gcc5.patch [ 37610 ]
          elenst Elena Stepanova made changes -
          Fix Version/s 10.0 [ 16000 ]
          Assignee Sergei Golubchik [ serg ]
          Labels upstream
          Summary bigint fail with gcc 5.0 [PATCH] bigint fail with gcc 5.0
          elenst Elena Stepanova made changes -
          serg Sergei Golubchik made changes -
          Labels upstream upstream-fixed

          I don't like this fix, it's a hack that converts the loop to an equivalent loop that magically works in gcc 5. It does not fix the root of the bug (undefined behavior) but simply changes the following code to work with how gcc 5.0 happens to behave in this undefined case. If gcc 6 will start doing something different here, it will break again.

          I will directly fix the undefined behavior instead.

          serg Sergei Golubchik added a comment - I don't like this fix, it's a hack that converts the loop to an equivalent loop that magically works in gcc 5. It does not fix the root of the bug (undefined behavior) but simply changes the following code to work with how gcc 5.0 happens to behave in this undefined case. If gcc 6 will start doing something different here, it will break again. I will directly fix the undefined behavior instead.
          serg Sergei Golubchik made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          serg Sergei Golubchik made changes -
          Status In Progress [ 3 ] Stalled [ 10000 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.0.18 [ 18702 ]
          Fix Version/s 10.0 [ 16000 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Workflow MariaDB v2 [ 60429 ] MariaDB v3 [ 64590 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 64590 ] MariaDB v4 [ 149042 ]

          People

            serg Sergei Golubchik
            hhorak Honza Horak
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.