Closed marcelpetrick closed 1 month ago
Hi can you show me your deployment command ?
Hello @EndrII, sorry for the brief report last evening, but I was in a hurry after trying out to fix it on my side.
cqtdeployer --verbose 3 -bin /home/ps/Documents/p118/projects/p118-bora.tfs/03_SourceCode/hmi/build/Clone_of_Desktop_Qt_6_5_5_GCC_64bit-Debug/src/P118 -qmake /home/ps/Documents/p118/Qt/6.5.5/gcc_64/bin/qmake -qmlDir /home/ps/Documents/p118/projects/p118-bora.tfs/03_SourceCode/hmi/src/qml/ -targetDir /home/ps/DistributionKit/P118 clear
As seen above.
It was working before we ported the app from Qt5 to 6. Of course the paths for qmake and the bin were adapted, but else it does nothing fancy.
Do you have any similar reports or idea why this could crash?
i need more time to found issue, this is looks as trouble int CQtDeployer distribution package... or host filesystem. but is supper strength that its crashed only on qt6 ...
Can you show me verbose log - its needed to check where is crashed -verbose 3
Hi @EndrII That's the output Info: Deploy ... Info: clear old data Info: Clear start! Info: copy :/home/ps/Documents/p118/projects/p118-bora.tfs/03_SourceCode/hmi/build/Clone_of_Desktop_Qt_6_5_5_GCC_64bit-Debug/src/P118 /snap/cqtdeployer/279/CQtDeployer.sh: line 37: 4849 Segmentation fault (core dumped) "$BASE_DIR/bin/CQtDeployer" "$@"
Oh) , it's not a verbose log, please use -verbose 3 instead --verbose 3 i see you insert two - symbols before verbose. Use only one, please )
I already used two hypens
@EndrII Looks that is failing getting the qml files. From my understanding the program is reading all qml files import and seek for it in the file system.
extracter.cpp if (qmlScaner && !qmlScaner->scan(plugins, info.absoluteFilePath())) { QuasarAppUtils::Params::log("Failed to run qml scanner", QuasarAppUtils::Error); continue; }
With a custom import this process is failing:
com/bora/foodpreferencecontroller is not a part of Qt6.5.5. It's a custom import that have no path in Qt/6.5.5/gcc_64/qml to which he is trying to access => Segmentation Fault
@EndrII Commenting the scan method in extractor.cpp no segmentation fault is showing up. So most likely the issue is happening there.
The issue seems to be in the qmlqt6.cpp file in the function: [58] bool QMLQt6::extractImportsFromDir(const QString &path, bool recursive)
in fact commenting the line 217 of the same file gets no segmentation fault
How many times cqtdeployer print message with path ? because i see here stack overflow ... on recursive search dependencies ...
Several. Looks not the existance of path itself but something happening in the recursive calls.
bool QMLQt6::extractImportsFromDir(const QString &pt, bool recursive) {
QuasarAppUtils::Params::log( "ENTER POINT" ,QuasarAppUtils::Info);
QuasarAppUtils::Params::log( "PATH" ,QuasarAppUtils::Info);
QString path = pt;
QuasarAppUtils::Params::log( path ,QuasarAppUtils::Info);
QDir dir(path);
if (!dir.isReadable()) {
return false;
}
auto files = dir.entryInfoList(QStringList() << "*.qml" << "*.QML", QDir::Files);
auto qmlmodule = dir.entryInfoList(QStringList() << "qmldir", QDir::Files);
auto dirs = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::Dirs);
for (const auto &info: files) {
auto imports = extractImportsFromFile(info.absoluteFilePath());
for (const auto &import : std::as_const(imports)) {
if (!_imports.contains(import)) {
_imports.insert(import);
QuasarAppUtils::Params::log( "IMPORT:" ,QuasarAppUtils::Info);
QuasarAppUtils::Params::log( import ,QuasarAppUtils::Info);
extractImportsFromDir(getPathFromImport(import), false);
}
}
}
for (const auto& module: std::as_const(qmlmodule)) {
QStringList imports = extractImportsFromQmlModule(module.absoluteFilePath());
imports += extractImportsFromFile(module.absoluteFilePath());
for (const auto &import : std::as_const(imports)) {
if (!_imports.contains(import)) {
_imports.insert(import);
extractImportsFromDir(getPathFromImport(import), false);
}
}
}
// task https://github.com/QuasarApp/CQtDeployer/issues/600
// There are no import lines for the qt models module in Qt 6.1, but this module is required for all qml applications.
auto importQtQml = "QtQml";
if (!_imports.contains(importQtQml)) {
_imports.insert(importQtQml);
extractImportsFromDir(getPathFromImport(importQtQml), false);
}
if (recursive) {
for (const auto &info: dirs) {
extractImportsFromDir(info.absoluteFilePath(), recursive);
}
}
QuasarAppUtils::Params::log( "RETURN CHECKPOINT" ,QuasarAppUtils::Info);
return true;
}
OUTPUT:
Hm... can you try to deploy your project using deb version of cqtdeployer? Or using snap but on other Ubuntu (not 18.04)? I think trouble in file system access between core22 and Ubuntu 18.04. It may bug of snap.
So to fix it, I need to deploy cqtdeployer based on other core package... If i right, the deb version of cqtdeployer will work correctly.
I'm using a VM of Kubuntu 22.04.4
I'll try with the deb version. . .
I was using the one downloaded with snap. I compiled from sources just to debug.
Same Issue. In photo also the packet that I installed.
@EndrII @marcelpetrick the segmentation fault issue was coming up because inside one of the parsed qml files was there importConfirmationPopup.open() adding in the filter a space after the import statement avoids these "fake import" to be catched.
renaming importConfirmationPopup.open() as well as add a space in the filter (see PR-822) solves the issue.
Thank you ) tests is passed, i will publish fixed version.
Thanks for your support :)
@waelkarman please update your cqtdeployer and check your fixes. If all is good, please close this issue. Thank you for your help!
@EndrII I can't close the issue, @marcelpetrick could you please close it? It's tested.
@marcelpetrick i close this issue, if its still not fixed for you just reopen it.
I had previously a Qt 5.15 application, which was ported to Qt 6.5. Now the deployment fails. CQtDeployer is still the same. I have adapted of course the deployment parameters.
The idea is just to collect for a proper C++/QML-app all needed artifacts.
Any idea, what could trigger this crash? Thank you in advance.
ps. Enabling verbose was not really increasing the output why the crash happens.
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context Add any other context about the problem here.