QCAD - 2D CAD System.

Click here for a documentation of the DokuWiki formatting syntax that can be used in reports

Please search for existing tasks (also closed ones) before opening a new task.

Please make sure that you are using the latest Version of QCAD before posting a bug (menu Help > Check for Updates)


FS#818 - SVG Exporter crashes on polyline

Attached to Project: QCAD
Opened by Peter (hungerburg) - Monday, 03 June 2013, 16:33 GMT+2
Last edited by Andrew (andrew) - Friday, 14 June 2013, 22:24 GMT+2
Task Type Bug Report
Category QCAD (main)
Status Closed
Assigned To Andrew (andrew)
Operating System All
Severity Low
Priority Normal
Reported Version 3.1.0 Beta 1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Attached sample drawing, that kills QCAD 3.1 beta when exporting to SVG.

The crash happens in line 38 of SvgExporterPG in function SvgExporterPG.prototype.exportPolyline

var pp = new RPainterPath(polyline.toPainterPath());
This task depends upon

Closed by  Andrew (andrew)
Friday, 14 June 2013, 22:24 GMT+2
Reason for closing:  Fixed
Comment by Andrew (andrew) - Monday, 03 June 2013, 20:36 GMT+2

Thanks. What platform are you on? Are there any special settings you are using other than "Preserve geometry"?
I'm trying to reproduce the problem here without success so far.

Comment by Peter (hungerburg) - Tuesday, 04 June 2013, 12:02 GMT+2

Thank You Andrew, I now did unpack the distribution in a new directory and renamed the configuration file.

Indeed, here it is enough to request PG from extended SVG export to trigger the segfault.

I fire up ./qcad, draw a polyline with two segments, call the SVG export, tick PG, Save, crash.

I now installed a 32bit valgrind, perhaps its output gives a clue? System is Ubuntu 12.04.

:) $ pwd

:) $ file qcad-bin
qcad-bin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.4, BuildID[sha1]=0x45e1653e76ee3681de2db242509d6c1009c75f23, stripped

:( $ uname -a
Linux lazy 3.2.0-44-generic #69-Ubuntu SMP Thu May 16 17:35:01 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

:) $ LD_LIBRARY_PATH=. ldd ./qcad-bin
	linux-gate.so.1 =>  (0xf76f4000)
	libqcadecmaapi.so => ./libqcadecmaapi.so (0xf68ef000)
	libqcadgui.so => ./libqcadgui.so (0xf689a000)
	libqcadentity.so => ./libqcadentity.so (0xf67c3000)
	libqcadoperations.so => ./libqcadoperations.so (0xf67ac000)
	libqcadspatialindex.so => ./libqcadspatialindex.so (0xf67a1000)
	libspatialindexnavel.so => ./libspatialindexnavel.so (0xf66db000)
	libqcadgrid.so => ./libqcadgrid.so (0xf66ce000)
	libqcadsnap.so => ./libqcadsnap.so (0xf66bd000)
	libqcadcore.so => ./libqcadcore.so (0xf620c000)
	libqcadstemmer.so => ./libqcadstemmer.so (0xf61e9000)
	libGLU.so.1 => /usr/lib/i386-linux-gnu/libGLU.so.1 (0xf6154000)
	libQtWebKit.so.4 => ./libQtWebKit.so.4 (0xf4a7f000)
	libQtScriptTools.so.4 => ./libQtScriptTools.so.4 (0xf49c7000)
	libQtScript.so.4 => ./libQtScript.so.4 (0xf4724000)
	libQtSvg.so.4 => ./libQtSvg.so.4 (0xf46ce000)
	libQtXmlPatterns.so.4 => ./libQtXmlPatterns.so.4 (0xf42ba000)
	libQtOpenGL.so.4 => ./libQtOpenGL.so.4 (0xf41b7000)
	libQtXml.so.4 => ./libQtXml.so.4 (0xf4172000)
	libGL.so.1 => /usr/lib32/fglrx/libGL.so.1 (0xf4085000)
	libQtDesigner.so.4 => ./libQtDesigner.so.4 (0xf3b4a000)
	libQtHelp.so.4 => ./libQtHelp.so.4 (0xf3ac4000)
	libQtSql.so.4 => ./libQtSql.so.4 (0xf3a83000)
	libQtGui.so.4 => ./libQtGui.so.4 (0xf2f89000)
	libQtNetwork.so.4 => ./libQtNetwork.so.4 (0xf2e42000)
	libQtCore.so.4 => ./libQtCore.so.4 (0xf2b42000)
	libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf2b27000)
	libstdc++.so.6 => ./libstdc++.so.6 (0xf2a38000)
	libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf2a0b000)
	libgcc_s.so.1 => ./libgcc_s.so.1 (0xf29ed000)
	libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf2844000)
	libfontconfig.so.1 => /usr/lib/i386-linux-gnu/libfontconfig.so.1 (0xf280f000)
	libfreetype.so.6 => /usr/lib/i386-linux-gnu/libfreetype.so.6 (0xf2775000)
	libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0xf2763000)
	libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf262f000)
	libXrender.so.1 => /usr/lib/i386-linux-gnu/libXrender.so.1 (0xf2625000)
	libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf261f000)
	libQtCLucene.so.4 => ./libQtCLucene.so.4 (0xf2516000)
	libgthread-2.0.so.0 => /usr/lib/i386-linux-gnu/libgthread-2.0.so.0 (0xf2513000)
	librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xf250a000)
	libglib-2.0.so.0 => /lib/i386-linux-gnu/libglib-2.0.so.0 (0xf2410000)
	libgobject-2.0.so.0 => /usr/lib/i386-linux-gnu/libgobject-2.0.so.0 (0xf23c1000)
	libSM.so.6 => /usr/lib/i386-linux-gnu/libSM.so.6 (0xf23b8000)
	libICE.so.6 => /usr/lib/i386-linux-gnu/libICE.so.6 (0xf239e000)
	/lib/ld-linux.so.2 (0xf76f5000)
	libexpat.so.1 => /lib/i386-linux-gnu/libexpat.so.1 (0xf2374000)
	libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf235d000)
	libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf233c000)
	libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xf2300000)
	libffi.so.6 => /usr/lib/i386-linux-gnu/libffi.so.6 (0xf22f9000)
	libuuid.so.1 => /lib/i386-linux-gnu/libuuid.so.1 (0xf22f3000)
	libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf22ee000)
	libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf22e7000)

:) $ export LD_LIBRARY_PATH=/opt/qcad-3.1.0-beta-pro-linux-x86
:) $ valgrind /opt/qcad-3.1.0-beta-pro-linux-x86/qcad-bin

==4324== Process terminating with default action of signal 11 (SIGSEGV)
==4324==  Bad permissions for mapped region at address 0x8CF8F88
==4324==    at 0xF70CDC1: QPainterPath::QPainterPath(QPainterPath const&) (in /opt/qcad-3.1.0-beta-pro-linux-x86/libQtGui.so.4)
==4324==    by 0x89E72E4: RPainterPath::RPainterPath(QPainterPath const&) (in /opt/qcad-3.1.0-beta-pro-linux-x86/libqcadcore.so)
==4324==    by 0x7171FFE: REcmaPainterPath::create(QScriptContext*, QScriptEngine*) (in /opt/qcad-3.1.0-beta-pro-linux-x86/libqcadecmaapi.so)
==4324==    by 0xBBE8A8A: QScript::FunctionWrapper::proxyConstruct(QTJSC::ExecState*, QTJSC::JSObject*, QTJSC::ArgList const&) (in /opt/qcad-3.1.0-beta-pro-linux-x86/libQtScript.so.4)
==4324==    by 0xBAEBD32: QTJSC::NativeConstrWrapper::operator()(QTJSC::ExecState*, QTJSC::JSObject*, QTJSC::ArgList const&) const (in /opt/qcad-3.1.0-beta-pro-linux-x86/libQtScript.so.4)
==4324==    by 0xBABA4DF: cti_op_construct_NotJSConstruct (in /opt/qcad-3.1.0-beta-pro-linux-x86/libQtScript.so.4)
==4324==    by 0x4065A094: ???
==4324==    by 0xBA67684: QTJSC::Interpreter::execute(QTJSC::FunctionExecutable*, QTJSC::ExecState*, QTJSC::JSFunction*, QTJSC::JSObject*, QTJSC::ArgList const&, QTJSC::ScopeChainNode*, QTJSC::JSValue*) (in /opt/qcad-3.1.0-beta-pro-linux-x86/libQtScript.so.4)
==4324==    by 0xBB10CAB: QTJSC::JSFunction::call(QTJSC::ExecState*, QTJSC::JSValue, QTJSC::ArgList const&) (in /opt/qcad-3.1.0-beta-pro-linux-x86/libQtScript.so.4)
==4324==    by 0xBAE5CAD: QTJSC::call(QTJSC::ExecState*, QTJSC::JSValue, QTJSC::CallType, QTJSC::CallData const&, QTJSC::JSValue, QTJSC::ArgList const&) (in /opt/qcad-3.1.0-beta-pro-linux-x86/libQtScript.so.4)
==4324==    by 0xBBE2731: QScriptValue::call(QScriptValue const&, QList<QScriptValue> const&) (in /opt/qcad-3.1.0-beta-pro-linux-x86/libQtScript.so.4)
==4324==    by 0x7507ACD: REcmaShellFileExporterAdapter::exportPolyline(RPolyline const&, double) (in /opt/qcad-3.1.0-beta-pro-linux-x86/libqcadecmaapi.so)
==4324== HEAP SUMMARY:
==4324==     in use at exit: 88,361,050 bytes in 204,412 blocks
==4324==   total heap usage: 4,102,374 allocs, 3,897,962 frees, 325,343,381 bytes allocated
==4324== LEAK SUMMARY:
==4324==    definitely lost: 4,432 bytes in 29 blocks
==4324==    indirectly lost: 18,100 bytes in 902 blocks
==4324==      possibly lost: 490,114 bytes in 8,349 blocks
==4324==    still reachable: 87,848,404 bytes in 195,132 blocks
==4324==         suppressed: 0 bytes in 0 blocks
==4324== Rerun with --leak-check=full to see details of leaked memory
==4324== For counts of detected and suppressed errors, rerun with: -v
==4324== Use --track-origins=yes to see where uninitialised values come from
==4324== ERROR SUMMARY: 19203 errors from 102 contexts (suppressed: 1 from 1)
Comment by Andrew (andrew) - Friday, 07 June 2013, 13:42 GMT+2

Not reproducible here with a virgin Ubuntu 12.04 64bit, packages ia32-lib and ia32-lib-multiarch installed.

Comment by Peter (hungerburg) - Monday, 10 June 2013, 15:11 GMT+2

Hmm, puzzling that. I only had the required dependencies installed, but installing all of ia32-lib-multiarch does not help. I now tried on another system, that is conservatively managed and eg. does not pull "precise-proposed" sources, which might spoil the fun. Still "./dwg2svg -f -g /tmp/poly.dxf" ends with a segfault in 3.1beta, while works in 3.0.0.

In search of what change in the envirnment might cause the failure, only idea now, is that my systems both are 12.04.2, i.e. fully updated, and use the "precise-updates" repo, which is a recommended practice for ubuntu users, and which brought an update to all the qt4* and many *:i386 packages...

Comment by Peter (hungerburg) - Wednesday, 12 June 2013, 10:33 GMT+2

The more puzzling: Yesterday I installed (unpacked the zip) qcad3.1 pro beta on a windows 7 system. There is also qcad3.0.0 on that system, but as far as I can tell, qcad3.1 will not use any of the settings from 3.0.

So I started the application, drew some three or four segments polyline and exported to svg from the button, then again from the menu and ticked "preserve gemoetry" and instantly was greeted with a box saying "the application does not work anymore, windows is looking into it".

I suppose its the same fault as on ubuntu. Today I may try on another, even cleaner windows 7 box.

Comment by Andrew (andrew) - Friday, 14 June 2013, 22:24 GMT+2

I was finally able to reproduce this under a Windows XP installation. The problem is likely fixed in QCAD 3.1. Please let me know if not.

Comment by Peter (hungerburg) - Saturday, 15 June 2013, 17:13 GMT+2

Thank You Andrew, I loaded the 3.1 release and found SVG-PG exporting of polylines working.