Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1767

Segfault for aggregated product with export

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • 2.2.0
    • 2.1.0, 2.1.1, 2.1.2
    • General
    • None
    • Windows 10, macOS 14.0
    • All

    Description

      Resolving build graph for such product ends with segfault:

      Product {
          name: "test"
      
          qbs.buildVariants: ["debug", "release"]
          aggregate: true
          multiplexByQbsProperties: ["buildVariants"]
      
          Export {
              Depends { name: "cpp" }
              cpp.defines: ["foo"]
          }
      }
      

      Originally it was found on macOS while building universal binary for x86_64 and arm64 architectures (multiplexByQbsProperties: ["architectures"], no qbs.buildVariants).

      Breaking commit in qbs is fb52fed84a1510a7de0172e643d6fd66a780e2e8 (qbs built from e178052c763dbe18304a101d6f96e79881081e1a works fine).

      Backtrace at the moment of segfault (shared_ptr in properties points to nullptr) from macOS:

      Process 26404 stopped
      * thread #4, name = 'QThread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
          frame #0: 0x000000010209bd98 libqbscore.2.1.0.dylib`qbs::Internal::Value::type(this=0x0000000000000000) const at value.h:82:32
         79       Value(const Value &other);
         80       virtual ~Value();
         81  
      -> 82       Type type() const { return m_type; }
         83       virtual void apply(ValueHandler *) = 0;
         84       virtual ValuePtr clone() const = 0;
         85       virtual CodeLocation location() const { return {}; }
      Target 0: (qbs) stopped.
      (lldb) bt all
        thread #1, queue = 'com.apple.main-thread'
          frame #0: 0x000000018bba322c libsystem_kernel.dylib`poll + 8
          frame #1: 0x0000000100cb4264 QtCore`qt_safe_poll(pollfd*, unsigned int, timespec const*) + 152
          frame #2: 0x0000000100cb5cfc QtCore`QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 1028
          frame #3: 0x0000000100c53f34 QtCore`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 544
          frame #4: 0x0000000100c5807c QtCore`QCoreApplication::exec() + 132
          frame #5: 0x0000000100015774 qbs`main(argc=2, argv=0x000000016fdff208) at main.cpp:91:16
          frame #6: 0x000000018b861058 dyld`start + 2224
        thread #2
          frame #0: 0x000000018bb9c564 libsystem_kernel.dylib`__workq_kernreturn + 8
        thread #3
          frame #0: 0x000000018bb9c564 libsystem_kernel.dylib`__workq_kernreturn + 8
      * thread #4, name = 'QThread', stop reason = EXC_BAD_ACCESS (code=1, address=0x8)
        * frame #0: 0x000000010209bd98 libqbscore.2.1.0.dylib`qbs::Internal::Value::type(this=0x0000000000000000) const at value.h:82:32
          frame #1: 0x0000000102173bf0 libqbscore.2.1.0.dylib`qbs::Internal::ProjectResolver::setupExportedProperties(this=0x000000016ff9d8d0, item=0x000000012a8153e0, namePrefix=0x000000016ff9c0f0, properties=size=1) at projectresolver.cpp:1005:16
          frame #2: 0x0000000102173c4c libqbscore.2.1.0.dylib`qbs::Internal::ProjectResolver::setupExportedProperties(this=0x000000016ff9d8d0, item=0x000000012a815350, namePrefix=0x000000016ff9c258, properties=size=1) at projectresolver.cpp:1006:13
          frame #3: 0x000000010216d5dc libqbscore.2.1.0.dylib`qbs::Internal::ProjectResolver::resolveExport(this=0x000000016ff9d8d0, exportItem=0x000000012a815350, (null)=0x000000016ff9d5b8) at projectresolver.cpp:1099:5
          frame #4: 0x000000010216b58c libqbscore.2.1.0.dylib`qbs::Internal::ProjectResolver::callItemFunction(this=0x000000016ff9d8d0, mappings=0x00000001023b1800, item=0x000000012a815350, projectContext=0x000000016ff9d5b8) at projectresolver.cpp:1786:9
          frame #5: 0x000000010216c670 libqbscore.2.1.0.dylib`qbs::Internal::ProjectResolver::resolveProductFully(this=0x000000016ff9d8d0, item=0x000000012a814270, projectContext=0x000000016ff9d5b8) at projectresolver.cpp:525:9
          frame #6: 0x00000001021691fc libqbscore.2.1.0.dylib`qbs::Internal::ProjectResolver::resolveProduct(this=0x000000016ff9d8d0, item=0x000000012a814270, projectContext=0x000000016ff9d5b8) at projectresolver.cpp:434:9
          frame #7: 0x000000010216b58c libqbscore.2.1.0.dylib`qbs::Internal::ProjectResolver::callItemFunction(this=0x000000016ff9d8d0, mappings=0x00000001023b17f0, item=0x000000012a814270, projectContext=0x000000016ff9d5b8) at projectresolver.cpp:1786:9
          frame #8: 0x0000000102168ca0 libqbscore.2.1.0.dylib`qbs::Internal::ProjectResolver::resolveProjectFully(this=0x000000016ff9d8d0, item=0x000000012a813a00, projectContext=0x000000016ff9d5b8) at projectresolver.cpp:349:13
          frame #9: 0x0000000102166f0c libqbscore.2.1.0.dylib`qbs::Internal::ProjectResolver::resolveProject(this=0x000000016ff9d8d0, item=0x000000012a813a00, projectContext=0x000000016ff9d5b8) at projectresolver.cpp:293:9
          frame #10: 0x0000000102165e68 libqbscore.2.1.0.dylib`qbs::Internal::ProjectResolver::resolveTopLevelProject(this=0x000000016ff9d8d0) at projectresolver.cpp:248:5
          frame #11: 0x0000000102165a10 libqbscore.2.1.0.dylib`qbs::Internal::ProjectResolver::resolve(this=0x000000016ff9d8d0) at projectresolver.cpp:169:15
          frame #12: 0x0000000102125e90 libqbscore.2.1.0.dylib`qbs::Internal::Loader::loadProject(this=0x000000016ff9e3b0, _parameters=0x000000016ff9e808) at loader.cpp:165:43
          frame #13: 0x0000000101f94e34 libqbscore.2.1.0.dylib`qbs::Internal::BuildGraphLoader::trackProjectChanges(this=0x000000016ff9e7f0) at buildgraphloader.cpp:355:41
          frame #14: 0x0000000101f931c4 libqbscore.2.1.0.dylib`qbs::Internal::BuildGraphLoader::load(this=0x000000016ff9e7f0, existingProject=nullptr, parameters=0x000000012a713248, evalContext=std::__1::shared_ptr<qbs::Internal::RulesEvaluationContext>::element_type @ 0x000000012a612260 strong=3 weak=1) at buildgraphloader.cpp:142:5
          frame #15: 0x0000000101ec3980 libqbscore.2.1.0.dylib`qbs::Internal::InternalSetupProjectJob::restoreProject(this=0x000000012a7131e0, evalContext=std::__1::shared_ptr<qbs::Internal::RulesEvaluationContext>::element_type @ 0x000000012a612260 strong=3 weak=1) at internaljobs.cpp:344:24
          frame #16: 0x0000000101ec33ec libqbscore.2.1.0.dylib`qbs::Internal::InternalSetupProjectJob::execute(this=0x000000012a7131e0) at internaljobs.cpp:304:49
          frame #17: 0x0000000101ec300c libqbscore.2.1.0.dylib`qbs::Internal::InternalSetupProjectJob::start(this=0x000000012a7131e0) at internaljobs.cpp:271:9
          frame #18: 0x0000000101ec7b24 libqbscore.2.1.0.dylib`QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (qbs::Internal::InternalJob::*)()>::call(f=0x00000000000000010000000000000060, o=0x000000012a7131e0, arg=0x000000012a612f38) at qobjectdefs_impl.h:152:13
          frame #19: 0x0000000101ec7a68 libqbscore.2.1.0.dylib`void QtPrivate::FunctionPointer<void (qbs::Internal::InternalJob::*)()>::call<QtPrivate::List<>, void>(f=0x00000000000000010000000000000060, o=0x000000012a7131e0, arg=0x000000012a612f38) at qobjectdefs_impl.h:185:13
          frame #20: 0x0000000101ec7970 libqbscore.2.1.0.dylib`QtPrivate::QSlotObject<void (qbs::Internal::InternalJob::*)(), QtPrivate::List<>, void>::impl(which=1, this_=0x000000012a715130, r=0x000000012a7131e0, a=0x000000012a612f38, ret=0x0000000000000000) at qobjectdefs_impl.h:418:17
          frame #21: 0x0000000100c7f1e4 QtCore`QObject::event(QEvent*) + 596
          frame #22: 0x0000000100c57e4c QtCore`QCoreApplicationPrivate::notify_helper(QObject*, QEvent*) + 404
          frame #23: 0x0000000100c5798c QtCore`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 292
          frame #24: 0x0000000100c58b70 QtCore`QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 496
          frame #25: 0x0000000100cb594c QtCore`QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 84
          frame #26: 0x0000000100c53f34 QtCore`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 544
          frame #27: 0x0000000100aa7e3c QtCore`QThread::exec() + 136
          frame #28: 0x0000000100aa8dc4 QtCore`___lldb_unnamed_symbol7225 + 284
          frame #29: 0x000000018bbdb034 libsystem_pthread.dylib`_pthread_start + 136
      (lldb)
      

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            undefbehavior Dmitrii Meshkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes