Page MenuHomePhabricator

[Tooling] [0/1] Refactor FrontendActionFactory::create() to return std::unique_ptr<>
AbandonedPublic

Authored by lebedev.ri on Feb 26 2018, 12:47 PM.

Details

Summary

Noticed during review of D41102.

I'm not sure whether there are any principal reasons why it returns raw owning pointer,
or it is just a old code that was not updated post-C++11.

I'm not too sure what testing i should do, because check-all is not error clean here for some reason,
but it does not appear asif those failures are related to these changes.

This is clang part.
Clang-tools-extra part is D43780.

Diff Detail

Repository
rL LLVM

Event Timeline

alexfh accepted this revision.Feb 27 2018, 3:23 AM

Awesome, thank you for this cleanup!

This revision is now accepted and ready to land.Feb 27 2018, 3:23 AM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.
lebedev.ri reopened this revision.Feb 27 2018, 8:00 AM

And reverted.

This broke gcc4.8 builds, compiler just segfaults:
http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/14909

...
[72/368] Building CXX object tools/clang/tools/extra/clang-tidy/CMakeFiles/clangTidy.dir/ClangTidyOptions.cpp.o
[73/368] Building CXX object tools/clang/tools/extra/clang-tidy/android/CMakeFiles/clangTidyAndroidModule.dir/AndroidTidyModule.cpp.o
[74/368] Building CXX object tools/clang/tools/extra/clang-tidy/android/CMakeFiles/clangTidyAndroidModule.dir/CloexecAccept4Check.cpp.o
FAILED: /bin/ccache  g++  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/tools/clang-check -I/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/tools/clang-check -I/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include -Itools/clang/include -I/usr/include/libxml2 -Iinclude -I/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/include -fPIC -fvisibility-inlines-hidden -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3    -UNDEBUG  -fno-exceptions -fno-rtti -MMD -MT tools/clang/tools/clang-check/CMakeFiles/clang-check.dir/ClangCheck.cpp.o -MF tools/clang/tools/clang-check/CMakeFiles/clang-check.dir/ClangCheck.cpp.o.d -o tools/clang/tools/clang-check/CMakeFiles/clang-check.dir/ClangCheck.cpp.o -c /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/tools/clang-check/ClangCheck.cpp
In file included from /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/tools/clang-check/ClangCheck.cpp:28:0:
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include/clang/Tooling/Tooling.h: In instantiation of 'clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*)::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor::ConsumerFactoryAdaptor(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = {anonymous}::ClangCheckActionFactory]':
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/include/llvm/ADT/STLExtras.h:951:63:   required from 'typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), std::unique_ptr<T> >::type llvm::make_unique(Args&& ...) [with T = clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = {anonymous}::ClangCheckActionFactory]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor; Args = {{anonymous}::ClangCheckActionFactory*&, clang::tooling::SourceFileCallbacks*&}; typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), std::unique_ptr<T> >::type = std::unique_ptr<clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = {anonymous}::ClangCheckActionFactory]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor, std::default_delete<clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = {anonymous}::ClangCheckActionFactory]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor> >]'
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include/clang/Tooling/Tooling.h:390:65:   required from 'std::unique_ptr<clang::FrontendAction> clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*)::FrontendActionFactoryAdapter::create() [with FactoryT = {anonymous}::ClangCheckActionFactory]'
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include/clang/Tooling/Tooling.h:425:3:   required from 'std::unique_ptr<clang::tooling::FrontendActionFactory> clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = {anonymous}::ClangCheckActionFactory]'
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/tools/clang-check/ClangCheck.cpp:183:61:   required from here
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include/clang/Tooling/Tooling.h:396:7: internal compiler error: Segmentation fault
       ConsumerFactoryAdaptor(FactoryT *ConsumerFactory,
       ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccYe9Zii.out file, please attach this to your bugreport.
FAILED: /bin/ccache  g++  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/tools/extra/clang-reorder-fields/tool -I/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/tools/extra/clang-reorder-fields/tool -I/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include -Itools/clang/include -I/usr/include/libxml2 -Iinclude -I/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/include -fPIC -fvisibility-inlines-hidden -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3    -UNDEBUG  -fno-exceptions -fno-rtti -MMD -MT tools/clang/tools/extra/clang-reorder-fields/tool/CMakeFiles/clang-reorder-fields.dir/ClangReorderFields.cpp.o -MF tools/clang/tools/extra/clang-reorder-fields/tool/CMakeFiles/clang-reorder-fields.dir/ClangReorderFields.cpp.o.d -o tools/clang/tools/extra/clang-reorder-fields/tool/CMakeFiles/clang-reorder-fields.dir/ClangReorderFields.cpp.o -c /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/tools/extra/clang-reorder-fields/tool/ClangReorderFields.cpp
In file included from /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include/clang/Tooling/Refactoring.h:23:0,
                 from /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/tools/extra/clang-reorder-fields/tool/../ReorderFieldsAction.h:19,
                 from /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/tools/extra/clang-reorder-fields/tool/ClangReorderFields.cpp:15:
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include/clang/Tooling/Tooling.h: In instantiation of 'clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*)::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor::ConsumerFactoryAdaptor(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::reorder_fields::ReorderFieldsAction]':
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/include/llvm/ADT/STLExtras.h:951:63:   required from 'typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), std::unique_ptr<T> >::type llvm::make_unique(Args&& ...) [with T = clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::reorder_fields::ReorderFieldsAction]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor; Args = {clang::reorder_fields::ReorderFieldsAction*&, clang::tooling::SourceFileCallbacks*&}; typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), std::unique_ptr<T> >::type = std::unique_ptr<clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::reorder_fields::ReorderFieldsAction]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor, std::default_delete<clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::reorder_fields::ReorderFieldsAction]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor> >]'
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include/clang/Tooling/Tooling.h:390:65:   required from 'std::unique_ptr<clang::FrontendAction> clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*)::FrontendActionFactoryAdapter::create() [with FactoryT = clang::reorder_fields::ReorderFieldsAction]'
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include/clang/Tooling/Tooling.h:425:3:   required from 'std::unique_ptr<clang::tooling::FrontendActionFactory> clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::reorder_fields::ReorderFieldsAction]'
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/tools/extra/clang-reorder-fields/tool/ClangReorderFields.cpp:63:59:   required from here
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include/clang/Tooling/Tooling.h:396:7: internal compiler error: Segmentation fault
       ConsumerFactoryAdaptor(FactoryT *ConsumerFactory,
       ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccfU168e.out file, please attach this to your bugreport.
FAILED: /bin/ccache  g++  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/tools/clang-rename -I/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/tools/clang-rename -I/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include -Itools/clang/include -I/usr/include/libxml2 -Iinclude -I/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/include -fPIC -fvisibility-inlines-hidden -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3    -UNDEBUG  -fno-exceptions -fno-rtti -MMD -MT tools/clang/tools/clang-rename/CMakeFiles/clang-rename.dir/ClangRename.cpp.o -MF tools/clang/tools/clang-rename/CMakeFiles/clang-rename.dir/ClangRename.cpp.o.d -o tools/clang/tools/clang-rename/CMakeFiles/clang-rename.dir/ClangRename.cpp.o -c /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/tools/clang-rename/ClangRename.cpp
In file included from /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include/clang/Tooling/Refactoring.h:23:0,
                 from /export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/tools/clang-rename/ClangRename.cpp:26:
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include/clang/Tooling/Tooling.h: In instantiation of 'clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*)::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor::ConsumerFactoryAdaptor(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::tooling::USRFindingAction]':
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/include/llvm/ADT/STLExtras.h:951:63:   required from 'typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), std::unique_ptr<T> >::type llvm::make_unique(Args&& ...) [with T = clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::tooling::USRFindingAction]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor; Args = {clang::tooling::USRFindingAction*&, clang::tooling::SourceFileCallbacks*&}; typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), std::unique_ptr<T> >::type = std::unique_ptr<clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::tooling::USRFindingAction]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor, std::default_delete<clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::tooling::USRFindingAction]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor> >]'
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include/clang/Tooling/Tooling.h:390:65:   required from 'std::unique_ptr<clang::FrontendAction> clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*)::FrontendActionFactoryAdapter::create() [with FactoryT = clang::tooling::USRFindingAction]'
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include/clang/Tooling/Tooling.h:425:3:   required from 'std::unique_ptr<clang::tooling::FrontendActionFactory> clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::tooling::USRFindingAction]'
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/tools/clang-rename/ClangRename.cpp:163:60:   required from here
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/include/clang/Tooling/Tooling.h:396:7: internal compiler error: Segmentation fault
       ConsumerFactoryAdaptor(FactoryT *ConsumerFactory,
       ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccQAAO2w.out file, please attach this to your bugreport.
ninja: build stopped: subcommand failed.
program finished with exit code 1
elapsedTime=225.461214

http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/22673

...
492.612 [873/22/3876] Building CXX object tools/clang/tools/extra/clang-tidy/hicpp/CMakeFiles/clangTidyHICPPModule.dir/SignedBitwiseCheck.cpp.o
492.721 [873/21/3877] Building CXX object tools/clang/tools/extra/clang-tidy/hicpp/CMakeFiles/clangTidyHICPPModule.dir/NoAssemblerCheck.cpp.o
492.756 [873/20/3878] Building CXX object tools/clang/tools/extra/clang-tidy/hicpp/CMakeFiles/clangTidyHICPPModule.dir/HICPPTidyModule.cpp.o
493.097 [873/19/3879] Building CXX object tools/clang/tools/extra/clang-reorder-fields/tool/CMakeFiles/clang-reorder-fields.dir/ClangReorderFields.cpp.o
FAILED: tools/clang/tools/extra/clang-reorder-fields/tool/CMakeFiles/clang-reorder-fields.dir/ClangReorderFields.cpp.o 
/usr/bin/c++   -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/tools/extra/clang-reorder-fields/tool -I/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/tools/extra/clang-reorder-fields/tool -I/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/include -Itools/clang/include -Iinclude -I/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/include -fPIC -fvisibility-inlines-hidden -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3    -UNDEBUG  -fno-exceptions -fno-rtti -MD -MT tools/clang/tools/extra/clang-reorder-fields/tool/CMakeFiles/clang-reorder-fields.dir/ClangReorderFields.cpp.o -MF tools/clang/tools/extra/clang-reorder-fields/tool/CMakeFiles/clang-reorder-fields.dir/ClangReorderFields.cpp.o.d -o tools/clang/tools/extra/clang-reorder-fields/tool/CMakeFiles/clang-reorder-fields.dir/ClangReorderFields.cpp.o -c /home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/tools/extra/clang-reorder-fields/tool/ClangReorderFields.cpp
In file included from /home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/include/clang/Tooling/Refactoring.h:23:0,
                 from /home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/tools/extra/clang-reorder-fields/tool/../ReorderFieldsAction.h:19,
                 from /home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/tools/extra/clang-reorder-fields/tool/ClangReorderFields.cpp:15:
/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/include/clang/Tooling/Tooling.h: In instantiation of ‘clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*)::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor::ConsumerFactoryAdaptor(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::reorder_fields::ReorderFieldsAction]’:
/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/include/llvm/ADT/STLExtras.h:951:63:   required from ‘typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), std::unique_ptr<T> >::type llvm::make_unique(Args&& ...) [with T = clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::reorder_fields::ReorderFieldsAction]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor; Args = {clang::reorder_fields::ReorderFieldsAction*&, clang::tooling::SourceFileCallbacks*&}; typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), std::unique_ptr<T> >::type = std::unique_ptr<clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::reorder_fields::ReorderFieldsAction]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor, std::default_delete<clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::reorder_fields::ReorderFieldsAction]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor> >]’
/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/include/clang/Tooling/Tooling.h:390:65:   required from ‘std::unique_ptr<clang::FrontendAction> clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*)::FrontendActionFactoryAdapter::create() [with FactoryT = clang::reorder_fields::ReorderFieldsAction]’
/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/include/clang/Tooling/Tooling.h:425:3:   required from ‘std::unique_ptr<clang::tooling::FrontendActionFactory> clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = clang::reorder_fields::ReorderFieldsAction]’
/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/tools/extra/clang-reorder-fields/tool/ClangReorderFields.cpp:63:59:   required from here
/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/include/clang/Tooling/Tooling.h:396:7: internal compiler error: Segmentation fault
       ConsumerFactoryAdaptor(FactoryT *ConsumerFactory,
       ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccNrAHqD.out file, please attach this to your bugreport.
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/_usr_lib_gcc_x86_64-linux-gnu_4.8_cc1plus.1001.crash'
493.171 [873/18/3880] Building CXX object tools/clang/tools/extra/clang-tidy/misc/CMakeFiles/clangTidyMiscModule.dir/MisplacedConstCheck.cpp.o
493.370 [873/17/3881] Building CXX object tools/clang/tools/extra/clang-tidy/llvm/CMakeFiles/clangTidyLLVMModule.dir/IncludeOrderCheck.cpp.o
493.479 [873/16/3882] Building CXX object tools/clang/tools/extra/clang-tidy/google/CMakeFiles/clangTidyGoogleModule.dir/TodoCommentCheck.cpp.o
493.799 [873/15/3883] Building CXX object tools/clang/tools/extra/clang-tidy/misc/CMakeFiles/clangTidyMiscModule.dir/MacroParenthesesCheck.cpp.o
493.913 [873/14/3884] Building CXX object tools/clang/tools/extra/clang-tidy/llvm/CMakeFiles/clangTidyLLVMModule.dir/HeaderGuardCheck.cpp.o
493.924 [873/13/3885] Building CXX object tools/clang/tools/extra/clang-tidy/misc/CMakeFiles/clangTidyMiscModule.dir/LambdaFunctionNameCheck.cpp.o
494.346 [873/12/3886] Building CXX object tools/clang/tools/extra/clang-tidy/llvm/CMakeFiles/clangTidyLLVMModule.dir/TwineLocalCheck.cpp.o
494.366 [873/11/3887] Building CXX object tools/clang/tools/extra/clang-tidy/misc/CMakeFiles/clangTidyMiscModule.dir/ForwardingReferenceOverloadCheck.cpp.o
495.010 [873/10/3888] Building CXX object tools/clang/tools/extra/clang-tidy/misc/CMakeFiles/clangTidyMiscModule.dir/DefinitionsInHeadersCheck.cpp.o
495.257 [873/9/3889] Building CXX object tools/clang/tools/extra/clang-tidy/misc/CMakeFiles/clangTidyMiscModule.dir/UnconventionalAssignOperatorCheck.cpp.o
495.407 [873/8/3890] Building CXX object tools/clang/tools/extra/clang-tidy/misc/CMakeFiles/clangTidyMiscModule.dir/NewDeleteOverloadsCheck.cpp.o
495.841 [873/7/3891] Building CXX object tools/clang/tools/extra/clang-tidy/misc/CMakeFiles/clangTidyMiscModule.dir/MiscTidyModule.cpp.o
495.946 [873/6/3892] Building CXX object tools/clang/tools/extra/clang-tidy/misc/CMakeFiles/clangTidyMiscModule.dir/MisplacedWideningCastCheck.cpp.o
496.463 [873/5/3893] Building CXX object tools/clang/tools/extra/clang-tidy/misc/CMakeFiles/clangTidyMiscModule.dir/MacroRepeatedSideEffectsCheck.cpp.o
496.841 [873/4/3894] Building CXX object tools/clang/tools/extra/clang-tidy/misc/CMakeFiles/clangTidyMiscModule.dir/SizeofContainerCheck.cpp.o
497.060 [873/3/3895] Building CXX object tools/clang/tools/clang-check/CMakeFiles/clang-check.dir/ClangCheck.cpp.o
FAILED: tools/clang/tools/clang-check/CMakeFiles/clang-check.dir/ClangCheck.cpp.o 
/usr/bin/c++   -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/tools/clang-check -I/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/tools/clang-check -I/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/include -Itools/clang/include -Iinclude -I/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/include -fPIC -fvisibility-inlines-hidden -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3    -UNDEBUG  -fno-exceptions -fno-rtti -MD -MT tools/clang/tools/clang-check/CMakeFiles/clang-check.dir/ClangCheck.cpp.o -MF tools/clang/tools/clang-check/CMakeFiles/clang-check.dir/ClangCheck.cpp.o.d -o tools/clang/tools/clang-check/CMakeFiles/clang-check.dir/ClangCheck.cpp.o -c /home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/tools/clang-check/ClangCheck.cpp
In file included from /home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/tools/clang-check/ClangCheck.cpp:28:0:
/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/include/clang/Tooling/Tooling.h: In instantiation of ‘clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*)::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor::ConsumerFactoryAdaptor(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = {anonymous}::ClangCheckActionFactory]’:
/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/include/llvm/ADT/STLExtras.h:951:63:   required from ‘typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), std::unique_ptr<T> >::type llvm::make_unique(Args&& ...) [with T = clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = {anonymous}::ClangCheckActionFactory]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor; Args = {{anonymous}::ClangCheckActionFactory*&, clang::tooling::SourceFileCallbacks*&}; typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), std::unique_ptr<T> >::type = std::unique_ptr<clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = {anonymous}::ClangCheckActionFactory]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor, std::default_delete<clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = {anonymous}::ClangCheckActionFactory]::FrontendActionFactoryAdapter::ConsumerFactoryAdaptor> >]’
/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/include/clang/Tooling/Tooling.h:390:65:   required from ‘std::unique_ptr<clang::FrontendAction> clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*)::FrontendActionFactoryAdapter::create() [with FactoryT = {anonymous}::ClangCheckActionFactory]’
/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/include/clang/Tooling/Tooling.h:425:3:   required from ‘std::unique_ptr<clang::tooling::FrontendActionFactory> clang::tooling::newFrontendActionFactory(FactoryT*, clang::tooling::SourceFileCallbacks*) [with FactoryT = {anonymous}::ClangCheckActionFactory]’
/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/tools/clang-check/ClangCheck.cpp:183:61:   required from here
/home/buildslave/buildslave1a/clang-x86_64-linux-abi-test/llvm/tools/clang/include/clang/Tooling/Tooling.h:396:7: internal compiler error: Segmentation fault
       ConsumerFactoryAdaptor(FactoryT *ConsumerFactory,
       ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccruvBXJ.out file, please attach this to your bugreport.
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/_usr_lib_gcc_x86_64-linux-gnu_4.8_cc1plus.1001.crash'
497.694 [873/2/3896] Building CXX object tools/clang/tools/extra/clang-tidy/misc/CMakeFiles/clangTidyMiscModule.dir/NonCopyableObjects.cpp.o
498.351 [873/1/3897] Building CXX object tools/clang/tools/extra/clang-tidy/misc/CMakeFiles/clangTidyMiscModule.dir/RedundantExpressionCheck.cpp.o
ninja: build stopped: subcommand failed.
program finished with exit code 1
elapsedTime=498.873315
This revision is now accepted and ready to land.Feb 27 2018, 8:00 AM

Do you have a way to reproduce the gcc crashes?

Do you have a way to reproduce the gcc crashes?

Not presently.
I'm on debian sid, so gcc4.8 is a lost-for-good relic from ancient past.

I'll try to create an debian-oldstable chroot, which still has gcc4.8, maybe that will help.

Hmm.
Got back to this issue.

Not reproducible with gcc-4.8.5 and gcc-4.9.3 in ubuntu 16.04 chroot.
*Reproducible* with gcc-4.8.4 and gcc-4.9.2 in debian oldstable (Jessie) chroot.
So one might assume that it was fixed.

I did try to creduce the crasher, but not not much success, since gcc takes 10+ sec to crash.

Should i simply try to re-commit and see if the buildbots got upgraded so this is no longer an issue?

alexfh added a comment.Apr 9 2018, 4:44 AM

Hmm.
Got back to this issue.

Not reproducible with gcc-4.8.5 and gcc-4.9.3 in ubuntu 16.04 chroot.
*Reproducible* with gcc-4.8.4 and gcc-4.9.2 in debian oldstable (Jessie) chroot.
So one might assume that it was fixed.

I did try to creduce the crasher, but not not much success, since gcc takes 10+ sec to crash.

That's unfortunate, but it could be even worse. My experience with creducing crashes is that the process can take up to several days. In this case, however, we know what changes cause the crash and it should be possible to construct the test case manually instead of creducing it.

Should i simply try to re-commit and see if the buildbots got upgraded so this is no longer an issue?

I wouldn't expect buildbots to have been upgraded without someone doing this on purpose. If you have the list of buildbots that crashed, you could look at their recent logs to figure out which GCC version they are using now. It *might* be fine to require a patched version of GCC, but in that case you would have to:
0. Ask llvm-dev+cfe-dev whether anyone has concerns in raising the minimum required version of GCC

  1. Fix the documentation, in particular this list: https://llvm.org/docs/GettingStarted.html#software and these instructions: https://llvm.org/docs/GettingStarted.html#getting-a-modern-host-c-toolchain
  2. Get buildbot maintainers to upgrade their GCC to at least the new required version

An alternative would be to try working around the bug.

Hmm.
Got back to this issue.

Not reproducible with gcc-4.8.5 and gcc-4.9.3 in ubuntu 16.04 chroot.
*Reproducible* with gcc-4.8.4 and gcc-4.9.2 in debian oldstable (Jessie) chroot.
So one might assume that it was fixed.

I did try to creduce the crasher, but not not much success, since gcc takes 10+ sec to crash.

That's unfortunate, but it could be even worse. My experience with creducing crashes is that the process can take up to several days. In this case, however, we know what changes cause the crash and it should be possible to construct the test case manually instead of creducing it.

Should i simply try to re-commit and see if the buildbots got upgraded so this is no longer an issue?

I wouldn't expect buildbots to have been upgraded without someone doing this on purpose. If you have the list of buildbots that crashed, you could look at their recent logs to figure out which GCC version they are using now.

Yes, it seems they weren't upgraded yet as of this time.

It *might* be fine to require a patched version of GCC, but in that case you would have to:
0. Ask llvm-dev+cfe-dev whether anyone has concerns in raising the minimum required version of GCC

Yep, did that right after posting that comment, http://lists.llvm.org/pipermail/llvm-dev/2018-April/122438.html

  1. Fix the documentation, in particular this list: https://llvm.org/docs/GettingStarted.html#software and these instructions: https://llvm.org/docs/GettingStarted.html#getting-a-modern-host-c-toolchain
  2. Get buildbot maintainers to upgrade their GCC to at least the new required version

    An alternative would be to try working around the bug.

FWIW - I had some thoughts on this a while back:
https://reviews.llvm.org/D4313

lebedev.ri abandoned this revision.Aug 29 2019, 9:50 AM

Superseded by D66960

Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2019, 9:50 AM