Re: Segfaulting test-case with -flto
On 04/19/2018 02:56 PM, Stephan Bergmann wrote: > Not sure how -Wclass-memaccess is relevant for LTO? It's much easier to end up with an UBSAN that eventually causes a SEGFAULT. That's my experience learned from Firefox. Anyway, had cleaned up LO master the other day to compile with upcoming GCC 8, committing various improvements (see `git log --grep=-Werror=class-memaccess`). Only a couple places seemed not so easy to fix (without introducing potential performance regressions), so they remained in the state of local TODO patches for now: I see. As mentioned one either needs to be lucky, or to enable -flifetime-dse=1. Thanks for following the Warnings and doing the clean-up. Martin ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Segfaulting test-case with -flto
Hi, On Thu, Apr 19, 2018 at 01:38:52PM +0100, Michael Meekswrote: > Would be great to have a configure.ac patch that checks for that option > and uses it if it is present - it might also be nice to have some > compile output from using that option - to file an easy-hack bug to go > fix all those places (?) =) I don't think it'll find anything on master, Stephan pushed a set of -Werror=class-memaccess fixes back in January. ('git log --grep class-memaccess' shows them.) Regards, Miklos signature.asc Description: Digital signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Segfaulting test-case with -flto
On 19/04/18 14:33, Martin Liška wrote: I'm GCC developer with high focus on LTO. We are trying to use the -flto in production. I can confirm that current trunk looks fine. But before that I added -flifetime-dse=1 to paper over the issue. Please -Wclass-memaccess new warnings that will come with GCC 8 that should find places where a memset is used to initialize a class fields. Not sure how -Wclass-memaccess is relevant for LTO? Anyway, had cleaned up LO master the other day to compile with upcoming GCC 8, committing various improvements (see `git log --grep=-Werror=class-memaccess`). Only a couple places seemed not so easy to fix (without introducing potential performance regressions), so they remained in the state of local TODO patches for now: diff --git a/sc/inc/fillinfo.hxx b/sc/inc/fillinfo.hxx index e21a11c9a088..f25b8e9b0a74 100644 --- a/sc/inc/fillinfo.hxx +++ b/sc/inc/fillinfo.hxx @@ -177,6 +177,17 @@ struct RowInfo RowInfo(const RowInfo&) = delete; const RowInfo& operator=(const RowInfo&) = delete; +void clear() { +pCellInfo = nullptr; +nHeight = 0; +nRowNo = 0; +nRotMaxCol = 0; +bEmptyBack = false; +bAutoFilter = false; +bPivotButton = false; +bChanged = false; +} + CellInfo* pCellInfo; sal_uInt16 nHeight; diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index b150231460a0..922cc07e75d3 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -1088,7 +1088,9 @@ ScTableInfo::ScTableInfo(const SCSIZE capacity) , mnArrCapacity(capacity) , mbPageMode(false) { -memset(mpRowInfo.get(), 0, mnArrCapacity * sizeof(RowInfo)); +for (SCSIZE i = 0; i != mnArrCapacity; ++i) { +mpRowInfo[i].clear(); +} } ScTableInfo::~ScTableInfo() diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 0395b9902528..6f19d293e2a1 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -1572,7 +1572,7 @@ void WW8TabBandDesc::ReadNewShd(const sal_uInt8* pS, bool bVer67) void WW8TabBandDesc::setcelldefaults(WW8_TCell *pCells, short nCols) { -memset( pCells, 0, nCols * sizeof( WW8_TCell ) ); +memset( /*TODO*/static_cast(pCells), 0, nCols * sizeof( WW8_TCell ) ); } namespace ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Segfaulting test-case with -flto
Hi Martin, On 19/04/18 13:33, Martin Liška wrote: > I'm GCC developer with high focus on LTO. We are trying to > use the -flto in production. Nice =) Hopefully with some PGO goodness after that too ... > I can confirm that current trunk looks fine. But before that I > added -flifetime-dse=1 to paper over the issue. Please -Wclass-memaccess> new > warnings that will come with GCC 8 that should > find places where a memset is used to initialize a class fields. Would be great to have a configure.ac patch that checks for that option and uses it if it is present - it might also be nice to have some compile output from using that option - to file an easy-hack bug to go fix all those places (?) =) All the best, Michael. -- michael.me...@collabora.com <><, Pseudo Engineer, itinerant idiot ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Segfaulting test-case with -flto
On 04/10/2018 09:32 AM, Tor Lillqvist wrote: > The help message for the --enable-lto option says: "This is experimental work > in progress that shouldn't be used unless you are working on it." > > Thus you have two choices: 1) Don't do that then, or 2) Debug and fix the > problem. > > --tml Hi. I'm GCC developer with high focus on LTO. We are trying to use the -flto in production. I can confirm that current trunk looks fine. But before that I added -flifetime-dse=1 to paper over the issue. Please -Wclass-memaccess new warnings that will come with GCC 8 that should find places where a memset is used to initialize a class fields. Thanks, Martin ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Segfaulting test-case with -flto
The help message for the --enable-lto option says: "This is experimental work in progress that shouldn't be used unless you are working on it." Thus you have two choices: 1) Don't do that then, or 2) Debug and fix the problem. --tml ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
Segfaulting test-case with -flto
Following test-case is failing with --enable-lto: [ 7806s] /bin/sh: line 1: 1652 Segmentation fault (core dumped) ( LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"$I/program:$I/pro gram":$W/UnpackedTarball/cppunit/src/cppunit/.libs MALLOC_CHECK_=2 MALLOC_PERTURB_=153 $W/LinkTarget/Executable/cppunittester $W/LinkTarget/CppunitTest/libtest_sw_uwriter.so --headless "- env:BRAND_BASE_DIR=file://$S/instdir" "-env:BRAND_SHARE_SUBDIR=share" "-env:BRAND_SHARE_RESOURCE_SUBDIR=program/resource" "- env:UserInstallation=file://$W/CppunitTest/sw_uwriter.test.user" "- env:CONFIGURATION_LAYERS=xcsxcu:file://$I/share/registry xcsxcu:file://$W/unittest/registry" "- env:UNO_TYPES=file://$I/program/types.rdb file://$I/program/types/offapi.rdb" "- env:UNO_SERVICES=file://$W/Rdb/ure/services.rdb file://$W/ComponentTarget/comphelper/util/comphelp.component file://$W/ComponentTarget/configmgr/source/configmgr.component file://$W/ComponentTarget/framework/util/fwk.component file://$W/ComponentTarget/i18npool/util/i18npool.component file://$W/ComponentTarget/package/util/package2.component file://$W/ComponentTarget/package/source/xstor/xstor.component file://$W/ComponentTarget/sfx2/util/sfx.component file://$W/ComponentTarget/ucb/source/core/ucb1.component file://$W/ComponentTarget/ucb/source/ucp/file/ucpfile1.component file://$W/ComponentTarget/unotools/util/utl.component file://$W/ComponentTarget/unoxml/source/service/unoxml.component file://$W/ComponentTarget/uui/util/uui.component" -env:URE_INTERNAL_LIB_DIR=file://$I/program -env:LO_LIB_DIR=file://$I/program -env:LO_JAVA_DIR=file://$I/program/classes --protector $W/LinkTarget/Library/unoexceptionprotector.so unoexceptionprotector -- protector $W/LinkTarget/Library/unobootstrapprotector.so unobootstrapprotector --protector $W/LinkTarget/Library/libvclbootstrapprotector.so vclbootstrapprotector "-env:CPPUNITTESTTARGET=$W/CppunitTest/sw_uwriter.test" ) > $W/CppunitTest/sw_uwriter.test.log 2>&1 [ 7806s] ToxTextGeneratorTest::EmptyStringIsReturnedForPageNumberPlaceholderOfZe roItems finished in: 0ms [ 7806s] ToxTextGeneratorTest::OneAtSignIsReturnedForPageNumberPlaceholderOfOneI tem finished in: 0ms [ 7806s] ToxTextGeneratorTest::TwoAtSignsAreReturnedForPageNumberPlaceholderOfOn eItem finished in: 0ms [ 7806s] ToxTextGeneratorTest::EmptyStringIsReturnedAsNumStringIfNoTextMarkIsSet finished in: 0ms [ 7806s] ToxTextGeneratorTest::EmptyStringIsReturnedAsNumStringIfToxSourcesIsEmp ty finished in: 0ms [ 7806s] which: no gdb in (/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/l ib64/jvm/java/bin) [ 7806s] You need gdb in your path to show backtraces [ 7806s] [ 7806s] Error: a unit test failed, please do one of: [ 7806s] [ 7806s] make CppunitTest_sw_uwriter CPPUNITTRACE="gdb --args" [ 7806s] # for interactive debugging on Linux [ 7806s] make CppunitTest_sw_uwriter VALGRIND=memcheck [ 7806s] # for memory checking [ 7806s] make CppunitTest_sw_uwriter DEBUGCPPUNIT=TRUE [ 7806s] # for exception catching ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-bugs] [Bug 116896] Segfaulting test-case with -flto
https://bugs.documentfoundation.org/show_bug.cgi?id=116896 Xisco Faulíchanged: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC||xiscofa...@libreoffice.org Resolution|--- |MOVED --- Comment #1 from Xisco Faulí --- Hello, Thanks for reporting it. Since this is build issue and not a software issue, would you mind sending an email to the dev list instead? -> https://wiki.documentfoundation.org/Development/Mailing_List Closing as RESOLVED MOVED -- You are receiving this mail because: You are the assignee for the bug.___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 116896] New: Segfaulting test-case with -flto
https://bugs.documentfoundation.org/show_bug.cgi?id=116896 Bug ID: 116896 Summary: Segfaulting test-case with -flto Product: LibreOffice Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: medium Component: BASIC Assignee: libreoffice-bugs@lists.freedesktop.org Reporter: mli...@suse.cz Following test-case is failing with --enable-lto: [ 7806s] /bin/sh: line 1: 1652 Segmentation fault (core dumped) ( LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}"$I/program:$I/pro gram":$W/UnpackedTarball/cppunit/src/cppunit/.libs MALLOC_CHECK_=2 MALLOC_PERTURB_=153 $W/LinkTarget/Executable/cppunittester $W/LinkTarget/CppunitTest/libtest_sw_uwriter.so --headless "- env:BRAND_BASE_DIR=file://$S/instdir" "-env:BRAND_SHARE_SUBDIR=share" "-env:BRAND_SHARE_RESOURCE_SUBDIR=program/resource" "- env:UserInstallation=file://$W/CppunitTest/sw_uwriter.test.user" "- env:CONFIGURATION_LAYERS=xcsxcu:file://$I/share/registry xcsxcu:file://$W/unittest/registry" "- env:UNO_TYPES=file://$I/program/types.rdb file://$I/program/types/offapi.rdb" "- env:UNO_SERVICES=file://$W/Rdb/ure/services.rdb file://$W/ComponentTarget/comphelper/util/comphelp.component file://$W/ComponentTarget/configmgr/source/configmgr.component file://$W/ComponentTarget/framework/util/fwk.component file://$W/ComponentTarget/i18npool/util/i18npool.component file://$W/ComponentTarget/package/util/package2.component file://$W/ComponentTarget/package/source/xstor/xstor.component file://$W/ComponentTarget/sfx2/util/sfx.component file://$W/ComponentTarget/ucb/source/core/ucb1.component file://$W/ComponentTarget/ucb/source/ucp/file/ucpfile1.component file://$W/ComponentTarget/unotools/util/utl.component file://$W/ComponentTarget/unoxml/source/service/unoxml.component file://$W/ComponentTarget/uui/util/uui.component" -env:URE_INTERNAL_LIB_DIR=file://$I/program -env:LO_LIB_DIR=file://$I/program -env:LO_JAVA_DIR=file://$I/program/classes --protector $W/LinkTarget/Library/unoexceptionprotector.so unoexceptionprotector -- protector $W/LinkTarget/Library/unobootstrapprotector.so unobootstrapprotector --protector $W/LinkTarget/Library/libvclbootstrapprotector.so vclbootstrapprotector "-env:CPPUNITTESTTARGET=$W/CppunitTest/sw_uwriter.test" ) > $W/CppunitTest/sw_uwriter.test.log 2>&1 [ 7806s] ToxTextGeneratorTest::EmptyStringIsReturnedForPageNumberPlaceholderOfZe roItems finished in: 0ms [ 7806s] ToxTextGeneratorTest::OneAtSignIsReturnedForPageNumberPlaceholderOfOneI tem finished in: 0ms [ 7806s] ToxTextGeneratorTest::TwoAtSignsAreReturnedForPageNumberPlaceholderOfOn eItem finished in: 0ms [ 7806s] ToxTextGeneratorTest::EmptyStringIsReturnedAsNumStringIfNoTextMarkIsSet finished in: 0ms [ 7806s] ToxTextGeneratorTest::EmptyStringIsReturnedAsNumStringIfToxSourcesIsEmp ty finished in: 0ms [ 7806s] which: no gdb in (/usr/local/bin:/usr/bin:/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/l ib64/jvm/java/bin) [ 7806s] You need gdb in your path to show backtraces [ 7806s] [ 7806s] Error: a unit test failed, please do one of: [ 7806s] [ 7806s] make CppunitTest_sw_uwriter CPPUNITTRACE="gdb --args" [ 7806s] # for interactive debugging on Linux [ 7806s] make CppunitTest_sw_uwriter VALGRIND=memcheck [ 7806s] # for memory checking [ 7806s] make CppunitTest_sw_uwriter DEBUGCPPUNIT=TRUE [ 7806s] # for exception catching -- You are receiving this mail because: You are the assignee for the bug.___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs