[MDEV-12358] GCC 7 issues Created: 2017-03-24 Updated: 2017-07-05 Resolved: 2017-07-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Compiling, Server, Tests |
| Affects Version/s: | 10.1.22 |
| Fix Version/s: | 10.1.24 |
| Type: | Bug | Priority: | Major |
| Reporter: | Michal Schorm | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Fedora 25 |
||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Hello, 1) I wanted to use debug build, but it FTBFS because of compile time error.
and simmilar, the build log can be found here 2) When built with GCC7, about 120 new tests start to fail. To check, if it is caused by GCC, I made 2 containers in which I tried to get as close to Fedora Koji build system machines, as possible. Those 2 containers then differ only in version of GCC and its dependecies. I attached list of packages, build logs and lists of failing tests from both containers.
The source RPM, that I rebuilt, can be found here |
| Comments |
| Comment by Michal Schorm [ 2017-03-24 ] | ||||||||||||
|
I filed bug against GCC7 on Fedora here. | ||||||||||||
| Comment by Vicențiu Ciorbaru [ 2017-05-04 ] | ||||||||||||
|
I've compiled MariaDB with gcc 7.0.1-0.16
And I am not getting any failures on my end on a debug build: On the other hand, switching to a release build, everything changes. Taking a simple test case main.range, I get a crash in xtradb only (consistent with your experience). I've attached a GDB to it. Code crashes in:
With a dereference of a nullptr thr. This should not happen, as the first part of the condition guards against it. So in this case it is definitely a compiler bug. Assembly debugging confirms:
| ||||||||||||
| Comment by Vicențiu Ciorbaru [ 2017-05-04 ] | ||||||||||||
|
Turns out that it's not a compiler bug. _attribute_(nonnull) can affect what optimizations compiler does. Dirty fix is to remove all MY_ATTRIBUTES from xtradb. The file storage/xtradb/include/univ.i
| ||||||||||||
| Comment by Vicențiu Ciorbaru [ 2017-05-04 ] | ||||||||||||
|
CC marko This may be something for you to consider fixing later. | ||||||||||||
| Comment by Michal Schorm [ 2017-05-04 ] | ||||||||||||
|
I enabled '--big-test' option for the testsuite So far, it looks like the issue has been solved. I want to point out, that even though the 'storage/xtradb/include/univ.i' file has been patched, the same line of code appears on one more place:
However the compilation seems to work fine even if only xtradb file is patched. | ||||||||||||
| Comment by Michal Schorm [ 2017-05-06 ] | ||||||||||||
|
I made group of builds and unfortunatelly, it seems, many tests keep failing against the 10.1.21 version. Here is example build log, with '--big-test' disabled Again, there is huge difference in amount of tests failing in GCC7 builds (up to 100 failing tetsts) and GCC6 builds (up to 12 failing tests) | ||||||||||||
| Comment by Daniel Black [ 2017-05-06 ] | ||||||||||||
|
I think I tried 7.1 yesterday against 10.2. And didn't have significant troubles - still a few too many warning however generally isolated to mgrooma and connect. | ||||||||||||
| Comment by Daniel Black [ 2017-05-10 ] | ||||||||||||
|
I tried again with gcc-7.1.0 and gcc-7.1.1(from branch 7 head) and had no troubles on 10.2 however quickly hit the test 40 failures (my limit) on 10.1 branch. This is on Ubuntu-16.04 x86_64 and ppc64le | ||||||||||||
| Comment by Michal Schorm [ 2017-05-10 ] | ||||||||||||
|
I will make new analysis, when I catch some time. | ||||||||||||
| Comment by Marko Mäkelä [ 2017-05-16 ] | ||||||||||||
|
I fixed some GCC 7 warnings, but did not yet attack the MY_ATTRIBUTE problem that cvicentiu mentioned. | ||||||||||||
| Comment by Daniel Black [ 2017-05-16 ] | ||||||||||||
|
Thanks for attacking -Wimplicit-fallthough. I picked up on https://github.com/codership/galera/issues/464 and https://github.com/codership/galera/issues/465 doing the same fixes in galera which looks much more serious. | ||||||||||||
| Comment by Daniel Black [ 2017-05-17 ] | ||||||||||||
|
The remaining attribute fixes are the ones provided by Google in patches in The header changes in: https://github.com/MariaDB/server/pull/341/files#diff-db850e092e18ea7b5b4fb9872ee2c3ce | ||||||||||||
| Comment by Marko Mäkelä [ 2017-05-17 ] | ||||||||||||
|
I pushed the silencing of bogus -Wimplicit-fallthrough warnings to 10.0, and filed | ||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-05-17 ] | ||||||||||||
|
ok to push above ones ^ | ||||||||||||
| Comment by Marko Mäkelä [ 2017-05-17 ] | ||||||||||||
|
To get something good out of GCC 7.1.0, I compiled the debug version with -O3 -fsanitize=undefined, ran the InnoDB tests and fixed all InnoDB errors: | ||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-05-17 ] | ||||||||||||
|
ol to push above ones ^ (one could argue about 5bc simplify claim but I'm ok with it). | ||||||||||||
| Comment by Marko Mäkelä [ 2017-05-18 ] | ||||||||||||
|
I pushed the above-mentioned commits to 10.0 (replacing the word "Simplify" with "Refactor" in one commit comment). | ||||||||||||
| Comment by Marko Mäkelä [ 2017-05-18 ] | ||||||||||||
|
I pushed a tentative merge to bb-10.1-marko and compiled and tested it as follows. No UBSAN warnings were reported for InnoDB or XtraDB:
Note: at least one 10.1 target will fail to build with GCC 7.1.0 in a Debian unstable/experimental chroot. In 10.0, storage/connect would fail to build with a similar message:
| ||||||||||||
| Comment by Michal Schorm [ 2017-05-18 ] | ||||||||||||
|
Can you point me to some specific GIT point, at which I can download the tarball and try your fixes on Fedora builders? | ||||||||||||
| Comment by Marko Mäkelä [ 2017-05-18 ] | ||||||||||||
|
mschorm, I intend to push the merge to 10.1 soon. Meanwhile, you can experiment with commit ae04f2968ea6 which I linked in my previous comment. I also performed a tentative merge to 10.2, but pushing that one could take a week. For 10.2, there were a few follow-up fixes necessary which I hope jplindst can review: | ||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-05-18 ] | ||||||||||||
|
ok to push bbe73, 78968, 4fb9a, 0debf, 78df4. 850c3 requires some explanation to commit message before I can review. | ||||||||||||
| Comment by Marko Mäkelä [ 2017-05-19 ] | ||||||||||||
|
mschorm, I pushed a merge to 10.1. It does not fix the my_config.h issue yet; that you should be able to work around by adding
to the start of the affected files. | ||||||||||||
| Comment by Marko Mäkelä [ 2017-05-22 ] | ||||||||||||
|
I pushed a merge to 10.2 as well. | ||||||||||||
| Comment by Michal Schorm [ 2017-05-22 ] | ||||||||||||
|
I tried to build MariaDB on Fedora from the commit in this comment Marko. Great work! | ||||||||||||
| Comment by Michal Schorm [ 2017-06-19 ] | ||||||||||||
|
MariaDB 10.1.24 is now in stable repos in Fedora. However, I'm still not able to make a debug build. But that is different issue, so I should probabbly create a new JIRA ticket - shouldn't I? | ||||||||||||
| Comment by Daniel Black [ 2017-06-27 ] | ||||||||||||
|
Yeh, I'd do a new ticket. You seem comfortable that all gcc-7 issues raised here been resolved. Regarding debug builds look at |