Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-25190

Qt Creator crashes on Ubuntu 16.04 whilst loading ClangFormat plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • Qt Creator 4.14.0
    • All Other Issues
    • None
    • Ubuntu 16.04
    • Linux/X11

      Qt Creator crashes with segmentation fault whilst loading ClangFormat plugin. I tried debugging with gdb and found that QtCreator loads system libLLVM-6.0.so.1 and crashes when calling 

      llvm::StringMapImpl::LookupBucketFor(llvm::StringRef) () from /usr/lib/x86_64-linux-gnu/libLLVM-6.0.so.1

       

      When I rename /usr/lib/x86_64-linux-gnu/libLLVM-6.0.so.1, no crash is observed. I can not permanently rename this library, as this is a system installed library and Ubuntu 16.04 system applications have a dependency on it.

      Backtrace during crash:

      #0  0x00007fffc4dd8097 in llvm::StringMapImpl::LookupBucketFor(llvm::StringRef) () from /usr/lib/x86_64-linux-gnu/libLLVM-6.0.so.1
      #1  0x00007fffc4dab4f1 in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-6.0.so.1
      #2  0x00007fffc4dac193 in ?? () from /usr/lib/x86_64-linux-gnu/libLLVM-6.0.so.1
      #3  0x00007fffc4dac403 in llvm::cl::Option::addArgument() () from /usr/lib/x86_64-linux-gnu/libLLVM-6.0.so.1
      #4  0x00007fffbcbb2506 in ?? () from /opt/qtcreator-4.14.1/lib/qtcreator/plugins/libClangFormat.so
      #5  0x00007ffff7de76fa in call_init (l=<optimised out>, argc=argc@entry=1, argv=argv@entry=0x7fffffffdc18, env=env@entry=0x7fffffffdc28) at dl-init.c:72
      #6  0x00007ffff7de780b in call_init (env=0x7fffffffdc28, argv=0x7fffffffdc18, argc=1, l=<optimised out>) at dl-init.c:30
      #7  _dl_init (main_map=main_map@entry=0xb97f40, argc=1, argv=0x7fffffffdc18, env=0x7fffffffdc28) at dl-init.c:120
      #8  0x00007ffff7dec922 in dl_open_worker (a=a@entry=0x7fffffffd090) at dl-open.c:575
      #9  0x00007ffff7de75a4 in _dl_catch_error (objname=objname@entry=0x7fffffffd080, errstring=errstring@entry=0x7fffffffd088, mallocedp=mallocedp@entry=0x7fffffffd07f, 
          operate=operate@entry=0x7ffff7dec510 <dl_open_worker>, args=args@entry=0x7fffffffd090) at dl-error.c:187
      #10 0x00007ffff7debde9 in _dl_open (file=0xb7a148 "/opt/qtcreator-4.14.1/lib/qtcreator/plugins/libClangFormat.so", mode=-2147479551, 
          caller_dlopen=0x7ffff58185b8 <QLibraryPrivate::load_sys()+1960>, nsid=-2, argc=<optimised out>, argv=<optimised out>, env=0x7fffffffdc28) at dl-open.c:660
      #11 0x00007ffff3748f09 in dlopen_doit (a=a@entry=0x7fffffffd2c0) at dlopen.c:66
      #12 0x00007ffff7de75a4 in _dl_catch_error (objname=0x64e530, errstring=0x64e538, mallocedp=0x64e528, operate=0x7ffff3748eb0 <dlopen_doit>, args=0x7fffffffd2c0) at dl-error.c:187
      #13 0x00007ffff3749571 in _dlerror_run (operate=operate@entry=0x7ffff3748eb0 <dlopen_doit>, args=args@entry=0x7fffffffd2c0) at dlerror.c:163
      #14 0x00007ffff3748fa1 in __dlopen (file=<optimised out>, mode=<optimised out>) at dlopen.c:87
      #15 0x00007ffff58185b8 in QLibraryPrivate::load_sys() () from /opt/qtcreator-4.14.1/bin/../lib/Qt/lib/libQt5Core.so.5
      #16 0x00007ffff58116fa in QLibraryPrivate::load() () from /opt/qtcreator-4.14.1/bin/../lib/Qt/lib/libQt5Core.so.5
      #17 0x00007ffff5811d4e in QLibraryPrivate::loadPlugin() () from /opt/qtcreator-4.14.1/bin/../lib/Qt/lib/libQt5Core.so.5
      #18 0x00007ffff58057f5 in QPluginLoader::load() () from /opt/qtcreator-4.14.1/bin/../lib/Qt/lib/libQt5Core.so.5
      #19 0x00007ffff7bc035c in ExtensionSystem::Internal::PluginSpecPrivate::loadLibrary() () from /opt/qtcreator-4.14.1/bin/../lib/qtcreator/libExtensionSystem.so.4
      #20 0x00007ffff7bbb6bb in ExtensionSystem::Internal::PluginManagerPrivate::loadPlugin(ExtensionSystem::PluginSpec*, ExtensionSystem::PluginSpec::State) ()
         from /opt/qtcreator-4.14.1/bin/../lib/qtcreator/libExtensionSystem.so.4
      #21 0x00007ffff7bbbe13 in ExtensionSystem::Internal::PluginManagerPrivate::loadPlugins() () from /opt/qtcreator-4.14.1/bin/../lib/qtcreator/libExtensionSystem.so.4
      #22 0x000000000040a15e in ?? ()
      #23 0x00007ffff48d1840 in __libc_start_main (main=0x407af0, argc=1, argv=0x7fffffffdc18, init=<optimised out>, fini=<optimised out>, rtld_fini=<optimised out>, 
          stack_end=0x7fffffffdc08) at ../csu/libc-start.c:291
      #24 0x000000000040aeb7 in ?? ()
       

      After renaming /usr/lib/x86_64-linux-gnu/libLLVM-6.0.so.1 with breakpoint set for llvm::StringMapImpl::LookupBucketFor No crash observed in this case

       #0  0x00007fffc3a5d940 in llvm::StringMapImpl::LookupBucketFor(llvm::StringRef)@plt () from /opt/qtcreator-4.14.1/lib/qtcreator/plugins/libClangFormat.so
      #1  0x00007fffc3b11325 in ?? () from /opt/qtcreator-4.14.1/lib/qtcreator/plugins/libClangFormat.so
      #2  0x00007fffc3a65fcc in ?? () from /opt/qtcreator-4.14.1/lib/qtcreator/plugins/libClangFormat.so
      #3  0x00007ffff7de76fa in call_init (l=<optimised out>, argc=argc@entry=1, argv=argv@entry=0x7fffffffdc18, env=env@entry=0x7fffffffdc28) at dl-init.c:72
      #4  0x00007ffff7de780b in call_init (env=0x7fffffffdc28, argv=0x7fffffffdc18, argc=1, l=<optimised out>) at dl-init.c:30
      #5  _dl_init (main_map=main_map@entry=0xa19150, argc=1, argv=0x7fffffffdc18, env=0x7fffffffdc28) at dl-init.c:120
      #6  0x00007ffff7dec922 in dl_open_worker (a=a@entry=0x7fffffffd090) at dl-open.c:575
      #7  0x00007ffff7de75a4 in _dl_catch_error (objname=objname@entry=0x7fffffffd080, errstring=errstring@entry=0x7fffffffd088, mallocedp=mallocedp@entry=0x7fffffffd07f, 
          operate=operate@entry=0x7ffff7dec510 <dl_open_worker>, args=args@entry=0x7fffffffd090) at dl-error.c:187
      #8  0x00007ffff7debde9 in _dl_open (file=0xa18188 "/opt/qtcreator-4.14.1/lib/qtcreator/plugins/libClangFormat.so", mode=-2147479551, 
          caller_dlopen=0x7ffff58185b8 <QLibraryPrivate::load_sys()+1960>, nsid=-2, argc=<optimised out>, argv=<optimised out>, env=0x7fffffffdc28) at dl-open.c:660
      #9  0x00007ffff3748f09 in dlopen_doit (a=a@entry=0x7fffffffd2c0) at dlopen.c:66
      #10 0x00007ffff7de75a4 in _dl_catch_error (objname=0x64e530, errstring=0x64e538, mallocedp=0x64e528, operate=0x7ffff3748eb0 <dlopen_doit>, args=0x7fffffffd2c0) at dl-error.c:187
      #11 0x00007ffff3749571 in _dlerror_run (operate=operate@entry=0x7ffff3748eb0 <dlopen_doit>, args=args@entry=0x7fffffffd2c0) at dlerror.c:163
      #12 0x00007ffff3748fa1 in __dlopen (file=<optimised out>, mode=<optimised out>) at dlopen.c:87
      #13 0x00007ffff58185b8 in QLibraryPrivate::load_sys() () from /opt/qtcreator-4.14.1/bin/../lib/Qt/lib/libQt5Core.so.5
      #14 0x00007ffff58116fa in QLibraryPrivate::load() () from /opt/qtcreator-4.14.1/bin/../lib/Qt/lib/libQt5Core.so.5
      #15 0x00007ffff5811d4e in QLibraryPrivate::loadPlugin() () from /opt/qtcreator-4.14.1/bin/../lib/Qt/lib/libQt5Core.so.5
      #16 0x00007ffff58057f5 in QPluginLoader::load() () from /opt/qtcreator-4.14.1/bin/../lib/Qt/lib/libQt5Core.so.5
      #17 0x00007ffff7bc035c in ExtensionSystem::Internal::PluginSpecPrivate::loadLibrary() () from /opt/qtcreator-4.14.1/bin/../lib/qtcreator/libExtensionSystem.so.4
      #18 0x00007ffff7bbb6bb in ExtensionSystem::Internal::PluginManagerPrivate::loadPlugin(ExtensionSystem::PluginSpec*, ExtensionSystem::PluginSpec::State) ()
         from /opt/qtcreator-4.14.1/bin/../lib/qtcreator/libExtensionSystem.so.4
      #19 0x00007ffff7bbbe13 in ExtensionSystem::Internal::PluginManagerPrivate::loadPlugins() () from /opt/qtcreator-4.14.1/bin/../lib/qtcreator/libExtensionSystem.so.4
      #20 0x000000000040a15e in ?? ()
      #21 0x00007ffff48d1840 in __libc_start_main (main=0x407af0, argc=1, argv=0x7fffffffdc18, init=<optimised out>, fini=<optimised out>, rtld_fini=<optimised out>, 
          stack_end=0x7fffffffdc08) at ../csu/libc-start.c:291
      #22 0x000000000040aeb7 in ?? ()
      

      It looks like Ubuntu 16.04 uses system LLVM library instead of one within ClangFormat plugin.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            con Eike Ziller
            raghunayak Raghavendra Nayak
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes