Sunday, August 14, 2022

Re: qcad segfault on 7.1 amd64

On Fri Aug 12, 2022 at 01:34:57PM +0100, Stuart Henderson wrote:
> [moving to ports@ where there's a slightly higher chance someone
> else reading might have an idea what's happening]
>
> On 2022-08-11, Andy Bradford <amb-sendok-1662777873.mdjmhnaeacklfpecffbm@bradfords.org> wrote:
> > Hello,
> >
> > I was running qcad without problems on 6.9 and decided to upgrade to
> > 7.1. After upgrading from 6.9->7.0->7.1 qcad now segfaults.
>
> Confirmed on -current as well.
>


Unfortunately I cannot find a solution, here is a trace with debug-qt.
Building qcad in debug does not shows more information. I had thought
that loading the shared libs aka. plugins makes trouble, but I don't
think so.


Starting program: /usr/local/bin/qcad
QCAD version 3.27.6.7
Warning: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-rsadowski'
17:40:17: Debug: loading plugins...
17:40:17: Debug: loading static plugins...
[New thread 613019]
[New thread 282046]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x000000ab1852f4e0 in QScriptEnginePrivate::mark (this=0xab5e932400, markStack=...) at /usr/obj/ports/qtscript-5.15.5/qtscript-everywhere-src-5.15.5/src/script/api/qscriptengine.cpp:1320
1320 /usr/obj/ports/qtscript-5.15.5/qtscript-everywhere-src-5.15.5/src/script/api/qscriptengine.cpp: No such file or directory.
(gdb) bt
#0 0x000000ab1852f4e0 in QScriptEnginePrivate::mark (this=0xab5e932400, markStack=...) at /usr/obj/ports/qtscript-5.15.5/qtscript-everywhere-src-5.15.5/src/script/api/qscriptengine.cpp:1320
#1 0x000000ab184aab6c in QTJSC::Heap::markRoots (this=0xaae9c2e9e8) at /usr/obj/ports/qtscript-5.15.5/qtscript-everywhere-src-5.15.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp:1167
#2 0x000000ab184a9905 in QTJSC::Heap::reset (this=0xaae9c2e9e8) at /usr/obj/ports/qtscript-5.15.5/qtscript-everywhere-src-5.15.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp:1269
#3 QTJSC::Heap::allocate (this=0xaae9c2e9e8, s=<optimized out>) at /usr/obj/ports/qtscript-5.15.5/qtscript-everywhere-src-5.15.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.cpp:405
#4 0x000000ab185384ee in QTJSC::JSCell::operator new (size=56, exec=<optimized out>) at /usr/obj/ports/qtscript-5.15.5/qtscript-everywhere-src-5.15.5/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSCell.h:167
#5 QScriptEnginePrivate::newVariant (this=0xab5e932400, value=...) at /usr/obj/ports/qtscript-5.15.5/qtscript-everywhere-src-5.15.5/src/script/api/qscriptengine.cpp:1797
#6 0x000000ab18539b71 in QScriptEngine::newVariant (this=<optimized out>, value=...) at /usr/obj/ports/qtscript-5.15.5/qtscript-everywhere-src-5.15.5/src/script/api/qscriptengine.cpp:2233
#7 0x000000aacaeb1411 in qtscript_create_Qt_class(QScriptEngine*) () from /usr/local/share/qcad/plugins/script/libqtscript_core.so.1.0
#8 0x000000aacaf56659 in qtscript_initialize_com_trolltech_qt_core_bindings(QScriptValue&) () from /usr/local/share/qcad/plugins/script/libqtscript_core.so.1.0
#9 0x000000aacadb5ba3 in non-virtual thunk to com_trolltech_qt_core_ScriptPlugin::initialize(QString const&, QScriptEngine*) () from /usr/local/share/qcad/plugins/script/libqtscript_core.so.1.0
#10 0x000000ab18540719 in QScriptEngine::importExtension (this=0xab8d294f40, extension=...) at /usr/obj/ports/qtscript-5.15.5/qtscript-everywhere-src-5.15.5/src/script/api/qscriptengine.cpp:3769
#11 0x000000ab01d77bf0 in RScriptHandlerEcma::RScriptHandlerEcma() () from /usr/local/lib/libqcadecmaapi.so.2.0
#12 0x000000ab01d85a3b in RScriptHandlerEcma::factory() () from /usr/local/lib/libqcadecmaapi.so.2.0
#13 0x000000ab0f5e265d in RScriptHandlerRegistry::getGlobalScriptHandler(QString const&) () from /usr/local/lib/libqcadcore.so.2.0
#14 0x000000a8b5ad4d03 in ?? ()
#15 0x000000a8b5ad3b62 in ?? ()
#16 0x0000000000000000 in ?? ()
(gdb)


Here is a update diff based on information/patches from netbsd, freebsd,
archlinux.

I also played with your x11/qt5/qtscript port. Dropped patches, added
USE_WXNEEDED.

However, unfortunately nothing helps.

Rafael

Index: Makefile
===================================================================
RCS file: /cvs/ports/cad/qcad/Makefile,v
retrieving revision 1.41
diff -u -p -u -p -r1.41 Makefile
--- Makefile 31 Mar 2022 12:52:14 -0000 1.41
+++ Makefile 13 Aug 2022 15:37:05 -0000
@@ -2,10 +2,9 @@ COMMENT = Qt-based 2D CAD system

GH_ACCOUNT = qcad
GH_PROJECT = qcad
-GH_TAGNAME = v3.24.3.0
-REVISION = 2
+GH_TAGNAME = v3.27.6.7

-SO_VERSION = 1.0
+SO_VERSION = 2.0
QCAD_LIBS = qcadcore \
qcadecmaapi \
qcadentity \
@@ -38,7 +37,9 @@ MODULES = devel/qmake \
x11/qt5

BUILD_DEPENDS = x11/qt5/qtimageformats
+
RUN_DEPENDS = devel/desktop-file-utils
+
LIB_DEPENDS = print/cups,-libs \
textproc/libstemmer \
x11/qt5/qtscript \
@@ -46,17 +47,22 @@ LIB_DEPENDS = print/cups,-libs \
x11/qt5/qttools \
x11/qt5/qtxmlpatterns

-SEPARATE_BUILD =No
-USE_GMAKE = Yes
-
-NO_TEST = Yes
+SEPARATE_BUILD = No
+USE_GMAKE = Yes
+NO_TEST = Yes

pre-configure:
# Do not require specific Qt version
- sed -i "s|\$$\$${QT_VERSION}|5.5.0|g" \
+ sed -i "s|\$$\$${QT_VERSION}|${MODQT5_VERSION}|g" \
${WRKSRC}/src/3rdparty/3rdparty.pro
+ mkdir ${WRKSRC}/src/3rdparty/qt-labs-qtscriptgenerator-${MODQT5_VERSION}
+ cp ${WRKSRC}/src/3rdparty/qt-labs-qtscriptgenerator-5.15.2/qt-labs-qtscriptgenerator-5.15.2.pro \
+ ${WRKSRC}/src/3rdparty/qt-labs-qtscriptgenerator-${MODQT5_VERSION}/qt-labs-qtscriptgenerator-${MODQT5_VERSION}.pro
${SUBST_CMD} ${WRKSRC}/src/core/RS.cpp \
- ${WRKSRC}/src/core/RSettings.cpp
+ ${WRKSRC}/src/core/RSettings.cpp \
+ ${WRKSRC}/scripts/Help/ShowReadme/ShowReadme.js \
+ ${WRKSRC}/scripts/Widgets/LibraryBrowser/LibraryBrowser.js
+

do-install:
${INSTALL_PROGRAM} ${WRKSRC}/release/qcad-bin ${PREFIX}/bin/qcad
Index: distinfo
===================================================================
RCS file: /cvs/ports/cad/qcad/distinfo,v
retrieving revision 1.8
diff -u -p -u -p -r1.8 distinfo
--- distinfo 13 Apr 2020 08:48:39 -0000 1.8
+++ distinfo 13 Aug 2022 15:37:05 -0000
@@ -1,2 +1,2 @@
-SHA256 (qcad-3.24.3.0.tar.gz) = A1JZf9QfaKQ8+qrFsWufK9Dn2x12mGPJMXDeZMgEv3c=
-SIZE (qcad-3.24.3.0.tar.gz) = 33874174
+SHA256 (qcad-3.27.6.7.tar.gz) = 28o7+p9nHj+bAfXf8LhIdDwhyPv314x7Gkor1PlzNLM=
+SIZE (qcad-3.27.6.7.tar.gz) = 41097738
Index: patches/patch-qcad_pro
===================================================================
RCS file: patches/patch-qcad_pro
diff -N patches/patch-qcad_pro
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-qcad_pro 13 Aug 2022 15:37:05 -0000
@@ -0,0 +1,15 @@
+disable searching outside of the source directory
+
+Index: qcad.pro
+--- qcad.pro.orig
++++ qcad.pro
+@@ -11,9 +11,6 @@ win32 {
+ SUBDIRS += ..\\$$dir
+ }
+ }
+-else {
+- SUBDIRS += $$system("ls -d ../qcad?* 2>/dev/null | grep -v $(basename $(pwd))$")
+-}
+
+ !r_mobile {
+ exists(support) {
Index: patches/patch-scripts_Help_About_About_js
===================================================================
RCS file: /cvs/ports/cad/qcad/patches/patch-scripts_Help_About_About_js,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 patch-scripts_Help_About_About_js
--- patches/patch-scripts_Help_About_About_js 11 Mar 2022 18:24:31 -0000 1.3
+++ patches/patch-scripts_Help_About_About_js 13 Aug 2022 15:37:05 -0000
@@ -1,7 +1,7 @@
Index: scripts/Help/About/About.js
--- scripts/Help/About/About.js.orig
+++ scripts/Help/About/About.js
-@@ -467,6 +467,9 @@ About.prototype.initAboutSystem = function(textEdit) {
+@@ -474,6 +474,9 @@ About.prototype.initAboutSystem = function(textEdit) {
if (RS.getSystemId()==="solaris") {
text += "Solaris";
}
Index: patches/patch-scripts_Help_ShowReadme_ShowReadme_js
===================================================================
RCS file: patches/patch-scripts_Help_ShowReadme_ShowReadme_js
diff -N patches/patch-scripts_Help_ShowReadme_ShowReadme_js
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-scripts_Help_ShowReadme_ShowReadme_js 13 Aug 2022 15:37:05 -0000
@@ -0,0 +1,12 @@
+Index: scripts/Help/ShowReadme/ShowReadme.js
+--- scripts/Help/ShowReadme/ShowReadme.js.orig
++++ scripts/Help/ShowReadme/ShowReadme.js
+@@ -19,7 +19,7 @@
+
+ include("scripts/Help/Help.js");
+
+-ShowReadme.readmeFile = "readme.txt";
++ShowReadme.readmeFile = "${LOCALBASE}/share/qcadreadme.txt";
+
+ function ShowReadme(guiAction) {
+ Help.call(this, guiAction);
Index: patches/patch-scripts_Widgets_CommandLine_CommandLine_js
===================================================================
RCS file: /cvs/ports/cad/qcad/patches/patch-scripts_Widgets_CommandLine_CommandLine_js,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 patch-scripts_Widgets_CommandLine_CommandLine_js
--- patches/patch-scripts_Widgets_CommandLine_CommandLine_js 11 Mar 2022 18:24:31 -0000 1.3
+++ patches/patch-scripts_Widgets_CommandLine_CommandLine_js 13 Aug 2022 15:37:05 -0000
@@ -1,7 +1,7 @@
Index: scripts/Widgets/CommandLine/CommandLine.js
--- scripts/Widgets/CommandLine/CommandLine.js.orig
+++ scripts/Widgets/CommandLine/CommandLine.js
-@@ -490,6 +490,9 @@ CommandLine.init = function(basePath) {
+@@ -498,6 +498,9 @@ CommandLine.init = function(basePath) {
case "solaris":
system = "Solaris";
break;
Index: patches/patch-scripts_Widgets_LibraryBrowser_LibraryBrowser_js
===================================================================
RCS file: patches/patch-scripts_Widgets_LibraryBrowser_LibraryBrowser_js
diff -N patches/patch-scripts_Widgets_LibraryBrowser_LibraryBrowser_js
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-scripts_Widgets_LibraryBrowser_LibraryBrowser_js 13 Aug 2022 15:37:05 -0000
@@ -0,0 +1,18 @@
+Index: scripts/Widgets/LibraryBrowser/LibraryBrowser.js
+--- scripts/Widgets/LibraryBrowser/LibraryBrowser.js.orig
++++ scripts/Widgets/LibraryBrowser/LibraryBrowser.js
+@@ -174,12 +174,12 @@ LibraryBrowser.getSourceList = function() {
+ var libs;
+
+ // no configuration: add all libraries available in libraries subdir:
+- librariesDir = new QDir("libraries");
++ librariesDir = new QDir("${LOCALBASE}/share/qcad/libraries");
+ libs = librariesDir.entryList([], filters, sortFlags);
+ for (i=0; i<libs.length; i++) {
+ // always add default library if available:
+ if (libs[i]==="default" || noSourcesConfigured) {
+- sourceList.push(QDir.fromNativeSeparators(new QDir("libraries/%1".arg(libs[i])).absolutePath()));
++ sourceList.push(QDir.fromNativeSeparators(new QDir("%1/%2".arg(librariesDir.absolutePath()).arg(libs[i])).absolutePath()));
+ }
+ }
+
Index: patches/patch-shared_app_pri
===================================================================
RCS file: /cvs/ports/cad/qcad/patches/patch-shared_app_pri,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-shared_app_pri
--- patches/patch-shared_app_pri 11 Mar 2022 18:24:31 -0000 1.2
+++ patches/patch-shared_app_pri 13 Aug 2022 15:37:05 -0000
@@ -1,7 +1,7 @@
Index: shared_app.pri
--- shared_app.pri.orig
+++ shared_app.pri
-@@ -16,7 +16,7 @@ LIBS += \
+@@ -19,7 +19,7 @@ LIBS += \
!r_no_opennurbs {
LIBS += \
-lopennurbs \
Index: patches/patch-shared_pri
===================================================================
RCS file: /cvs/ports/cad/qcad/patches/patch-shared_pri,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-shared_pri
--- patches/patch-shared_pri 11 Mar 2022 18:24:31 -0000 1.2
+++ patches/patch-shared_pri 13 Aug 2022 15:37:05 -0000
@@ -1,7 +1,7 @@
Index: shared.pri
--- shared.pri.orig
+++ shared.pri
-@@ -164,7 +164,7 @@ else {
+@@ -193,7 +193,7 @@ else {

CONFIG -= warn_off
CONFIG += warn_on
Index: patches/patch-src_core_RDebug_cpp
===================================================================
RCS file: /cvs/ports/cad/qcad/patches/patch-src_core_RDebug_cpp,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-src_core_RDebug_cpp
--- patches/patch-src_core_RDebug_cpp 11 Mar 2022 18:24:31 -0000 1.2
+++ patches/patch-src_core_RDebug_cpp 13 Aug 2022 15:37:05 -0000
@@ -4,7 +4,7 @@ have in our libc.
Index: src/core/RDebug.cpp
--- src/core/RDebug.cpp.orig
+++ src/core/RDebug.cpp
-@@ -34,7 +34,7 @@ QMap<QString, int> RDebug::counter;
+@@ -35,7 +35,7 @@ QMap<QString, int> RDebug::counter;
QString RDebug::prefix;

void RDebug::printBacktrace(const QString& prefix) {
Index: patches/patch-src_core_RS_cpp
===================================================================
RCS file: /cvs/ports/cad/qcad/patches/patch-src_core_RS_cpp,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-src_core_RS_cpp
--- patches/patch-src_core_RS_cpp 11 Mar 2022 18:24:31 -0000 1.2
+++ patches/patch-src_core_RS_cpp 13 Aug 2022 15:37:05 -0000
@@ -1,12 +1,13 @@
Index: src/core/RS.cpp
--- src/core/RS.cpp.orig
+++ src/core/RS.cpp
-@@ -150,6 +150,8 @@ QStringList RS::getDirectoryList(const QString& subDir
+@@ -169,6 +169,9 @@ QStringList RS::getDirectoryList(const QString& subDir
dirList.append(appDir + "/../Resources/" + subDirectory);
dirList.append(appDir + "/../../../" + subDirectory);
dirList.append(QDir::currentPath() + "/" + subDirectory);
+#elif defined Q_OS_OPENBSD
+ dirList.append("${LOCALBASE}/share/qcad/" + subDirectory);
++ dirList.append(QDir::homePath() + "/.qcad/" + subDirectory);
#else
dirList.append(appDir + "/" + subDirectory);

No comments:

Post a Comment