[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#917066: libqbscore1.12: log-level debug causes segfault



Package: libqbscore1.12
Version: 1.12.1
Severity: normal
Tags: patch upstream


Enabling --log-level debug (or using --more-verbose) (in the build of
dewalls) causes the build to fail with a segfault.

This has been discussed upstream and a fix for the null pointer
dereference produced. Please apply the attached patch to the package until the next
release when you should be able to drop this patch. 

Details are in this thread:
https://lists.qt-project.org/pipermail/qbs/2018-December/002290.html
(some of it was not copied to the list)

You can reproduce/test it as follows: 

Install the debug version of libqbscore1.12. Get the dewalls package,
unpack it, cd into it and run dpkg-buildpackage so the 'deb' profile is set up.
then run
qbs build --settings-dir /tmp --log-level debug  --command-echo-mode command-line --no-install       
profile:deb modules.qbs.installRoot:/home/wookey/packages/cavewhere/dewalls/debian/dewalls-1.0.0/debian/tmp
project.libDir:lib/x86_64-linux-gnu config:qbs-build

You'll need to adjust the installRoot path.
         
it fails with:
qbs.moduleloader:
Resolving Probe at "/usr/share/qbs/modules/bundle/BundleModule.qbs:46:5"
qbs.moduleloader: Probe disabled; skipping
qbs.moduleloader: reset instance scope of module "Qt.core" in property "cxxFlags" of module ("cpp")
                                           
Thread 3 "QThread" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff72e89700 (LWP 16286)]
0x00007ffff78ca457 in QStringRef::toString() const () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
Description: Fix for segfault with --log-level debug
 A segfault can occur when the debug logging level is enabled if the 'sourceCode' value is null.

Origin: upstream https://lists.qt-project.org/pipermail/qbs/2018-December/002292.html
Bug-Debian: https://bugs.debian.org/
Reviewed-By: wookey@debian.org
Last-Update: 2018-12-21

--- qbs-1.12.2+dfsg.orig/src/lib/corelib/language/moduleloader.cpp
+++ qbs-1.12.2+dfsg/src/lib/corelib/language/moduleloader.cpp
@@ -2341,9 +2341,11 @@ void ModuleLoader::adjustDefiningItemsIn
                         << ", old defining item was " << v->definingItem()
                         << " with scope" << v->definingItem()->scope()
                         << ", new defining item is" << replacement
-                        << " with scope" << replacement->scope()
-                        << ", value source code is "
+                        << " with scope" << replacement->scope();
+                if (v->type() == Value::JSSourceValueType) {
+                    qCDebug(lcModuleLoader) << "value source code is"
                         << std::static_pointer_cast<JSSourceValue>(v)->sourceCode().toString();
+                }
                 replacement->setPropertyDeclaration(propName, decl);
                 replacement->setProperty(propName, v);
             } else {

Reply to: