Bug 1040105

Summary: Firefox build using gcc7 has unusable UI
Product: [openSUSE] openSUSE Tumbleweed Reporter: Dominique Leuenberger <dimstar>
Component: FirefoxAssignee: E-mail List <bnc-team-mozilla>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: martin.liska, meissner, mliska, rguenther, seifert, wolfgang
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 1030236    
Attachments: -fsanitize=ubsan report

Description Dominique Leuenberger 2017-05-22 09:06:38 UTC
We are in progress of promoting gcc7 to become the default compiler - by now we are through with the build fails.

As a big surprise, openQA caught Firefox having a broken UI when it was built with gcc7:

https://openqa.opensuse.org/tests/407074#step/firefox/5

I found similar reports from Redhat:
https://bugzilla.redhat.com/show_bug.cgi?id=1422532

The solution for them seems was:
* disable -O3 compiler optimization (not sure if we are on O2 or O3 for FF?)
  http://pkgs.fedoraproject.org/cgit/rpms/firefox.git/commit/?id=0eb6042fa192b54589a7f26f46f6f2fda9b74d53

* as a followup, mozbz#1321579 was observed (ff crashing) which they fixed with
  http://pkgs.fedoraproject.org/cgit/rpms/firefox.git/commit/?id=16a08c459e7ba1151317eb47aa8b858757feb1cf
Comment 1 Dominique Leuenberger 2017-05-22 09:15:03 UTC
CCing the compiler folks
Comment 2 Bernhard Wiedemann 2017-05-22 16:01:13 UTC
This is an autogenerated message for OBS integration:
This bug (1040105) was mentioned in
https://build.opensuse.org/request/show/497321 Factory / MozillaFirefox
Comment 3 Martin Liška 2017-05-23 07:58:55 UTC
Created attachment 725999 [details]
-fsanitize=ubsan report

I've tried to build the binary with -fsanitize=ubsan and I'm attaching report.
You can find it in my branch project: https://build.opensuse.org/package/show/home:marxin:branches:openSUSE:Factory:Staging:C:DVD/MozillaFirefox-ubsan

To be honest, switching from -O3 to -O2 is for me just a work-around. The source code contains many of such errors, which should be eventually fixed.
Running -fsanitize=address would be also interesting.
Comment 4 Martin Liška 2017-05-23 07:59:47 UTC
> -fsanitize=ubsan report

-fsanitize=undefined
Comment 5 Dominique Leuenberger 2017-05-23 11:58:26 UTC
Latest tests with openQA:
https://openqa.opensuse.org/tests/407635#step/firefox/6

Firefox still shows a broken UI
Comment 6 Wolfgang Rosenauer 2017-05-23 12:18:02 UTC
This is now with the --enable-optimize change already which I submitted yesterday? In that case I'm not sure. This is what Fedora has in the spec as well.
Comment 7 Dominique Leuenberger 2017-05-23 12:26:52 UTC
(In reply to Wolfgang Rosenauer from comment #6)
> This is now with the --enable-optimize change already which I submitted
> yesterday? In that case I'm not sure. This is what Fedora has in the spec as
> well.

indeed, this is with your submission from yesterday included
Comment 8 Dominique Leuenberger 2017-05-23 12:28:22 UTC
[ 1577s] /usr/bin/g++ -std=gnu++11 -o SkBlitRow_D32.o -c -I/home/abuild/rpmbuild/BUILD/obj/dist/stl_wrappers -I/home/abuild/rpmbuild/BUILD/obj/dist/system_wrappers -include /home/abuild/rpmbuild/BUILD/mozilla/config/gcc_hidden.h -DNDEBUG=1 -DTRIMMED=1 -DSK_FONTHOST_DOES_NOT_USE_FONTMGR=1 -DSKIA_IMPLEMENTATION=1 -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia -I/home/abuild/rpmbuild/BUILD/obj/gfx/skia -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/include/c -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/include/config -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/include/core -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/include/effects -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/include/gpu -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/include/images -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/include/pathops -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/include/ports -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/include/private -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/include/utils -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/include/utils/mac -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/include/views -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/gpu -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/gpu/effects -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/gpu/gl -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/image -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/lazy -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/opts -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/sfnt -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/utils -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/utils/mac -I/home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/utils/win -I/home/abuild/rpmbuild/BUILD/obj/dist/include  -I/usr/include/nspr4 -I/usr/include/nss3       -fPIC  -DMOZILLA_CLIENT -include /home/abuild/rpmbuild/BUILD/obj/mozilla-config.h -MD -MP -MF .deps/SkBlitRow_D32.o.pp  -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++14-compat -Wc++1z-compat -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -fno-lifetime-dse -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g -fno-strict-aliasing -fno-delete-null-pointer-checks -fno-inline-small-functions -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe  -g -g -O2 -fomit-frame-pointer -Wno-deprecated-declarations -Wno-overloaded-virtual -Wno-shadow -Wno-sign-compare -Wno-unreachable-code -Wno-unused-function -Wno-logical-op -Wno-maybe-uninitialized -I/home/abuild/rpmbuild/BUILD/obj/dist/include/cairo -I/usr/include/freetype2 -I/usr/include/freetype2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 -O3 /home/abuild/rpmbuild/BUILD/mozilla/gfx/skia/skia/src/core/SkBlitRow_D32.cpp

Some stuff seems still to be compiled with -O3 though.
Comment 9 Wolfgang Rosenauer 2017-05-23 12:53:13 UTC
Unfortunately I'm not surprised. This never worked consistently.
Interesting thing is that this is the only change in the Fedora packages.

I'll check how manc -O3 are left and if I find a way to override them at least temporarily. But earliest tonight or even tomorrow :-(
Comment 10 Richard Biener 2017-05-23 12:55:49 UTC
Where does -fno-inline-small-functions come from?  That can pretty badly change how we end up optimizing stuff.  Please remove that from:

%if 0%{?suse_version} > 1320
export CFLAGS="$CFLAGS -fno-delete-null-pointer-checks -fno-inline-small-functions"
%endif
Comment 11 Wolfgang Rosenauer 2017-05-23 13:11:03 UTC
As you can see from the comment:
# boo#986541: add -fno-delete-null-pointer-checks and -fno-inline-small-functions for gcc6
so it's coming from bug 986541

I can certainly remove it again but what when Firefox does not start again afterwards?
Comment 12 Richard Biener 2017-05-23 13:56:54 UTC
(In reply to Wolfgang Rosenauer from comment #11)
> As you can see from the comment:
> # boo#986541: add -fno-delete-null-pointer-checks and
> -fno-inline-small-functions for gcc6
> so it's coming from bug 986541
> 
> I can certainly remove it again but what when Firefox does not start again
> afterwards?

Well, please keep -fno-delete-null-pointer-checks but take out
-fno-inline-small-functions - that one certainly was/is a hack with quite some impact on how GCC sees things (thus very likely to uncover issues in GCC / firefox nobody else sees).
Comment 13 Martin Liška 2017-05-23 14:24:59 UTC
I'm currently running ASAN and UBSAN for Firefox trunk and I'm planning to create PRs for these. Is there any change Wolfgang you can debug what's going wrong the rending is broken?
Comment 14 Martin Liška 2017-05-23 17:03:29 UTC
I can confirm that r590 (removed -fno-inline-small-functions) works for me on my local machine, no GUI issues can be seen.
Comment 15 Martin Liška 2017-05-23 17:12:51 UTC
And I've also created PRs for both ubsan and asan with current trunk of Firefox:

https://bugzilla.mozilla.org/show_bug.cgi?id=1367146
https://bugzilla.mozilla.org/show_bug.cgi?id=1367148
Comment 16 Bernhard Wiedemann 2017-05-24 16:01:15 UTC
This is an autogenerated message for OBS integration:
This bug (1040105) was mentioned in
https://build.opensuse.org/request/show/498015 Factory / MozillaFirefox
Comment 17 Dominique Leuenberger 2017-05-24 18:21:20 UTC
(In reply to Bernhard Wiedemann from comment #16)
> This is an autogenerated message for OBS integration:
> This bug (1040105) was mentioned in
> https://build.opensuse.org/request/show/498015 Factory / MozillaFirefox

https://openqa.opensuse.org/tests/408504#step/firefox/5

So far, no luck
Comment 18 Bernhard Wiedemann 2017-05-24 20:00:46 UTC
This is an autogenerated message for OBS integration:
This bug (1040105) was mentioned in
https://build.opensuse.org/request/show/498129 Factory / MozillaFirefox
Comment 19 Bernhard Wiedemann 2017-06-01 08:01:11 UTC
This is an autogenerated message for OBS integration:
This bug (1040105) was mentioned in
https://build.opensuse.org/request/show/500304 Factory / MozillaThunderbird
Comment 20 Bernhard Wiedemann 2017-06-01 10:01:10 UTC
This is an autogenerated message for OBS integration:
This bug (1040105) was mentioned in
https://build.opensuse.org/request/show/500328 Factory / MozillaThunderbird
Comment 21 Ales Seifert 2017-06-01 14:17:44 UTC
just updated Tumbleweed with ~4 thousands of packages and Firefox and Thunderbird are totally unusable, UI is broken apart. Any suggestions? Firefox from mozilla.org works normally I guess after this update many more have same issue
Comment 22 Dominique Leuenberger 2017-06-01 14:31:34 UTC
(In reply to Ales Seifert from comment #21)
> just updated Tumbleweed with ~4 thousands of packages and Firefox and
> Thunderbird are totally unusable, UI is broken apart. Any suggestions?
> Firefox from mozilla.org works normally I guess after this update many more
> have same issue

rpm -q MozillaFirefox MozillaThunderbird
Both packages had been tested already and should be fine (FF in the normal channel, TB in the update channel)
Comment 23 Ales Seifert 2017-06-01 14:36:05 UTC
(In reply to Dominique Leuenberger from comment #22)
> (In reply to Ales Seifert from comment #21)
> > just updated Tumbleweed with ~4 thousands of packages and Firefox and
> > Thunderbird are totally unusable, UI is broken apart. Any suggestions?
> > Firefox from mozilla.org works normally I guess after this update many more
> > have same issue
> 
> rpm -q MozillaFirefox MozillaThunderbird
> Both packages had been tested already and should be fine (FF in the normal
> channel, TB in the update channel)

MozillaFirefox-53.0-6.16.x86_64                                                                                                                                                                                     
MozillaThunderbird-52.1.1-1.7.x86_64

I am already downgrading to versions from Tumbleweed repos
Comment 24 Wolfgang Rosenauer 2017-06-01 14:43:22 UTC
Firefox 52 and Thunderbird 52 in mozilla are currently building with the fix.
Firefox 53 still needs to be prepared.
Comment 25 Ales Seifert 2017-06-01 14:52:58 UTC
(In reply to Wolfgang Rosenauer from comment #24)
> Firefox 52 and Thunderbird 52 in mozilla are currently building with the fix.
> Firefox 53 still needs to be prepared.

Downgrading helped, thank you for quick response
Comment 26 Swamp Workflow Management 2017-06-16 13:10:25 UTC
openSUSE-SU-2017:1579-1: An update that fixes 21 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1040105,1042090,1043960
CVE References: CVE-2017-5470,CVE-2017-5472,CVE-2017-7749,CVE-2017-7750,CVE-2017-7751,CVE-2017-7752,CVE-2017-7754,CVE-2017-7756,CVE-2017-7757,CVE-2017-7758,CVE-2017-7763,CVE-2017-7764,CVE-2017-7765,CVE-2017-7771,CVE-2017-7772,CVE-2017-7773,CVE-2017-7774,CVE-2017-7775,CVE-2017-7776,CVE-2017-7777,CVE-2017-7778
Sources used:
SUSE Package Hub for SUSE Linux Enterprise 12 (src):    MozillaThunderbird-52.2-36.1
Comment 27 Swamp Workflow Management 2017-06-19 22:09:39 UTC
openSUSE-SU-2017:1620-1: An update that fixes 26 vulnerabilities is now available.

Category: security (important)
Bug References: 1040105,1043960
CVE References: CVE-2017-5470,CVE-2017-5472,CVE-2017-7749,CVE-2017-7750,CVE-2017-7751,CVE-2017-7752,CVE-2017-7754,CVE-2017-7755,CVE-2017-7756,CVE-2017-7757,CVE-2017-7758,CVE-2017-7760,CVE-2017-7761,CVE-2017-7764,CVE-2017-7765,CVE-2017-7766,CVE-2017-7767,CVE-2017-7768,CVE-2017-7771,CVE-2017-7772,CVE-2017-7773,CVE-2017-7774,CVE-2017-7775,CVE-2017-7776,CVE-2017-7777,CVE-2017-7778
Sources used:
openSUSE Leap 42.2 (src):    MozillaFirefox-52.2-57.12.2, MozillaThunderbird-52.2-41.9.2, java-1_8_0-openjdk-1.8.0.131-10.10.3, mozilla-nss-3.28.5-40.6.1
Comment 28 Wolfgang Rosenauer 2017-06-26 05:49:18 UTC
This should be fixed.