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

Bug#1040496: qt6-virtualkeyboard FTBFS with parallel=1: qmlcachegen segfaults



tags 1040496 + patch
thanks

El 2/4/24 a las 23:48, Bernhard Übelacker escribió:
Hello,
I tried to reproduce this inside a minimal stable/bookworm VM
and received a qmlcachegen crash.

See attached file for details.
The resulting backtrace is quite similar to that found in:
   https://bugreports.qt.io/browse/QTBUG-117361

Might avoid the crash, but cannot say if this would make the build succeed.

Hi. I confirm that the above patch for qt6-declarative makes
qt6-virtualkeyboard to build again on a single-cpu machine.

I took the patch from this url:

https://codereview.qt-project.org/gitweb?p=qt/qtdeclarative.git;a=commitdiff;h=d0c7f46b4090010fbb8ebfd6ce200d8bb3dbaadb;hp=8a22282f6aaea10281417e14f1e8e4799bd348d0

and adapted it so that it applies cleanly to the bookworm version of qt6-declarative.

The result is attached.

Thanks.
--- a/src/qmlcompiler/qqmljstypepropagator.cpp
+++ b/src/qmlcompiler/qqmljstypepropagator.cpp
@@ -886,6 +886,12 @@ void QQmlJSTypePropagator::generate_StoreProperty(int nameIndex, int base)
         return;
     }
 
+    if (property.storedType().isNull()) {
+        setError(u"Cannot determine type for property %1 of type %2"_s.arg(
+                propertyName, callBase.descriptiveName()));
+        return;
+    }
+
     if (!property.isWritable()) {
         setError(u"Can't assign to read-only property %1"_s.arg(propertyName));
 
--- a/tests/auto/qml/qmlcppcodegen/data/failures.qml
+++ b/tests/auto/qml/qmlcppcodegen/data/failures.qml
@@ -9,6 +9,7 @@ QtObject {
     property string attachedForNasty: Nasty.objectName
 
     property Nasty nasty: Nasty {
+        id: theNasty
         objectName: Component.objectName
     }
 
@@ -39,4 +40,11 @@ QtObject {
 
     property int enumFromGadget1: GadgetWithEnum.CONNECTED + 1
     property int enumFromGadget2: TT2.GadgetWithEnum.CONNECTED + 1
+
+    property alias selfself: self
+    property alias nastyBad: theNasty.bad
+    function writeToUnknown() : int {
+        self.selfself.nastyBad = undefined;
+        return 5;
+    }
 }

Reply to: