LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 32349 - r294897 + NewGVN cause build failure with LibreOffice
Summary: r294897 + NewGVN cause build failure with LibreOffice
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: X86 (show other bugs)
Version: trunk
Hardware: PC Linux
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks: 30995
  Show dependency tree
 
Reported: 2017-03-20 00:23 PDT by Luke
Modified: 2017-05-03 05:24 PDT (History)
5 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke 2017-03-20 00:23:33 PDT
After commit r294897, LibreOffice cannot be built with the NewGVN. 

Steps to reproduce:
1. $ git clone git://anongit.freedesktop.org/libreoffice/core
2. $ apt-get build-dep libreoffice ( also lo_usefull Shell Script if missing dep)
3. Remove ccache if it's installed ( ccache generates warning w/ clang)
4. create file autogen.input with CC=clang and CXX=clang++
5 ./autogen.sh && make ENVCFLAGS="-mllvm -enable-newgvn" ENVCFLAGSCXX="-mllvm -enable-newgvn"

after r294897
build fails with hwpfilter_test_hwpfilter.test' unit test failed

after r296000 
LibreOffice will fail with the following error
[CUT] sdext_pdfimport
Test name: (anonymous namespace)::PDFITest::testTdf98421
assertion failed
- Expression: aOutput.indexOf("svg:height=\"-262.82mm\"") != -1

Failures !!!
Run: 6   Failure total: 1   Failures: 1   Errors: 0

Error: a unit test failed, please do one of:
make CppunitTest_sdext_pdfimport CPPUNITTRACE="gdb --args"
    # for interactive debugging on Linux
/core/solenv/gbuild/CppunitTest.mk:107: recipe for target '/core/workdir/CppunitTest/sdext_pdfimport.test' failed
make[1]: *** [/core/workdir/CppunitTest/sdext_pdfimport.test] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:264: recipe for target 'build' failed
make: *** [build] Error 2
Comment 1 Daniel Berlin 2017-03-20 07:31:17 PDT
NewGVN doesn't use value tracking, so not sure what is up.
Comment 2 Daniel Berlin 2017-03-20 07:32:34 PDT
also, need a minimized testcase to debug, i'm not going to download all of libreoffice :)
Comment 3 Davide Italiano 2017-03-20 11:33:47 PDT
I'll be happy to reduce if you provide a single file that fails (libreoffice is really too big).
Comment 4 Luke 2017-03-23 18:11:24 PDT
(In reply to Daniel Berlin from comment #1)
> NewGVN doesn't use value tracking, so not sure what is up.
Comment 5 Luke 2017-03-23 18:31:03 PDT
(In reply to Daniel Berlin from comment #1)
> NewGVN doesn't use value tracking, so not sure what is up.

There must be some kind of interaction here as a regular make completes all of the unit tests. Also, I bisected the change in failing CppUnit test down to 

http://llvm.org/viewvc/llvm-project?view=revision&revision=295583

NewGVN: Start making use of predicateinfo pass.


> a single file that fails

I'm not sure where to begin here. Before r294897, hwpfilter.test failed with a segfault. After r295583, Cppunit Test sdext_pdfimport generates an assertion failed.

I can give you the core dump of the pre-r294897 error or any debug output that you require. However paring this down an application unit test is beyond my ability.
Comment 6 Luke 2017-04-28 12:36:02 PDT
As of r301609, NewGVN builds of LibreOffice are still failing on the mandatory CppUnit Test_sdext_pdfimport. Normal builds are working.
Comment 7 Daniel Berlin 2017-04-28 12:46:05 PDT
I appreciate the update.
There's still really not a lot i can do without a reduced testcase.
It's likely a latent bug somewhere, but it may also be in other code.

At this point i've now built thousands and thousands of software packages with newgvn on, and not hit any issue like this.

If you could at least produce a single .bc file of the unit test that lli could run or something, i could try to track it down.
Comment 8 Davide Italiano 2017-04-28 13:09:40 PDT
I'm willing to do some of the reduction work but I have to say the libreoffice suite is a little huge and scary.
Accidentally, I just stumbled upon this
http://llvm.org/devmtg/2017-03//assets/slides/libreoffice_loves_llvm.pdf
so I cc:ed the speaker in case he has suggestions on how we can reduce this bug effectively (as I asssume they hit similar issues in the past)
Comment 9 Stephan Bergmann 2017-05-01 23:43:43 PDT
(In reply to Davide Italiano from comment #8)
> so I cc:ed the speaker in case he has suggestions on how we can reduce this
> bug effectively (as I asssume they hit similar issues in the past)

I haven't come across NewGVN yet; is this problem specific to 32-bit x86, or does it also happen on 64-bit x86_64?  I routinely do x86_64 builds of LibreOffice with Clang trunk, and don't remember any specific issue with those hwpfilter or pdfimport tests (but never manually enabled that -enable-newgvn).
Comment 10 Davide Italiano 2017-05-01 23:49:35 PDT
I don't think it's 32-bit specific.
It only happens with -mllvm -enable-newgvn as far as I can tell.
Comment 11 Stephan Bergmann 2017-05-02 13:44:29 PDT
With recent LLVM/Clang trunk (r301906), a Linux x86_64 build of recent LibreOffice master (de9106a511ed9c202423e3c3a9754feb4f969364), with CC/CXX containing '-mllvm -enable-newgvn', succeeds 'make check' for me without failing any tests.
Comment 12 Davide Italiano 2017-05-02 15:07:14 PDT
Luke, can we close this one?
Stephan, thanks! Is there any chance you can run builds with `newgvn` periodically? We plan to enable it by default and catching regressions early would be great.
Comment 13 Stephan Bergmann 2017-05-02 23:15:22 PDT
(In reply to Davide Italiano from comment #12)
> Stephan, thanks! Is there any chance you can run builds with `newgvn`
> periodically? We plan to enable it by default and catching regressions early
> would be great.

Yes, will do.
Comment 14 Luke 2017-05-03 05:24:57 PDT
Verified fixed with clang version 5.0.0 (trunk 301984).


Thanks for your help Stephan and Davide.